aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2017-04-09 00:53:27 -0700
committerPaul Eggert2017-04-09 00:55:23 -0700
commit43bc45ba1697b60c4589cb0c8e30cf1618275582 (patch)
tree1cfb5d5e35c0543dfaddc60d63171dc128f4b6ee
parent440bafef7cce6044d4f9d6ca3c3e0856ee9732b7 (diff)
downloademacs-43bc45ba1697b60c4589cb0c8e30cf1618275582.tar.gz
emacs-43bc45ba1697b60c4589cb0c8e30cf1618275582.zip
Merge from gnulib (Bug#26398)
This incorporates: 2017-04-08 getopt: prefer - to _ in new file names 2017-04-08 getopt: port recent getopt changes to macOS * .gitignore: Add lib/getopt-cdefs.h. * lib/getopt-cdefs.in.h: Rename from lib/getopt_cdefs.in.h. * lib/getopt-core.h: Rename from lib/getopt_core.h. * lib/getopt-ext.h: Rename from lib/getopt_ext.h. * lib/getopt-pfx-core.h: Rename from lib/getopt_pfx_core.h. * lib/getopt-pfx-ext.h: Rename from lib/getopt_pfx_ext.h. * lib/getopt.in.h, lib/unistd.in.h, m4/getopt.m4: Copy from Gnulib. * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
-rw-r--r--.gitignore1
-rw-r--r--lib/getopt-cdefs.in.h (renamed from lib/getopt_cdefs.in.h)12
-rw-r--r--lib/getopt-core.h (renamed from lib/getopt_core.h)4
-rw-r--r--lib/getopt-ext.h (renamed from lib/getopt_ext.h)6
-rw-r--r--lib/getopt-pfx-core.h (renamed from lib/getopt_pfx_core.h)6
-rw-r--r--lib/getopt-pfx-ext.h (renamed from lib/getopt_pfx_ext.h)6
-rw-r--r--lib/getopt.in.h10
-rw-r--r--lib/gnulib.mk.in10
-rw-r--r--lib/unistd.in.h18
-rw-r--r--m4/getopt.m44
-rw-r--r--m4/gnulib-comp.m410
11 files changed, 42 insertions, 45 deletions
diff --git a/.gitignore b/.gitignore
index aa9e1ff709e..fa9353453ce 100644
--- a/.gitignore
+++ b/.gitignore
@@ -56,6 +56,7 @@ lib/errno.h
56lib/execinfo.h 56lib/execinfo.h
57lib/fcntl.h 57lib/fcntl.h
58lib/getopt.h 58lib/getopt.h
59lib/getopt-cdefs.h
59lib/inttypes.h 60lib/inttypes.h
60lib/libgnu.a 61lib/libgnu.a
61lib/limits.h 62lib/limits.h
diff --git a/lib/getopt_cdefs.in.h b/lib/getopt-cdefs.in.h
index 18f9fb4f98a..c71a4f11f64 100644
--- a/lib/getopt_cdefs.in.h
+++ b/lib/getopt-cdefs.in.h
@@ -25,7 +25,7 @@
25 unistd.h instead. It does not have a protective #error, because 25 unistd.h instead. It does not have a protective #error, because
26 the guard macro for getopt.h in gnulib is not fixed. */ 26 the guard macro for getopt.h in gnulib is not fixed. */
27 27
28/* getopt_core.h and getopt_ext.h are shared with GNU libc, and expect 28/* getopt-core.h and getopt-ext.h are shared with GNU libc, and expect
29 a number of the internal macros supplied to GNU libc's headers by 29 a number of the internal macros supplied to GNU libc's headers by
30 sys/cdefs.h. Provide fallback definitions for all of them. */ 30 sys/cdefs.h. Provide fallback definitions for all of them. */
31#if @HAVE_SYS_CDEFS_H@ 31#if @HAVE_SYS_CDEFS_H@
@@ -64,12 +64,4 @@
64# endif 64# endif
65#endif 65#endif
66 66
67#ifndef __nonnull 67#endif /* _GETOPT_CDEFS_H */
68# if __GNUC_PREREQ (3,3)
69# define __nonnull(params) __attribute__ ((__nonnull__ params))
70# else
71# define __nonnull(params)
72# endif
73#endif
74
75#endif /* getopt_cdefs.h */
diff --git a/lib/getopt_core.h b/lib/getopt-core.h
index d6ef8a6b782..d315891aefd 100644
--- a/lib/getopt_core.h
+++ b/lib/getopt-core.h
@@ -89,8 +89,8 @@ extern int optopt;
89 writable. */ 89 writable. */
90 90
91extern int getopt (int ___argc, char *const *___argv, const char *__shortopts) 91extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
92 __THROW __nonnull ((2, 3)); 92 __THROW _GL_ARG_NONNULL ((2, 3));
93 93
94__END_DECLS 94__END_DECLS
95 95
96#endif /* getopt_core.h */ 96#endif /* _GETOPT_CORE_H */
diff --git a/lib/getopt_ext.h b/lib/getopt-ext.h
index 79b7a670d58..e4da22f54f5 100644
--- a/lib/getopt_ext.h
+++ b/lib/getopt-ext.h
@@ -66,12 +66,12 @@ struct option
66extern int getopt_long (int ___argc, char *__getopt_argv_const *___argv, 66extern int getopt_long (int ___argc, char *__getopt_argv_const *___argv,
67 const char *__shortopts, 67 const char *__shortopts,
68 const struct option *__longopts, int *__longind) 68 const struct option *__longopts, int *__longind)
69 __THROW __nonnull ((2, 3)); 69 __THROW _GL_ARG_NONNULL ((2, 3));
70extern int getopt_long_only (int ___argc, char *__getopt_argv_const *___argv, 70extern int getopt_long_only (int ___argc, char *__getopt_argv_const *___argv,
71 const char *__shortopts, 71 const char *__shortopts,
72 const struct option *__longopts, int *__longind) 72 const struct option *__longopts, int *__longind)
73 __THROW __nonnull ((2, 3)); 73 __THROW _GL_ARG_NONNULL ((2, 3));
74 74
75__END_DECLS 75__END_DECLS
76 76
77#endif /* getopt_ext.h */ 77#endif /* _GETOPT_EXT_H */
diff --git a/lib/getopt_pfx_core.h b/lib/getopt-pfx-core.h
index d585a08ce9f..4dc427dc3ef 100644
--- a/lib/getopt_pfx_core.h
+++ b/lib/getopt-pfx-core.h
@@ -27,7 +27,7 @@
27 27
28/* Standalone applications should #define __GETOPT_PREFIX to an 28/* Standalone applications should #define __GETOPT_PREFIX to an
29 identifier that prefixes the external functions and variables 29 identifier that prefixes the external functions and variables
30 defined in getopt_core.h and getopt_ext.h. Systematically 30 defined in getopt-core.h and getopt-ext.h. Systematically
31 rename identifiers so that they do not collide with the system 31 rename identifiers so that they do not collide with the system
32 functions and variables. Renaming avoids problems with some 32 functions and variables. Renaming avoids problems with some
33 compilers and linkers. */ 33 compilers and linkers. */
@@ -49,6 +49,6 @@
49# define optopt __GETOPT_ID (optopt) 49# define optopt __GETOPT_ID (optopt)
50#endif 50#endif
51 51
52#include <getopt_core.h> 52#include <getopt-core.h>
53 53
54#endif /* getopt_pfx_core.h */ 54#endif /* _GETOPT_PFX_CORE_H */
diff --git a/lib/getopt_pfx_ext.h b/lib/getopt-pfx-ext.h
index 3da156a09ba..bc6052a1dd1 100644
--- a/lib/getopt_pfx_ext.h
+++ b/lib/getopt-pfx-ext.h
@@ -27,7 +27,7 @@
27 27
28/* Standalone applications should #define __GETOPT_PREFIX to an 28/* Standalone applications should #define __GETOPT_PREFIX to an
29 identifier that prefixes the external functions and variables 29 identifier that prefixes the external functions and variables
30 defined in getopt_core.h and getopt_ext.h. Systematically 30 defined in getopt-core.h and getopt-ext.h. Systematically
31 rename identifiers so that they do not collide with the system 31 rename identifiers so that they do not collide with the system
32 functions and variables. Renaming avoids problems with some 32 functions and variables. Renaming avoids problems with some
33 compilers and linkers. */ 33 compilers and linkers. */
@@ -59,6 +59,6 @@
59# endif 59# endif
60#endif 60#endif
61 61
62#include <getopt_ext.h> 62#include <getopt-ext.h>
63 63
64#endif /* getopt_pfx_ext.h */ 64#endif /* _GETOPT_PFX_EXT_H */
diff --git a/lib/getopt.in.h b/lib/getopt.in.h
index 91e086c0207..4ce1eb485af 100644
--- a/lib/getopt.in.h
+++ b/lib/getopt.in.h
@@ -38,7 +38,7 @@
38 38
39/* Standalone applications should #define __GETOPT_PREFIX to an 39/* Standalone applications should #define __GETOPT_PREFIX to an
40 identifier that prefixes the external functions and variables 40 identifier that prefixes the external functions and variables
41 defined in getopt_core.h and getopt_ext.h. When this happens, 41 defined in getopt-core.h and getopt-ext.h. When this happens,
42 include the headers that might declare getopt so that they will not 42 include the headers that might declare getopt so that they will not
43 cause confusion if included after this file (if the system had 43 cause confusion if included after this file (if the system had
44 <getopt.h>, we have already included it). */ 44 <getopt.h>, we have already included it). */
@@ -52,8 +52,10 @@
52# endif 52# endif
53#endif 53#endif
54 54
55#include <getopt_cdefs.h> 55/* The definition of _GL_ARG_NONNULL is copied here. */
56#include <getopt_pfx_core.h> 56
57#include <getopt_pfx_ext.h> 57#include <getopt-cdefs.h>
58#include <getopt-pfx-core.h>
59#include <getopt-pfx-ext.h>
58 60
59#endif /* _@GUARD_PREFIX@_GETOPT_H */ 61#endif /* _@GUARD_PREFIX@_GETOPT_H */
diff --git a/lib/gnulib.mk.in b/lib/gnulib.mk.in
index 38adf2a9f76..08f48c2ca38 100644
--- a/lib/gnulib.mk.in
+++ b/lib/gnulib.mk.in
@@ -922,6 +922,7 @@ pdfdir = @pdfdir@
922prefix = @prefix@ 922prefix = @prefix@
923program_transform_name = @program_transform_name@ 923program_transform_name = @program_transform_name@
924psdir = @psdir@ 924psdir = @psdir@
925runstatedir = @runstatedir@
925sbindir = @sbindir@ 926sbindir = @sbindir@
926sharedstatedir = @sharedstatedir@ 927sharedstatedir = @sharedstatedir@
927srcdir = @srcdir@ 928srcdir = @srcdir@
@@ -1527,21 +1528,22 @@ getopt.h: getopt.in.h $(top_builddir)/config.status
1527 -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ 1528 -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
1528 -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ 1529 -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
1529 -e 's|@''NEXT_GETOPT_H''@|$(NEXT_GETOPT_H)|g' \ 1530 -e 's|@''NEXT_GETOPT_H''@|$(NEXT_GETOPT_H)|g' \
1531 -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
1530 < $(srcdir)/getopt.in.h; \ 1532 < $(srcdir)/getopt.in.h; \
1531 } > $@-t && \ 1533 } > $@-t && \
1532 mv -f $@-t $@ 1534 mv -f $@-t $@
1533 1535
1534getopt_cdefs.h: getopt_cdefs.in.h $(top_builddir)/config.status 1536getopt-cdefs.h: getopt-cdefs.in.h $(top_builddir)/config.status
1535 $(AM_V_GEN)rm -f $@-t $@ && \ 1537 $(AM_V_GEN)rm -f $@-t $@ && \
1536 { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ 1538 { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
1537 sed -e 's|@''HAVE_SYS_CDEFS_H''@|$(HAVE_SYS_CDEFS_H)|g' \ 1539 sed -e 's|@''HAVE_SYS_CDEFS_H''@|$(HAVE_SYS_CDEFS_H)|g' \
1538 < $(srcdir)/getopt_cdefs.in.h; \ 1540 < $(srcdir)/getopt-cdefs.in.h; \
1539 } > $@-t && \ 1541 } > $@-t && \
1540 mv -f $@-t $@ 1542 mv -f $@-t $@
1541 1543
1542MOSTLYCLEANFILES += getopt.h getopt.h-t getopt_cdefs.h getopt_cdefs.h-t 1544MOSTLYCLEANFILES += getopt.h getopt.h-t getopt-cdefs.h getopt-cdefs.h-t
1543 1545
1544EXTRA_DIST += getopt.c getopt.in.h getopt1.c getopt_cdefs.in.h getopt_core.h getopt_ext.h getopt_int.h getopt_pfx_core.h getopt_pfx_ext.h 1546EXTRA_DIST += getopt-cdefs.in.h getopt-core.h getopt-ext.h getopt-pfx-core.h getopt-pfx-ext.h getopt.c getopt.in.h getopt1.c getopt_int.h
1545 1547
1546EXTRA_libgnu_a_SOURCES += getopt.c getopt1.c 1548EXTRA_libgnu_a_SOURCES += getopt.c getopt1.c
1547 1549
diff --git a/lib/unistd.in.h b/lib/unistd.in.h
index ed175bf8f2b..cb9321e502d 100644
--- a/lib/unistd.in.h
+++ b/lib/unistd.in.h
@@ -127,11 +127,18 @@
127# include <sys/types.h> 127# include <sys/types.h>
128#endif 128#endif
129 129
130/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
131
132/* The definition of _GL_ARG_NONNULL is copied here. */
133
134/* The definition of _GL_WARN_ON_USE is copied here. */
135
136
130/* Get getopt(), optarg, optind, opterr, optopt. 137/* Get getopt(), optarg, optind, opterr, optopt.
131 But avoid namespace pollution on glibc systems. */ 138 But avoid namespace pollution on glibc systems. */
132#if @GNULIB_UNISTD_H_GETOPT@ && !defined __GLIBC__ && !defined _GL_SYSTEM_GETOPT 139#if @GNULIB_UNISTD_H_GETOPT@ && !defined __GLIBC__ && !defined _GL_SYSTEM_GETOPT
133# include <getopt_cdefs.h> 140# include <getopt-cdefs.h>
134# include <getopt_pfx_core.h> 141# include <getopt-pfx-core.h>
135#endif 142#endif
136 143
137#ifndef _GL_INLINE_HEADER_BEGIN 144#ifndef _GL_INLINE_HEADER_BEGIN
@@ -142,13 +149,6 @@ _GL_INLINE_HEADER_BEGIN
142# define _GL_UNISTD_INLINE _GL_INLINE 149# define _GL_UNISTD_INLINE _GL_INLINE
143#endif 150#endif
144 151
145/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
146
147/* The definition of _GL_ARG_NONNULL is copied here. */
148
149/* The definition of _GL_WARN_ON_USE is copied here. */
150
151
152/* Hide some function declarations from <winsock2.h>. */ 152/* Hide some function declarations from <winsock2.h>. */
153 153
154#if @GNULIB_GETHOSTNAME@ && @UNISTD_H_HAVE_WINSOCK2_H@ 154#if @GNULIB_GETHOSTNAME@ && @UNISTD_H_HAVE_WINSOCK2_H@
diff --git a/m4/getopt.m4 b/m4/getopt.m4
index d90076922b2..ac3b38e385e 100644
--- a/m4/getopt.m4
+++ b/m4/getopt.m4
@@ -1,4 +1,4 @@
1# getopt.m4 serial 45 1# getopt.m4 serial 46
2dnl Copyright (C) 2002-2006, 2008-2017 Free Software Foundation, Inc. 2dnl Copyright (C) 2002-2006, 2008-2017 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 4dnl gives unlimited permission to copy and/or distribute it,
@@ -364,7 +364,7 @@ AC_DEFUN([gl_GETOPT_SUBSTITUTE_HEADER],
364 [Define to rpl_ if the getopt replacement functions and variables 364 [Define to rpl_ if the getopt replacement functions and variables
365 should be used.]) 365 should be used.])
366 GETOPT_H=getopt.h 366 GETOPT_H=getopt.h
367 GETOPT_CDEFS_H=getopt_cdefs.h 367 GETOPT_CDEFS_H=getopt-cdefs.h
368 AC_SUBST([GETOPT_H]) 368 AC_SUBST([GETOPT_H])
369 AC_SUBST([GETOPT_CDEFS_H]) 369 AC_SUBST([GETOPT_CDEFS_H])
370]) 370])
diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4
index 5aea057c5d5..bfac944ea05 100644
--- a/m4/gnulib-comp.m4
+++ b/m4/gnulib-comp.m4
@@ -899,15 +899,15 @@ AC_DEFUN([gl_FILE_LIST], [
899 lib/getdtablesize.c 899 lib/getdtablesize.c
900 lib/getgroups.c 900 lib/getgroups.c
901 lib/getloadavg.c 901 lib/getloadavg.c
902 lib/getopt-cdefs.in.h
903 lib/getopt-core.h
904 lib/getopt-ext.h
905 lib/getopt-pfx-core.h
906 lib/getopt-pfx-ext.h
902 lib/getopt.c 907 lib/getopt.c
903 lib/getopt.in.h 908 lib/getopt.in.h
904 lib/getopt1.c 909 lib/getopt1.c
905 lib/getopt_cdefs.in.h
906 lib/getopt_core.h
907 lib/getopt_ext.h
908 lib/getopt_int.h 910 lib/getopt_int.h
909 lib/getopt_pfx_core.h
910 lib/getopt_pfx_ext.h
911 lib/gettext.h 911 lib/gettext.h
912 lib/gettime.c 912 lib/gettime.c
913 lib/gettimeofday.c 913 lib/gettimeofday.c