diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/all.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -1,6 +1,14 @@ #include <stddef.h> #include <stdint.h> +#if SDL +#include <string.h> +#define xmemcpy memcpy +#else +#define xmemcpy __builtin_memcpy +#endif + + typedef struct { unsigned char r, g, b, a; } Color; @@ -122,7 +130,7 @@ static void update(Game *game, uint64_t now, Arena a) { if (game->state.playing && game->state.lastTick + TICK_LENGTH <= now) { game->state.lastTick = now; State *lastState = new(&a, 1, State); - __builtin_memcpy(lastState, game, sizeof(State)); + xmemcpy(lastState, game, sizeof(State)); for (int x = 0; x < GRIDWIDTH; x++) { for (int y = 0; y < GRIDHEIGHT; y++) { |