[sr #110392] Define _NETBSD_SOURCE and _OPENBSD_SOURCE in AC_USE_SYSTEM_EXTENSIONS

Julien ÉLIE <[email protected]>
Newsgroups gmane.comp.sysutils.autoconf.bugs
Message-ID <[email protected]>
URL:
  <https://savannah.gnu.org/support/?110392>

                 Summary: Define _NETBSD_SOURCE and _OPENBSD_SOURCE in
AC_USE_SYSTEM_EXTENSIONS
                 Project: Autoconf
            Submitted by: iulius
            Submitted on: Sun 06 Dec 2020 09:08:28 AM UTC
                Category: None
                Priority: 5 - Normal
                Severity: 3 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
        Operating System: None

    _______________________________________________________

Details:

Hi,

A few prototypes are available on NetBSD only when _NETBSD_SOURCE or
_OPENBSD_SOURCE are set.
Would it be possible to add them to AC_USE_SYSTEM_EXTENSIONS?

--- specific.m4.old	2020-12-06 09:54:37.394649064 +0100
+++ specific.m4	2020-12-06 09:59:35.490562935 +0100
@@ -396,6 +396,14 @@
 #ifndef _GNU_SOURCE
 # undef _GNU_SOURCE
 #endif
+/* Enable NetBSD extensions on NetBSD.  */
+#ifndef _NETBSD_SOURCE
+# undef _NETBSD_SOURCE
+#endif
+/* Enable OpenBSD extensions on NetBSD.  */
+#ifndef _OPENBSD_SOURCE
+# undef _OPENBSD_SOURCE
+#endif
 /* Enable threading extensions on Solaris.  */
 #ifndef _POSIX_PTHREAD_SEMANTICS
 # undef _POSIX_PTHREAD_SEMANTICS
@@ -456,6 +464,8 @@
   AC_DEFINE([_ALL_SOURCE])
   AC_DEFINE([_DARWIN_C_SOURCE])
   AC_DEFINE([_GNU_SOURCE])
+  AC_DEFINE([_NETBSD_SOURCE])
+  AC_DEFINE([_OPENBSD_SOURCE])
   AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
   AC_DEFINE([__STDC_WANT_IEC_60559_ATTRIBS_EXT__])
   AC_DEFINE([__STDC_WANT_IEC_60559_BFP_EXT__])


Seems like a few projects already use it locally:
 
http://tug.ctan.org/tex-archive/macros/texinfo/texinfo/gnulib/m4/extensions.m4

And we recently encountered a build issue with reallocarray (NetBSD preferring
reallocarr):
 
https://git.eyrie.org/?p=devel/rra-c-util.git;a=commitdiff;h=f8a922cf31804dcc25ac176dcc22fdcdffcb5fdf


Thanks beforehand,

-- 
Julien ÉLIE





    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/support/?110392>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.