AC_USE_SYSTEM_EXTENSIONS: Set _COSMO_SOURCE This enables extensions when compiling with Cosmopolitan Libc. https://justine.lol/cosmopolitan/ * lib/autoconf/specific.m4: Define _COSMO_SOURCE.
diff --git a/NEWS b/NEWS index 870a5d9..b859fff 100644 --- a/NEWS +++ b/NEWS
@@ -28,6 +28,8 @@ The autom4te, autoscan and ifnames programs now recognize the two preprocessor directives, which were introduced in C23 and C++23. +*** AC_USE_SYSTEM_EXTENSIONS now defines _COSMO_SOURCE for Cosmopolitan Libc. + ** Notable bug fixes *** AC_FUNC_STRNLEN now detects Android 5.0's broken strnlen.
diff --git a/doc/autoconf.texi b/doc/autoconf.texi index 9d2c2d0..4b0cf08 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi
@@ -8852,6 +8852,9 @@ @item _ALL_SOURCE @cvindex _ALL_SOURCE Enable extensions on AIX and z/OS. +@item _COSMO_SOURCE +@cvindex _COSMO_SOURCE +Enable extensions on Cosmopolitan Libc. @item _DARWIN_C_SOURCE @cvindex _DARWIN_C_SOURCE Enable extensions on macOS.
diff --git a/lib/autoconf/specific.m4 b/lib/autoconf/specific.m4 index acf4ebd..ecd6ab5 100644 --- a/lib/autoconf/specific.m4 +++ b/lib/autoconf/specific.m4
@@ -551,6 +551,10 @@ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif +/* Enable extensions on Cosmopolitan Libc. */ +#ifndef _COSMO_SOURCE +# undef _COSMO_SOURCE +#endif /* Enable general extensions on macOS. */ #ifndef _DARWIN_C_SOURCE # undef _DARWIN_C_SOURCE @@ -677,6 +681,7 @@ [ac_cv_should_define__xopen_source=yes])])])]) AC_DEFINE([_ALL_SOURCE]) + AC_DEFINE([_COSMO_SOURCE]) AC_DEFINE([_DARWIN_C_SOURCE]) AC_DEFINE([_GNU_SOURCE]) AC_DEFINE([_HPUX_ALT_XOPEN_SOCKET_API])