+2025-01-16 Bruno Haible <bruno@clisp.org>
+
+ getopt-posix: Fix compilation error in C++ mode (regression 2024-09-21).
+ Reported by G. Branden Robinson <g.branden.robinson@gmail.com> in
+ <https://lists.gnu.org/archive/html/bug-gnulib/2025-01/msg00135.html>.
+ * lib/getopt-pfx-core.h: On several platforms, include <unistd.h> first.
+ * modules/getopt-posix (Files): Add m4/musl.m4.
+ (configure.ac): Invoke gl_MUSL_LIBC.
+
2025-01-16 Bruno Haible <bruno@clisp.org>
wchar_h: Fix for glibc 2.5.
/* getopt (basic, portable features) gnulib wrapper header.
- Copyright (C) 1989-2024 Free Software Foundation, Inc.
+ Copyright (C) 1989-2025 Free Software Foundation, Inc.
This file is part of gnulib.
Unlike most of the getopt implementation, it is NOT shared
with the GNU C Library.
# if defined _AIX || defined __hpux || defined __sun || defined __QNX__
# include <stdio.h>
# endif
+# if defined MUSL_LIBC || (defined __FreeBSD__ || defined __DragonFly__) || defined __NetBSD__ || defined __OpenBSD__ || (defined __APPLE__ && defined __MACH__) || defined _AIX || defined __sun || defined __minix || defined __HAIKU__
+# include <unistd.h>
+# endif
# ifndef __GETOPT_ID
# define __GETOPT_CONCAT(x, y) x ## y
lib/getopt_int.h
m4/getopt.m4
m4/sys_cdefs_h.m4
+m4/musl.m4
Depends-on:
unistd
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNISTD_H_GETOPT], [1])
])
gl_UNISTD_MODULE_INDICATOR([getopt-posix])
+gl_MUSL_LIBC
Makefile.am:
BUILT_SOURCES += $(GETOPT_H) $(GETOPT_CDEFS_H)