diff options
Diffstat (limited to 'common.h')
-rw-r--r-- | common.h | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -24,16 +24,18 @@ #define MIN(x, y) ((x) > (y) ? (y) : (x)) #define ARRAY_ELEMS(arr) (sizeof(arr) / sizeof(*arr)) +#include <stdio.h> #include <stdlib.h> #include <stdint.h> -#include <sys/time.h> -static inline int64_t gettime(void) -{ - struct timeval tv; - gettimeofday(&tv, NULL); - return (int64_t)tv.tv_sec * 1000000 + tv.tv_usec; -} #define FD_STENCIL_MAX 4 +#define mg2di_assert(x) \ +do { \ + if (!(x)) { \ + fprintf(stderr, "Assertion " #x " failed\n"); \ + abort(); \ + } \ +} while (0) + #endif /* MG2D_COMMON_H */ |