summaryrefslogtreecommitdiffstats
path: root/zix/common.h
diff options
context:
space:
mode:
Diffstat (limited to 'zix/common.h')
-rw-r--r--zix/common.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/zix/common.h b/zix/common.h
index 3271858..f7ec4c3 100644
--- a/zix/common.h
+++ b/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