summaryrefslogtreecommitdiffstats
path: root/src/common/memrchr.h
diff options
context:
space:
mode:
authorsumuel <samuel@yakubos.org>2026-08-17 20:44:55 +0000
committersumuel <samuel@yakubos.org>2026-08-17 20:44:55 +0000
commit76424950e373d3b04ac3dd13019151bfba3e8423 (patch)
tree4c3cfdbda039e592b9186be3e28f8d7cfd439e8a /src/common/memrchr.h
Add the files
Diffstat (limited to 'src/common/memrchr.h')
-rw-r--r--src/common/memrchr.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/common/memrchr.h b/src/common/memrchr.h
new file mode 100644
index 0000000..6905a33
--- /dev/null
+++ b/src/common/memrchr.h
@@ -0,0 +1,15 @@
+#pragma once
+
+#include <stddef.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// `memrchr` is a GNU extension and may not be declared by system headers even when the symbol exists.
+// Declare it unconditionally; the build system provides a fallback implementation when missing.
+void* memrchr(const void* s, int c, size_t n);
+
+#ifdef __cplusplus
+}
+#endif