diff options
| author | Mosder <git@mosder.eu> | 2026-09-16 23:47:49 +0200 |
|---|---|---|
| committer | Mosder <git@mosder.eu> | 2026-09-16 23:47:49 +0200 |
| commit | 644130802a51d91b90e85a0769f642c3e0203aef (patch) | |
| tree | ad97ac1da8541a440a86c4c99402354bd94b06ca /compat/compat.h | |
| parent | 4af9b2a86ad5f5b7e59ba882aa527ecead75be0e (diff) | |
feat: added a simple compatibbility layer for functions not from C99 standard
Diffstat (limited to 'compat/compat.h')
| -rw-r--r-- | compat/compat.h | 21 |
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 |
