{"thread":{"id":"38031","subject":"[PATCH] git-compat-util.h: don't define _XOPEN_SOURCE on cygwin","startedAt":"2014-11-23T17:14:55Z","lastAt":"2014-11-23T17:14:55Z","messageCount":1,"participants":["Ramsay Jones"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"252395","messageId":"5472160F.6030509@ramsay1.demon.co.uk","threadId":"38031","inReplyTo":null,"subject":"[PATCH] git-compat-util.h: don't define _XOPEN_SOURCE on cygwin","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2014-11-23T17:14:55Z","receivedAt":"2014-11-23T17:14:55Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nA recent update to the gcc compiler (v4.8.3-5 x86_64) on 64-bit\ncygwin leads to several new warnings about the implicit declaration\nof the memmem(), strlcpy() and strcasestr() functions. For example:\n\n      CC archive.o\n  archive.c: In function 'format_subst':\n  archive.c:44:3: warning: implicit declaration of function 'memmem' \\\n    [-Wimplicit-function-declaration]\n     b = memmem(src, len, \"$Format:\", 8);\n     ^\n  archive.c:44:5: warning: assignment makes pointer from integer \\\n    without a cast [enabled by default]\n     b = memmem(src, len, \"$Format:\", 8);\n     ^\nThis seems to be caused by a change to the system headers which\nresults in the _XOPEN_SOURCE macro now having prioity over the\n_GNU_SOURCE and _BSD_SOURCE macros (they are simply ignored).\nThis in turn leads to the declarations of the above functions\nto be suppressed.\n\nIn order to suppress the warnings, don't define the _XOPEN_SOURCE\nmacro on cygwin\n\nSigned-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n---\n git-compat-util.h | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)\n\ndiff --git a/git-compat-util.h b/git-compat-util.h\nindex 400e921..cef2691 100644\n--- a/git-compat-util.h\n+++ b/git-compat-util.h\n@@ -75,7 +75,8 @@\n # endif\n #elif !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__USLC__) && \\\n       !defined(_M_UNIX) && !defined(__sgi) && !defined(__DragonFly__) && \\\n-      !defined(__TANDEM) && !defined(__QNX__) && !defined(__MirBSD__)\n+      !defined(__TANDEM) && !defined(__QNX__) && !defined(__MirBSD__) && \\\n+      !defined(__CYGWIN__)\n #define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */\n #define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */\n #endif\n-- \n2.1.0\n"}]}