aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorPaul Eggert2013-02-08 15:37:17 -0800
committerPaul Eggert2013-02-08 15:37:17 -0800
commit8376d87efcbfa648b297c5b03b93e5c02386887d (patch)
tree1ceabd5ebd8843023616625f85639b52c5ac1039 /lib
parente70e5000f0a6a945b7aad4cccea5bdfdb43a80f5 (diff)
downloademacs-8376d87efcbfa648b297c5b03b93e5c02386887d.tar.gz
emacs-8376d87efcbfa648b297c5b03b93e5c02386887d.zip
Merge from gnulib.
Diffstat (limited to 'lib')
-rw-r--r--lib/careadlinkat.c1
-rw-r--r--lib/careadlinkat.h7
-rw-r--r--lib/gnulib.mk2
-rw-r--r--lib/stdlib.in.h16
-rw-r--r--lib/sys_select.in.h17
-rw-r--r--lib/sys_time.in.h188
-rw-r--r--lib/unistd.in.h1
7 files changed, 129 insertions, 103 deletions
diff --git a/lib/careadlinkat.c b/lib/careadlinkat.c
index d242ffaac7d..e2c19d1c1f1 100644
--- a/lib/careadlinkat.c
+++ b/lib/careadlinkat.c
@@ -25,6 +25,7 @@
25#include <errno.h> 25#include <errno.h>
26#include <limits.h> 26#include <limits.h>
27#include <string.h> 27#include <string.h>
28#include <unistd.h>
28 29
29/* Define this independently so that stdint.h is not a prerequisite. */ 30/* Define this independently so that stdint.h is not a prerequisite. */
30#ifndef SIZE_MAX 31#ifndef SIZE_MAX
diff --git a/lib/careadlinkat.h b/lib/careadlinkat.h
index 965573bef3a..46f88ae288a 100644
--- a/lib/careadlinkat.h
+++ b/lib/careadlinkat.h
@@ -52,15 +52,12 @@ char *careadlinkat (int fd, char const *filename,
52 ssize_t (*preadlinkat) (int, char const *, 52 ssize_t (*preadlinkat) (int, char const *,
53 char *, size_t)); 53 char *, size_t));
54 54
55/* Suitable value for careadlinkat's FD argument, 55/* Suitable value for careadlinkat's FD argument. */
56 when doing a plain readlink:
57 Pass FD = AT_FDCWD. */
58#if HAVE_READLINKAT 56#if HAVE_READLINKAT
59/* AT_FDCWD is declared in <fcntl.h>. */ 57/* AT_FDCWD is declared in <fcntl.h>. */
60#else 58#else
61/* Define AT_FDCWD independently, so that the careadlinkat module does 59/* Define AT_FDCWD independently, so that the careadlinkat module does
62 not depend on the fcntl-h module. The value does not matter, since 60 not depend on the fcntl-h module. We might as well use the same value
63 careadlinkatcwd ignores it, but we might as well use the same value
64 as fcntl-h. */ 61 as fcntl-h. */
65# ifndef AT_FDCWD 62# ifndef AT_FDCWD
66# define AT_FDCWD (-3041965) 63# define AT_FDCWD (-3041965)
diff --git a/lib/gnulib.mk b/lib/gnulib.mk
index 89317fd2088..8103eec88a0 100644
--- a/lib/gnulib.mk
+++ b/lib/gnulib.mk
@@ -1032,6 +1032,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \
1032 -e 's/@''GNULIB_REALLOC_POSIX''@/$(GNULIB_REALLOC_POSIX)/g' \ 1032 -e 's/@''GNULIB_REALLOC_POSIX''@/$(GNULIB_REALLOC_POSIX)/g' \
1033 -e 's/@''GNULIB_REALPATH''@/$(GNULIB_REALPATH)/g' \ 1033 -e 's/@''GNULIB_REALPATH''@/$(GNULIB_REALPATH)/g' \
1034 -e 's/@''GNULIB_RPMATCH''@/$(GNULIB_RPMATCH)/g' \ 1034 -e 's/@''GNULIB_RPMATCH''@/$(GNULIB_RPMATCH)/g' \
1035 -e 's/@''GNULIB_SECURE_GETENV''@/$(GNULIB_SECURE_GETENV)/g' \
1035 -e 's/@''GNULIB_SETENV''@/$(GNULIB_SETENV)/g' \ 1036 -e 's/@''GNULIB_SETENV''@/$(GNULIB_SETENV)/g' \
1036 -e 's/@''GNULIB_STRTOD''@/$(GNULIB_STRTOD)/g' \ 1037 -e 's/@''GNULIB_STRTOD''@/$(GNULIB_STRTOD)/g' \
1037 -e 's/@''GNULIB_STRTOLL''@/$(GNULIB_STRTOLL)/g' \ 1038 -e 's/@''GNULIB_STRTOLL''@/$(GNULIB_STRTOLL)/g' \
@@ -1060,6 +1061,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \
1060 -e 's|@''HAVE_RANDOM_R''@|$(HAVE_RANDOM_R)|g' \ 1061 -e 's|@''HAVE_RANDOM_R''@|$(HAVE_RANDOM_R)|g' \
1061 -e 's|@''HAVE_REALPATH''@|$(HAVE_REALPATH)|g' \ 1062 -e 's|@''HAVE_REALPATH''@|$(HAVE_REALPATH)|g' \
1062 -e 's|@''HAVE_RPMATCH''@|$(HAVE_RPMATCH)|g' \ 1063 -e 's|@''HAVE_RPMATCH''@|$(HAVE_RPMATCH)|g' \
1064 -e 's|@''HAVE_SECURE_GETENV''@|$(HAVE_SECURE_GETENV)|g' \
1063 -e 's|@''HAVE_DECL_SETENV''@|$(HAVE_DECL_SETENV)|g' \ 1065 -e 's|@''HAVE_DECL_SETENV''@|$(HAVE_DECL_SETENV)|g' \
1064 -e 's|@''HAVE_STRTOD''@|$(HAVE_STRTOD)|g' \ 1066 -e 's|@''HAVE_STRTOD''@|$(HAVE_STRTOD)|g' \
1065 -e 's|@''HAVE_STRTOLL''@|$(HAVE_STRTOLL)|g' \ 1067 -e 's|@''HAVE_STRTOLL''@|$(HAVE_STRTOLL)|g' \
diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h
index 422ad714c32..e054c520ebe 100644
--- a/lib/stdlib.in.h
+++ b/lib/stdlib.in.h
@@ -767,6 +767,22 @@ _GL_WARN_ON_USE (rpmatch, "rpmatch is unportable - "
767# endif 767# endif
768#endif 768#endif
769 769
770#if @GNULIB_SECURE_GETENV@
771/* Look up NAME in the environment, returning 0 in insecure situations. */
772# if !@HAVE_SECURE_GETENV@
773_GL_FUNCDECL_SYS (secure_getenv, char *,
774 (char const *name) _GL_ARG_NONNULL ((1)));
775# endif
776_GL_CXXALIAS_SYS (secure_getenv, int, (char const *name));
777_GL_CXXALIASWARN (secure_getenv);
778#elif defined GNULIB_POSIXCHECK
779# undef secure_getenv
780# if HAVE_RAW_DECL_SECURE_GETENV
781_GL_WARN_ON_USE (secure_getenv, "secure_getenv is unportable - "
782 "use gnulib module secure_getenv for portability");
783# endif
784#endif
785
770#if @GNULIB_SETENV@ 786#if @GNULIB_SETENV@
771/* Set NAME to VALUE in the environment. 787/* Set NAME to VALUE in the environment.
772 If REPLACE is nonzero, overwrite an existing value. */ 788 If REPLACE is nonzero, overwrite an existing value. */
diff --git a/lib/sys_select.in.h b/lib/sys_select.in.h
index edff088a125..521ccef321d 100644
--- a/lib/sys_select.in.h
+++ b/lib/sys_select.in.h
@@ -19,14 +19,25 @@
19# endif 19# endif
20@PRAGMA_COLUMNS@ 20@PRAGMA_COLUMNS@
21 21
22/* On OSF/1, <sys/types.h> and <sys/time.h> include <sys/select.h>. 22/* On OSF/1 and Solaris 2.6, <sys/types.h> and <sys/time.h>
23 both include <sys/select.h>.
23 Simply delegate to the system's header in this case. */ 24 Simply delegate to the system's header in this case. */
24#if @HAVE_SYS_SELECT_H@ && defined __osf__ && (defined _SYS_TYPES_H_ && !defined _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TYPES_H) && defined _OSF_SOURCE 25#if (@HAVE_SYS_SELECT_H@ \
26 && ((defined __osf__ && defined _SYS_TYPES_H_ && defined _OSF_SOURCE) \
27 || (defined __sun && defined _SYS_TYPES_H \
28 && (! (defined _XOPEN_SOURCE || defined _POSIX_C_SOURCE) \
29 || defined __EXTENSIONS__))) \
30 && !defined _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TYPES_H)
25 31
26# define _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TYPES_H 32# define _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TYPES_H
27# @INCLUDE_NEXT@ @NEXT_SYS_SELECT_H@ 33# @INCLUDE_NEXT@ @NEXT_SYS_SELECT_H@
28 34
29#elif @HAVE_SYS_SELECT_H@ && defined __osf__ && (defined _SYS_TIME_H_ && !defined _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H) && defined _OSF_SOURCE 35#elif (@HAVE_SYS_SELECT_H@ \
36 && ((defined __osf__ && defined _SYS_TIME_H_ && defined _OSF_SOURCE) \
37 || (defined __sun && defined _SYS_TIME_H \
38 && (! (defined _XOPEN_SOURCE || defined _POSIX_C_SOURCE) \
39 || defined __EXTENSIONS__))) \
40 && !defined _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H)
30 41
31# define _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H 42# define _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H
32# @INCLUDE_NEXT@ @NEXT_SYS_SELECT_H@ 43# @INCLUDE_NEXT@ @NEXT_SYS_SELECT_H@
diff --git a/lib/sys_time.in.h b/lib/sys_time.in.h
index 1b7736bee02..656c3f13ad2 100644
--- a/lib/sys_time.in.h
+++ b/lib/sys_time.in.h
@@ -17,37 +17,34 @@
17 17
18/* Written by Paul Eggert. */ 18/* Written by Paul Eggert. */
19 19
20#ifndef _@GUARD_PREFIX@_SYS_TIME_H
21
20#if __GNUC__ >= 3 22#if __GNUC__ >= 3
21@PRAGMA_SYSTEM_HEADER@ 23@PRAGMA_SYSTEM_HEADER@
22#endif 24#endif
23@PRAGMA_COLUMNS@ 25@PRAGMA_COLUMNS@
24 26
25#if defined _@GUARD_PREFIX@_SYS_TIME_H 27/* The include_next requires a split double-inclusion guard. */
26 28#if @HAVE_SYS_TIME_H@
27/* Simply delegate to the system's header, without adding anything. */ 29# @INCLUDE_NEXT@ @NEXT_SYS_TIME_H@
28# if @HAVE_SYS_TIME_H@ 30#endif
29# @INCLUDE_NEXT@ @NEXT_SYS_TIME_H@
30# endif
31
32#else
33 31
34# define _@GUARD_PREFIX@_SYS_TIME_H 32#ifndef _@GUARD_PREFIX@_SYS_TIME_H
33#define _@GUARD_PREFIX@_SYS_TIME_H
35 34
36# if @HAVE_SYS_TIME_H@ 35#if ! @HAVE_SYS_TIME_H@
37# @INCLUDE_NEXT@ @NEXT_SYS_TIME_H@ 36# include <time.h>
38# else 37#endif
39# include <time.h>
40# endif
41 38
42/* On native Windows with MSVC, get the 'struct timeval' type. 39/* On native Windows with MSVC, get the 'struct timeval' type.
43 Also, on native Windows with a 64-bit time_t, where we are overriding the 40 Also, on native Windows with a 64-bit time_t, where we are overriding the
44 'struct timeval' type, get all declarations of system functions whose 41 'struct timeval' type, get all declarations of system functions whose
45 signature contains 'struct timeval'. */ 42 signature contains 'struct timeval'. */
46# if (defined _MSC_VER || @REPLACE_STRUCT_TIMEVAL@) && @HAVE_WINSOCK2_H@ && !defined _GL_INCLUDING_WINSOCK2_H 43#if (defined _MSC_VER || @REPLACE_STRUCT_TIMEVAL@) && @HAVE_WINSOCK2_H@ && !defined _GL_INCLUDING_WINSOCK2_H
47# define _GL_INCLUDING_WINSOCK2_H 44# define _GL_INCLUDING_WINSOCK2_H
48# include <winsock2.h> 45# include <winsock2.h>
49# undef _GL_INCLUDING_WINSOCK2_H 46# undef _GL_INCLUDING_WINSOCK2_H
50# endif 47#endif
51 48
52/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ 49/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
53 50
@@ -55,112 +52,112 @@
55 52
56/* The definition of _GL_WARN_ON_USE is copied here. */ 53/* The definition of _GL_WARN_ON_USE is copied here. */
57 54
58# ifdef __cplusplus 55#ifdef __cplusplus
59extern "C" { 56extern "C" {
60# endif 57#endif
61 58
62# if !@HAVE_STRUCT_TIMEVAL@ || @REPLACE_STRUCT_TIMEVAL@ 59#if !@HAVE_STRUCT_TIMEVAL@ || @REPLACE_STRUCT_TIMEVAL@
63 60
64# if @REPLACE_STRUCT_TIMEVAL@ 61# if @REPLACE_STRUCT_TIMEVAL@
65# define timeval rpl_timeval 62# define timeval rpl_timeval
66# endif 63# endif
67 64
68# if !GNULIB_defined_struct_timeval 65# if !GNULIB_defined_struct_timeval
69struct timeval 66struct timeval
70{ 67{
71 time_t tv_sec; 68 time_t tv_sec;
72 long int tv_usec; 69 long int tv_usec;
73}; 70};
74# define GNULIB_defined_struct_timeval 1 71# define GNULIB_defined_struct_timeval 1
75# endif
76
77# endif 72# endif
78 73
79# ifdef __cplusplus 74#endif
75
76#ifdef __cplusplus
80} 77}
81# endif 78#endif
82 79
83# if @GNULIB_GETTIMEOFDAY@ 80#if @GNULIB_GETTIMEOFDAY@
84# if @REPLACE_GETTIMEOFDAY@ 81# if @REPLACE_GETTIMEOFDAY@
85# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 82# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
86# undef gettimeofday 83# undef gettimeofday
87# define gettimeofday rpl_gettimeofday 84# define gettimeofday rpl_gettimeofday
88# endif 85# endif
89_GL_FUNCDECL_RPL (gettimeofday, int, 86_GL_FUNCDECL_RPL (gettimeofday, int,
90 (struct timeval *restrict, void *restrict) 87 (struct timeval *restrict, void *restrict)
91 _GL_ARG_NONNULL ((1))); 88 _GL_ARG_NONNULL ((1)));
92_GL_CXXALIAS_RPL (gettimeofday, int, 89_GL_CXXALIAS_RPL (gettimeofday, int,
93 (struct timeval *restrict, void *restrict)); 90 (struct timeval *restrict, void *restrict));
94# else 91# else
95# if !@HAVE_GETTIMEOFDAY@ 92# if !@HAVE_GETTIMEOFDAY@
96_GL_FUNCDECL_SYS (gettimeofday, int, 93_GL_FUNCDECL_SYS (gettimeofday, int,
97 (struct timeval *restrict, void *restrict) 94 (struct timeval *restrict, void *restrict)
98 _GL_ARG_NONNULL ((1))); 95 _GL_ARG_NONNULL ((1)));
99# endif 96# endif
100/* Need to cast, because on glibc systems, by default, the second argument is 97/* Need to cast, because on glibc systems, by default, the second argument is
101 struct timezone *. */ 98 struct timezone *. */
102_GL_CXXALIAS_SYS_CAST (gettimeofday, int, 99_GL_CXXALIAS_SYS_CAST (gettimeofday, int,
103 (struct timeval *restrict, void *restrict)); 100 (struct timeval *restrict, void *restrict));
104# endif 101# endif
105_GL_CXXALIASWARN (gettimeofday); 102_GL_CXXALIASWARN (gettimeofday);
106# elif defined GNULIB_POSIXCHECK 103#elif defined GNULIB_POSIXCHECK
107# undef gettimeofday 104# undef gettimeofday
108# if HAVE_RAW_DECL_GETTIMEOFDAY 105# if HAVE_RAW_DECL_GETTIMEOFDAY
109_GL_WARN_ON_USE (gettimeofday, "gettimeofday is unportable - " 106_GL_WARN_ON_USE (gettimeofday, "gettimeofday is unportable - "
110 "use gnulib module gettimeofday for portability"); 107 "use gnulib module gettimeofday for portability");
111# endif
112# endif 108# endif
109#endif
113 110
114/* Hide some function declarations from <winsock2.h>. */ 111/* Hide some function declarations from <winsock2.h>. */
115 112
116# if defined _MSC_VER && @HAVE_WINSOCK2_H@ 113#if defined _MSC_VER && @HAVE_WINSOCK2_H@
117# if !defined _@GUARD_PREFIX@_UNISTD_H 114# if !defined _@GUARD_PREFIX@_UNISTD_H
118# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 115# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
119# undef close 116# undef close
120# define close close_used_without_including_unistd_h 117# define close close_used_without_including_unistd_h
121# else 118# else
122 _GL_WARN_ON_USE (close, 119 _GL_WARN_ON_USE (close,
123 "close() used without including <unistd.h>"); 120 "close() used without including <unistd.h>");
124# endif 121# endif
125# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 122# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
126# undef gethostname 123# undef gethostname
127# define gethostname gethostname_used_without_including_unistd_h 124# define gethostname gethostname_used_without_including_unistd_h
128# else 125# else
129 _GL_WARN_ON_USE (gethostname, 126 _GL_WARN_ON_USE (gethostname,
130 "gethostname() used without including <unistd.h>"); 127 "gethostname() used without including <unistd.h>");
131# endif
132# endif 128# endif
133# if !defined _@GUARD_PREFIX@_SYS_SOCKET_H 129# endif
134# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 130# if !defined _@GUARD_PREFIX@_SYS_SOCKET_H
135# undef socket 131# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
136# define socket socket_used_without_including_sys_socket_h 132# undef socket
137# undef connect 133# define socket socket_used_without_including_sys_socket_h
138# define connect connect_used_without_including_sys_socket_h 134# undef connect
139# undef accept 135# define connect connect_used_without_including_sys_socket_h
140# define accept accept_used_without_including_sys_socket_h 136# undef accept
141# undef bind 137# define accept accept_used_without_including_sys_socket_h
142# define bind bind_used_without_including_sys_socket_h 138# undef bind
143# undef getpeername 139# define bind bind_used_without_including_sys_socket_h
144# define getpeername getpeername_used_without_including_sys_socket_h 140# undef getpeername
145# undef getsockname 141# define getpeername getpeername_used_without_including_sys_socket_h
146# define getsockname getsockname_used_without_including_sys_socket_h 142# undef getsockname
147# undef getsockopt 143# define getsockname getsockname_used_without_including_sys_socket_h
148# define getsockopt getsockopt_used_without_including_sys_socket_h 144# undef getsockopt
149# undef listen 145# define getsockopt getsockopt_used_without_including_sys_socket_h
150# define listen listen_used_without_including_sys_socket_h 146# undef listen
151# undef recv 147# define listen listen_used_without_including_sys_socket_h
152# define recv recv_used_without_including_sys_socket_h 148# undef recv
153# undef send 149# define recv recv_used_without_including_sys_socket_h
154# define send send_used_without_including_sys_socket_h 150# undef send
155# undef recvfrom 151# define send send_used_without_including_sys_socket_h
156# define recvfrom recvfrom_used_without_including_sys_socket_h 152# undef recvfrom
157# undef sendto 153# define recvfrom recvfrom_used_without_including_sys_socket_h
158# define sendto sendto_used_without_including_sys_socket_h 154# undef sendto
159# undef setsockopt 155# define sendto sendto_used_without_including_sys_socket_h
160# define setsockopt setsockopt_used_without_including_sys_socket_h 156# undef setsockopt
161# undef shutdown 157# define setsockopt setsockopt_used_without_including_sys_socket_h
162# define shutdown shutdown_used_without_including_sys_socket_h 158# undef shutdown
163# else 159# define shutdown shutdown_used_without_including_sys_socket_h
160# else
164 _GL_WARN_ON_USE (socket, 161 _GL_WARN_ON_USE (socket,
165 "socket() used without including <sys/socket.h>"); 162 "socket() used without including <sys/socket.h>");
166 _GL_WARN_ON_USE (connect, 163 _GL_WARN_ON_USE (connect,
@@ -189,17 +186,18 @@ _GL_WARN_ON_USE (gettimeofday, "gettimeofday is unportable - "
189 "setsockopt() used without including <sys/socket.h>"); 186 "setsockopt() used without including <sys/socket.h>");
190 _GL_WARN_ON_USE (shutdown, 187 _GL_WARN_ON_USE (shutdown,
191 "shutdown() used without including <sys/socket.h>"); 188 "shutdown() used without including <sys/socket.h>");
192# endif
193# endif 189# endif
194# if !defined _@GUARD_PREFIX@_SYS_SELECT_H 190# endif
195# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 191# if !defined _@GUARD_PREFIX@_SYS_SELECT_H
196# undef select 192# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
197# define select select_used_without_including_sys_select_h 193# undef select
198# else 194# define select select_used_without_including_sys_select_h
195# else
199 _GL_WARN_ON_USE (select, 196 _GL_WARN_ON_USE (select,
200 "select() used without including <sys/select.h>"); 197 "select() used without including <sys/select.h>");
201# endif
202# endif 198# endif
203# endif 199# endif
200#endif
204 201
205#endif /* _@GUARD_PREFIX@_SYS_TIME_H */ 202#endif /* _@GUARD_PREFIX@_SYS_TIME_H */
203#endif /* _@GUARD_PREFIX@_SYS_TIME_H */
diff --git a/lib/unistd.in.h b/lib/unistd.in.h
index a870fe7b4a3..675c7e6a552 100644
--- a/lib/unistd.in.h
+++ b/lib/unistd.in.h
@@ -110,6 +110,7 @@
110/* Get getopt(), optarg, optind, opterr, optopt. 110/* Get getopt(), optarg, optind, opterr, optopt.
111 But avoid namespace pollution on glibc systems. */ 111 But avoid namespace pollution on glibc systems. */
112#if @GNULIB_UNISTD_H_GETOPT@ && !defined __GLIBC__ && !defined _GL_SYSTEM_GETOPT 112#if @GNULIB_UNISTD_H_GETOPT@ && !defined __GLIBC__ && !defined _GL_SYSTEM_GETOPT
113# define __need_getopt
113# include <getopt.h> 114# include <getopt.h>
114#endif 115#endif
115 116