* lib/getopt-pfx-core.h (_GETOPT) [__APPLE__ && __GETOPT_PREFIX]:
Define to work around a problem with asm on macOS (Bug#40205).
+2020-03-25 Paul Eggert <eggert@cs.ucla.edu>
+
+ getopt-posix: port __GETOPT_PREFIX to macOS
+ * lib/getopt-pfx-core.h (_GETOPT) [__APPLE__ && __GETOPT_PREFIX]:
+ Define to work around a problem with asm on macOS (Bug#40205).
+
2020-03-22 Bruno Haible <bruno@clisp.org>
MODULES.html.sh: Add support for reproducible builds.
# define optind __GETOPT_ID (optind)
# define optopt __GETOPT_ID (optopt)
+/* Work around a a problem on macOS, which declares getopt with a
+ trailing __DARWIN_ALIAS(getopt) that would expand to something like
+ __asm("_" "rpl_getopt" "$UNIX2003") were it not for the following
+ hack to suppress the macOS declaration <https://bugs.gnu.org/40205>. */
+# ifdef __APPLE__
+# define _GETOPT
+# endif
+
/* The system's getopt.h may have already included getopt-core.h to
declare the unprefixed identifiers. Undef _GETOPT_CORE_H so that
getopt-core.h declares them with prefixes. */