diff options
| -rw-r--r-- | wrmr.h | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -76,14 +76,15 @@ typedef uintptr_t uptr; #define UNREACHABLE UNREACHABLE_MSG("unreachable code") +#define ASSUME(...) do if (!(__VA_ARGS__)) UNREACHABLE_MSG("assumption failed: " #__VA_ARGS__); while(0) #ifdef NDEBUG # if defined(_MSC_VER) +# undef ASSUME # define ASSUME(...) (__assume(__VA_ARGS__)) # elif HAS_BUILTIN(__builtin_assume) +# undef ASSUME # define ASSUME(...) (__builtin_assume(__VA_ARGS__)) # endif -#else -# define ASSUME(...) do if (!(__VA_ARGS__)) UNREACHABLE_MSG("assumption failed: " #__VA_ARGS__); while(0) #endif #if __STDC_VERSION__ >= 202311L @@ -93,5 +94,7 @@ typedef uintptr_t uptr; #endif #define COUNTOF(x) (sizeof(x) / sizeof(*(x))) +#define MOVE(a0, a1, n) memmove(1?(a0):(a1), a1, sizeof(*(a0)) * (n)); +#define COPY(a0, a1, n) memmove(1?(a0):(a1), a1, sizeof(*(a0)) * (n)); #endif |
