From: Jack Kelly Date: Sun, 5 Jan 2025 06:19:09 +0000 (-0800) Subject: AC_USE_SYSTEM_EXTENSIONS: Set _COSMO_SOURCE X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=059e5fc473b60edebcab2e030e8707f367fb80ee;p=thirdparty%2Fautoconf.git 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 870a5d9d8..b859fff61 100644 --- a/NEWS +++ b/NEWS @@ -28,6 +28,8 @@ GNU Autoconf NEWS - User visible changes. 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 9d2c2d0d8..4b0cf08da 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -8852,6 +8852,9 @@ Define the following preprocessor macros unconditionally: @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 acf4ebd56..ecd6ab5a2 100644 --- a/lib/autoconf/specific.m4 +++ b/lib/autoconf/specific.m4 @@ -551,6 +551,10 @@ AH_VERBATIM([USE_SYSTEM_EXTENSIONS], #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 @@ dnl it should only be defined when necessary. [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])