diff options
Diffstat (limited to 'lib/sys_time.in.h')
| -rw-r--r-- | lib/sys_time.in.h | 188 |
1 files changed, 93 insertions, 95 deletions
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 |
| 59 | extern "C" { | 56 | extern "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 |
| 69 | struct timeval | 66 | struct 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 */ | ||