aboutsummaryrefslogtreecommitdiffstats
path: root/common.h
diff options
context:
space:
mode:
authorMattias Andrée <m@maandree.se>2025-12-27 11:29:31 +0100
committerMattias Andrée <m@maandree.se>2025-12-27 11:29:31 +0100
commita72264006b738c8aa3d49d7835a86bcce130d20d (patch)
treee29423bcaaa1341b19ce9febd3f8de9fc0f95983 /common.h
parentFix libj2_j2u_add_j2u_overflow_p (diff)
downloadlibj2-a72264006b738c8aa3d49d7835a86bcce130d20d.tar.gz
libj2-a72264006b738c8aa3d49d7835a86bcce130d20d.tar.bz2
libj2-a72264006b738c8aa3d49d7835a86bcce130d20d.tar.xz
Add signed arithmetics
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to '')
-rw-r--r--common.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/common.h b/common.h
index 876d2ef..54f1e2e 100644
--- a/common.h
+++ b/common.h
@@ -1,13 +1,8 @@
/* See LICENSE file for copyright and license details. */
+#define LIBJ2_COMPILING_
#include "libj2.h"
-#if defined(__GNUC__)
-# define CONST __attribute__((__const__))
-# define PURE __attribute__((__pure__))
-#else
-# define CONST
-# define PURE
-#endif
+#define PURE LIBJ2_PURE_
#if defined(__clang__)
# pragma clang diagnostic ignored "-Wunsafe-buffer-usage" /* broken warning, spams false positives */
@@ -15,6 +10,11 @@
#endif
#ifdef TEST
+# if defined(__GNUC__)
+# define CONST __attribute__((__const__))
+# else
+# define CONST
+# endif
# include <stdlib.h>
# include <stdio.h>
# include <string.h>