diff options
| author | Paul Eggert | 2014-12-11 23:16:37 -0800 |
|---|---|---|
| committer | Paul Eggert | 2014-12-12 16:04:10 -0800 |
| commit | b81a1837916a7f3f7abd953338302fa237a532f2 (patch) | |
| tree | eab3a9abb613126d80773cc6dd04d3a7b9f22ad3 /lib | |
| parent | 074965f9355b7cc7f7a5f4385a19433e51c8afd2 (diff) | |
| download | emacs-b81a1837916a7f3f7abd953338302fa237a532f2.tar.gz emacs-b81a1837916a7f3f7abd953338302fa237a532f2.zip | |
Merge from gnulib
2014-12-12 stddef: support C11's max_align_t
2014-12-08 apply _GL_ATTRIBUTE_PURE to some inline functions
2014-12-02 support GNU format printf and scanf on mingw
* doc/misc/texinfo.tex, lib/stat-time.h, lib/stddef.in.h:
* lib/timespec.h, m4/extensions.m4, m4/stddef_h.m4, m4/stdio_h.m4:
Update from gnulib.
* lib/gnulib.mk: Regenerate.
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/gnulib.mk | 1 | ||||
| -rw-r--r-- | lib/stat-time.h | 16 | ||||
| -rw-r--r-- | lib/stddef.in.h | 41 | ||||
| -rw-r--r-- | lib/timespec.h | 4 |
4 files changed, 37 insertions, 25 deletions
diff --git a/lib/gnulib.mk b/lib/gnulib.mk index 6437a9d7541..c54b8117842 100644 --- a/lib/gnulib.mk +++ b/lib/gnulib.mk | |||
| @@ -915,6 +915,7 @@ stddef.h: stddef.in.h $(top_builddir)/config.status | |||
| 915 | -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ | 915 | -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ |
| 916 | -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ | 916 | -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ |
| 917 | -e 's|@''NEXT_STDDEF_H''@|$(NEXT_STDDEF_H)|g' \ | 917 | -e 's|@''NEXT_STDDEF_H''@|$(NEXT_STDDEF_H)|g' \ |
| 918 | -e 's|@''HAVE_MAX_ALIGN_T''@|$(HAVE_MAX_ALIGN_T)|g' \ | ||
| 918 | -e 's|@''HAVE_WCHAR_T''@|$(HAVE_WCHAR_T)|g' \ | 919 | -e 's|@''HAVE_WCHAR_T''@|$(HAVE_WCHAR_T)|g' \ |
| 919 | -e 's|@''REPLACE_NULL''@|$(REPLACE_NULL)|g' \ | 920 | -e 's|@''REPLACE_NULL''@|$(REPLACE_NULL)|g' \ |
| 920 | < $(srcdir)/stddef.in.h; \ | 921 | < $(srcdir)/stddef.in.h; \ |
diff --git a/lib/stat-time.h b/lib/stat-time.h index b3df6eb816d..9cbf8e044d0 100644 --- a/lib/stat-time.h +++ b/lib/stat-time.h | |||
| @@ -54,7 +54,7 @@ _GL_INLINE_HEADER_BEGIN | |||
| 54 | #endif | 54 | #endif |
| 55 | 55 | ||
| 56 | /* Return the nanosecond component of *ST's access time. */ | 56 | /* Return the nanosecond component of *ST's access time. */ |
| 57 | _GL_STAT_TIME_INLINE long int | 57 | _GL_STAT_TIME_INLINE long int _GL_ATTRIBUTE_PURE |
| 58 | get_stat_atime_ns (struct stat const *st) | 58 | get_stat_atime_ns (struct stat const *st) |
| 59 | { | 59 | { |
| 60 | # if defined STAT_TIMESPEC | 60 | # if defined STAT_TIMESPEC |
| @@ -67,7 +67,7 @@ get_stat_atime_ns (struct stat const *st) | |||
| 67 | } | 67 | } |
| 68 | 68 | ||
| 69 | /* Return the nanosecond component of *ST's status change time. */ | 69 | /* Return the nanosecond component of *ST's status change time. */ |
| 70 | _GL_STAT_TIME_INLINE long int | 70 | _GL_STAT_TIME_INLINE long int _GL_ATTRIBUTE_PURE |
| 71 | get_stat_ctime_ns (struct stat const *st) | 71 | get_stat_ctime_ns (struct stat const *st) |
| 72 | { | 72 | { |
| 73 | # if defined STAT_TIMESPEC | 73 | # if defined STAT_TIMESPEC |
| @@ -80,7 +80,7 @@ get_stat_ctime_ns (struct stat const *st) | |||
| 80 | } | 80 | } |
| 81 | 81 | ||
| 82 | /* Return the nanosecond component of *ST's data modification time. */ | 82 | /* Return the nanosecond component of *ST's data modification time. */ |
| 83 | _GL_STAT_TIME_INLINE long int | 83 | _GL_STAT_TIME_INLINE long int _GL_ATTRIBUTE_PURE |
| 84 | get_stat_mtime_ns (struct stat const *st) | 84 | get_stat_mtime_ns (struct stat const *st) |
| 85 | { | 85 | { |
| 86 | # if defined STAT_TIMESPEC | 86 | # if defined STAT_TIMESPEC |
| @@ -93,7 +93,7 @@ get_stat_mtime_ns (struct stat const *st) | |||
| 93 | } | 93 | } |
| 94 | 94 | ||
| 95 | /* Return the nanosecond component of *ST's birth time. */ | 95 | /* Return the nanosecond component of *ST's birth time. */ |
| 96 | _GL_STAT_TIME_INLINE long int | 96 | _GL_STAT_TIME_INLINE long int _GL_ATTRIBUTE_PURE |
| 97 | get_stat_birthtime_ns (struct stat const *st) | 97 | get_stat_birthtime_ns (struct stat const *st) |
| 98 | { | 98 | { |
| 99 | # if defined HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC | 99 | # if defined HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC |
| @@ -108,7 +108,7 @@ get_stat_birthtime_ns (struct stat const *st) | |||
| 108 | } | 108 | } |
| 109 | 109 | ||
| 110 | /* Return *ST's access time. */ | 110 | /* Return *ST's access time. */ |
| 111 | _GL_STAT_TIME_INLINE struct timespec | 111 | _GL_STAT_TIME_INLINE struct timespec _GL_ATTRIBUTE_PURE |
| 112 | get_stat_atime (struct stat const *st) | 112 | get_stat_atime (struct stat const *st) |
| 113 | { | 113 | { |
| 114 | #ifdef STAT_TIMESPEC | 114 | #ifdef STAT_TIMESPEC |
| @@ -122,7 +122,7 @@ get_stat_atime (struct stat const *st) | |||
| 122 | } | 122 | } |
| 123 | 123 | ||
| 124 | /* Return *ST's status change time. */ | 124 | /* Return *ST's status change time. */ |
| 125 | _GL_STAT_TIME_INLINE struct timespec | 125 | _GL_STAT_TIME_INLINE struct timespec _GL_ATTRIBUTE_PURE |
| 126 | get_stat_ctime (struct stat const *st) | 126 | get_stat_ctime (struct stat const *st) |
| 127 | { | 127 | { |
| 128 | #ifdef STAT_TIMESPEC | 128 | #ifdef STAT_TIMESPEC |
| @@ -136,7 +136,7 @@ get_stat_ctime (struct stat const *st) | |||
| 136 | } | 136 | } |
| 137 | 137 | ||
| 138 | /* Return *ST's data modification time. */ | 138 | /* Return *ST's data modification time. */ |
| 139 | _GL_STAT_TIME_INLINE struct timespec | 139 | _GL_STAT_TIME_INLINE struct timespec _GL_ATTRIBUTE_PURE |
| 140 | get_stat_mtime (struct stat const *st) | 140 | get_stat_mtime (struct stat const *st) |
| 141 | { | 141 | { |
| 142 | #ifdef STAT_TIMESPEC | 142 | #ifdef STAT_TIMESPEC |
| @@ -151,7 +151,7 @@ get_stat_mtime (struct stat const *st) | |||
| 151 | 151 | ||
| 152 | /* Return *ST's birth time, if available; otherwise return a value | 152 | /* Return *ST's birth time, if available; otherwise return a value |
| 153 | with tv_sec and tv_nsec both equal to -1. */ | 153 | with tv_sec and tv_nsec both equal to -1. */ |
| 154 | _GL_STAT_TIME_INLINE struct timespec | 154 | _GL_STAT_TIME_INLINE struct timespec _GL_ATTRIBUTE_PURE |
| 155 | get_stat_birthtime (struct stat const *st) | 155 | get_stat_birthtime (struct stat const *st) |
| 156 | { | 156 | { |
| 157 | struct timespec t; | 157 | struct timespec t; |
diff --git a/lib/stddef.in.h b/lib/stddef.in.h index f5c0e056554..9924a327fca 100644 --- a/lib/stddef.in.h +++ b/lib/stddef.in.h | |||
| @@ -39,7 +39,6 @@ | |||
| 39 | 39 | ||
| 40 | # if !(defined _@GUARD_PREFIX@_STDDEF_H && defined _GL_STDDEF_WINT_T) | 40 | # if !(defined _@GUARD_PREFIX@_STDDEF_H && defined _GL_STDDEF_WINT_T) |
| 41 | # ifdef __need_wint_t | 41 | # ifdef __need_wint_t |
| 42 | # undef _@GUARD_PREFIX@_STDDEF_H | ||
| 43 | # define _GL_STDDEF_WINT_T | 42 | # define _GL_STDDEF_WINT_T |
| 44 | # endif | 43 | # endif |
| 45 | # @INCLUDE_NEXT@ @NEXT_STDDEF_H@ | 44 | # @INCLUDE_NEXT@ @NEXT_STDDEF_H@ |
| @@ -54,33 +53,45 @@ | |||
| 54 | 53 | ||
| 55 | # @INCLUDE_NEXT@ @NEXT_STDDEF_H@ | 54 | # @INCLUDE_NEXT@ @NEXT_STDDEF_H@ |
| 56 | 55 | ||
| 57 | # ifndef _@GUARD_PREFIX@_STDDEF_H | ||
| 58 | # define _@GUARD_PREFIX@_STDDEF_H | ||
| 59 | |||
| 60 | /* On NetBSD 5.0, the definition of NULL lacks proper parentheses. */ | 56 | /* On NetBSD 5.0, the definition of NULL lacks proper parentheses. */ |
| 61 | #if @REPLACE_NULL@ | 57 | # if (@REPLACE_NULL@ \ |
| 62 | # undef NULL | 58 | && (!defined _@GUARD_PREFIX@_STDDEF_H || defined _GL_STDDEF_WINT_T)) |
| 63 | # ifdef __cplusplus | 59 | # undef NULL |
| 60 | # ifdef __cplusplus | ||
| 64 | /* ISO C++ says that the macro NULL must expand to an integer constant | 61 | /* ISO C++ says that the macro NULL must expand to an integer constant |
| 65 | expression, hence '((void *) 0)' is not allowed in C++. */ | 62 | expression, hence '((void *) 0)' is not allowed in C++. */ |
| 66 | # if __GNUG__ >= 3 | 63 | # if __GNUG__ >= 3 |
| 67 | /* GNU C++ has a __null macro that behaves like an integer ('int' or | 64 | /* GNU C++ has a __null macro that behaves like an integer ('int' or |
| 68 | 'long') but has the same size as a pointer. Use that, to avoid | 65 | 'long') but has the same size as a pointer. Use that, to avoid |
| 69 | warnings. */ | 66 | warnings. */ |
| 70 | # define NULL __null | 67 | # define NULL __null |
| 71 | # else | 68 | # else |
| 72 | # define NULL 0L | 69 | # define NULL 0L |
| 70 | # endif | ||
| 71 | # else | ||
| 72 | # define NULL ((void *) 0) | ||
| 73 | # endif | ||
| 73 | # endif | 74 | # endif |
| 74 | # else | 75 | |
| 75 | # define NULL ((void *) 0) | 76 | # ifndef _@GUARD_PREFIX@_STDDEF_H |
| 76 | # endif | 77 | # define _@GUARD_PREFIX@_STDDEF_H |
| 77 | #endif | ||
| 78 | 78 | ||
| 79 | /* Some platforms lack wchar_t. */ | 79 | /* Some platforms lack wchar_t. */ |
| 80 | #if !@HAVE_WCHAR_T@ | 80 | #if !@HAVE_WCHAR_T@ |
| 81 | # define wchar_t int | 81 | # define wchar_t int |
| 82 | #endif | 82 | #endif |
| 83 | 83 | ||
| 84 | /* Some platforms lack max_align_t. */ | ||
| 85 | #if !@HAVE_MAX_ALIGN_T@ | ||
| 86 | typedef union | ||
| 87 | { | ||
| 88 | char *__p; | ||
| 89 | double __d; | ||
| 90 | long double __ld; | ||
| 91 | long int __i; | ||
| 92 | } max_align_t; | ||
| 93 | #endif | ||
| 94 | |||
| 84 | # endif /* _@GUARD_PREFIX@_STDDEF_H */ | 95 | # endif /* _@GUARD_PREFIX@_STDDEF_H */ |
| 85 | # endif /* _@GUARD_PREFIX@_STDDEF_H */ | 96 | # endif /* _@GUARD_PREFIX@_STDDEF_H */ |
| 86 | #endif /* __need_XXX */ | 97 | #endif /* __need_XXX */ |
diff --git a/lib/timespec.h b/lib/timespec.h index 872cbb76e37..dfc1277a71f 100644 --- a/lib/timespec.h +++ b/lib/timespec.h | |||
| @@ -74,7 +74,7 @@ make_timespec (time_t s, long int ns) | |||
| 74 | 74 | ||
| 75 | The (int) cast avoids a gcc -Wconversion warning. */ | 75 | The (int) cast avoids a gcc -Wconversion warning. */ |
| 76 | 76 | ||
| 77 | _GL_TIMESPEC_INLINE int | 77 | _GL_TIMESPEC_INLINE int _GL_ATTRIBUTE_PURE |
| 78 | timespec_cmp (struct timespec a, struct timespec b) | 78 | timespec_cmp (struct timespec a, struct timespec b) |
| 79 | { | 79 | { |
| 80 | return (a.tv_sec < b.tv_sec ? -1 | 80 | return (a.tv_sec < b.tv_sec ? -1 |
| @@ -84,7 +84,7 @@ timespec_cmp (struct timespec a, struct timespec b) | |||
| 84 | 84 | ||
| 85 | /* Return -1, 0, 1, depending on the sign of A. A.tv_nsec must be | 85 | /* Return -1, 0, 1, depending on the sign of A. A.tv_nsec must be |
| 86 | nonnegative. */ | 86 | nonnegative. */ |
| 87 | _GL_TIMESPEC_INLINE int | 87 | _GL_TIMESPEC_INLINE int _GL_ATTRIBUTE_PURE |
| 88 | timespec_sign (struct timespec a) | 88 | timespec_sign (struct timespec a) |
| 89 | { | 89 | { |
| 90 | return a.tv_sec < 0 ? -1 : a.tv_sec || a.tv_nsec; | 90 | return a.tv_sec < 0 ? -1 : a.tv_sec || a.tv_nsec; |