aboutsummaryrefslogtreecommitdiff
path: root/compat/compat.h
diff options
context:
space:
mode:
Diffstat (limited to 'compat/compat.h')
-rw-r--r--compat/compat.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/compat/compat.h b/compat/compat.h
new file mode 100644
index 0000000..b36b17f
--- /dev/null
+++ b/compat/compat.h
@@ -0,0 +1,21 @@
+// compat.h
+// Compatibility layer for functions not in standard C99
+
+#ifndef MOSLIB_COMPAT_H
+#define MOSLIB_COMPAT_H
+
+#define _XOPEN_SOURCE 500
+#define _GNU_SOURCE
+
+typedef void declaration;
+
+#ifdef NO_STRDUP
+extern char *strdup(const char *s);
+#endif // NO_STRDUP
+
+#ifdef NO_MEMMEM
+#include <stddef.h>
+extern void *memmem(const void *h, size_t h_size, const void *n, size_t n_size);
+#endif // NO_MEMMEM
+
+#endif // MOSLIB_COMPAT_H