summaryrefslogtreecommitdiffstats
path: root/src/zix/common.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/zix/common.h')
-rw-r--r--src/zix/common.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/zix/common.h b/src/zix/common.h
index 3271858..f7ec4c3 100644
--- a/src/zix/common.h
+++ b/src/zix/common.h
@@ -46,6 +46,21 @@
# define ZIX_API
# define ZIX_PRIVATE static
#endif
+
+#ifdef __GNUC__
+# define ZIX_PURE_FUNC __attribute__((pure))
+# define ZIX_CONST_FUNC __attribute__((const))
+# define ZIX_MALLOC_FUNC __attribute__((malloc))
+#else
+# define ZIX_PURE_FUNC
+# define ZIX_CONST_FUNC
+# define ZIX_MALLOC_FUNC
+#endif
+
+#define ZIX_PURE_API ZIX_API ZIX_PURE_FUNC
+#define ZIX_CONST_API ZIX_API ZIX_CONST_FUNC
+#define ZIX_MALLOC_API ZIX_API ZIX_MALLOC_FUNC
+
/** @endcond */
#ifdef __cplusplus