summaryrefslogtreecommitdiffstats
path: root/src/common/memrchr.h
diff options
context:
space:
mode:
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