Subject: | Mmap.xs:14:0: warning: "_POSIX_C_SOURCE" redefined |
Mmap.xs:14:0: warning: "_POSIX_C_SOURCE" redefined
This error is happening when the pre-processor variable _POSIX_C_SOURCE is already defined.
I think the correct thing to do is to wrap it in an #ifndef?
Subject: | patch.txt |
diff --git a/Mmap.xs b/Mmap.xs
index 85fe829..a15f847 100644
--- a/Mmap.xs
+++ b/Mmap.xs
@@ -11,7 +11,9 @@ extern "C" {
#include <unistd.h>
#ifndef MMAP_RETTYPE
+#ifndef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 199309
+#endif
#ifdef _POSIX_VERSION
#if _POSIX_VERSION >= 199309
#define MMAP_RETTYPE void *