* lib/getopt.in.h: Arrange for the system's <getopt.h> to define
'struct sys_option' instead of 'struct option'.
* lib/getopt-pfx-ext.h (option): Don't rename to rpl_option.
+2025-04-16 Bruno Haible <bruno@clisp.org>
+
+ getopt-posix: Avoid trouble due to 'struct rpl_option'.
+ * lib/getopt.in.h: Arrange for the system's <getopt.h> to define
+ 'struct sys_option' instead of 'struct option'.
+ * lib/getopt-pfx-ext.h (option): Don't rename to rpl_option.
+
2025-04-16 Grisha Levit <grishalevit@gmail.com> (tiny change)
Ensure that the configuration cleans up conftest.dSYM directories.
# endif
# undef getopt_long
# undef getopt_long_only
-# undef option
# undef _getopt_internal
# define getopt_long __GETOPT_ID (getopt_long)
# define getopt_long_only __GETOPT_ID (getopt_long_only)
-# define option __GETOPT_ID (option)
# define _getopt_internal __GETOPT_ID (getopt_internal)
/* The system's getopt.h may have already included getopt-ext.h to
<getopt.h>; our definitions will be present soon enough. */
#if @HAVE_GETOPT_H@
# define _GL_SYSTEM_GETOPT
+/* Rename the system's 'struct option' to 'struct sys_option',
+ so that we don't have to rename ours to 'struct rpl_option'
+ (which would cause significant trouble in C++ mode). */
+# define option sys_option
# @INCLUDE_NEXT@ @NEXT_GETOPT_H@
+# undef option
# undef _GL_SYSTEM_GETOPT
#endif