summaryrefslogtreecommitdiffstats
path: root/include/config.h.in
diff options
context:
space:
mode:
authorLibravatar bigfoot547 <[email protected]>2025-11-16 20:52:57 -0600
committerLibravatar bigfoot547 <[email protected]>2025-11-16 20:52:57 -0600
commitd026e93405655129e46debfca2124ee132e9b134 (patch)
tree8adf037dd69c4226ef9a5d2a3dd8fa63eb783761 /include/config.h.in
parent[wip] plugin stuff (diff)
build config + more plugin stuff
Diffstat (limited to 'include/config.h.in')
-rw-r--r--include/config.h.in54
1 files changed, 54 insertions, 0 deletions
diff --git a/include/config.h.in b/include/config.h.in
new file mode 100644
index 0000000..49431a6
--- /dev/null
+++ b/include/config.h.in
@@ -0,0 +1,54 @@
+#ifndef PTXMC_CONFIG_H_INCLUDED
+#define PTXMC_CONFIG_H_INCLUDED
+
+#mesondefine PTX_IMPORT
+#mesondefine PTX_EXPORT
+
+#mesondefine HAS_ATTR_WUR
+#mesondefine HAS_ATTR_ALWAYS_INLINE
+#mesondefine HAS_ATTR_MALLOC
+#mesondefine HAS_ATTR_FORMAT
+#mesondefine HAS_RESTRICT
+
+#ifdef HAS_ATTR_WUR
+#define ATTR_WUR __attribute__((warn_unused_result))
+#else
+#define ATTR_WUR
+#endif
+
+#ifdef HAS_ATTR_ALWAYS_INLINE
+#define ATTR_ALWAYS_INLINE __attribute__((always_inline))
+#else
+#define ATTR_ALWAYS_INLINE
+#endif
+
+#ifdef HAS_ATTR_MALLOC
+#define ATTR_MALLOC(_x)
+#else
+#define ATTR_MALLOC(_x) __attribute__((malloc _x))
+#endif
+
+#ifdef HAS_ATTR_FORMAT
+#define ATTR_FORMAT(_x) __attribute__((format _x))
+#else
+#define ATTR_FORMAT(_x)
+#endif
+
+#ifdef HAS_RESTRICT
+#define PTX_RESTRICT restrict
+#else
+#define PTX_RESTRICT
+#endif
+
+/* meson doesn't support this one yet :( */
+#ifdef __has_attribute
+# if __has_attribute(access)
+# define ATTR_ACCESS(_x) __attribute__((access _x))
+# else
+# define ATTR_ACCESS(_x)
+# endif
+#else
+#define ATTR_ACCESS(_x)
+#endif
+
+#endif /* include guard */