Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[PATCH} define _GNU_SOURCE on Cygwin



Cygwin now started to require _XOPEN_SOURCE also for
wcwidth() (in addition to strptime(); cf. worker/38862).

Since wcwidth() is used in may files, I think it would be
better to define _GNU_SOURCE in zsh_system.h.

(defining _XOPEN_SOURCE alone hides may other function)


diff --git a/Src/Modules/datetime.c b/Src/Modules/datetime.c
index b924392..bb82c54 100644
--- a/Src/Modules/datetime.c
+++ b/Src/Modules/datetime.c
@@ -27,9 +27,6 @@
  *
  */
 
-#ifdef __CYGWIN__
-#define _XOPEN_SOURCE
-#endif
 #include "datetime.mdh"
 #include "datetime.pro"
 #include <time.h>
diff --git a/Src/zsh_system.h b/Src/zsh_system.h
index a9cbf02..5339b49 100644
--- a/Src/zsh_system.h
+++ b/Src/zsh_system.h
@@ -37,7 +37,7 @@
 #endif
 #endif
 
-#if defined(__linux) || defined(__GNU__) || defined(__GLIBC__) || defined(LIBC_MUSL)
+#if defined(__linux) || defined(__GNU__) || defined(__GLIBC__) || defined(LIBC_MUSL) || defined(__CYGWIN__)
 /*
  * Turn on numerous extensions.
  * This is in order to get the functions for manipulating /dev/ptmx.




Messages sorted by: Reverse Date, Date, Thread, Author