diff options
| author | Paul Eggert | 2019-11-26 13:14:42 -0800 |
|---|---|---|
| committer | Paul Eggert | 2019-11-26 13:15:41 -0800 |
| commit | 1b9dbca826ad8a742ab22719279f5ce3c5888a67 (patch) | |
| tree | afd37873182a84f6708c19105fedca1b4d58ddd2 /m4 | |
| parent | 50b52390ee5894e91965bd37f2d0c571df1e2e89 (diff) | |
| download | emacs-1b9dbca826ad8a742ab22719279f5ce3c5888a67.tar.gz emacs-1b9dbca826ad8a742ab22719279f5ce3c5888a67.zip | |
Update from Gnulib
This incorporates:
2019-11-24 Fix errors in C++ mode on mingw
2019-11-24 time_r: Fix for mingw (regression from 2019-11-16)
2019-11-24 sys_time: Fix errors in C++ mode on mingw
2019-11-22 intprops: INT_MULTIPLY_WRAPV speedup for GCC 8.4+
2019-11-21 Disable many _GL_CXXALIASWARN on non-glibc
2019-11-21 Fix various errors in _GL_CXXALIAS_SYS invocations
2019-11-19 intprops: INT_MULTIPLY_WRAPV speedup for GCC 9.3+
2019-11-18 stdint: Define [u]intptr_t correctly on 64-bit native Windows
2019-11-18 stdint: Fix value of WINT_MAX when we override wint_t
2019-11-18 stdint: Avoid "conflicting types" error on mingw 5.22
2019-11-16 time_r: Fix for mingw
2019-11-06 regex: now back in sync with glibc
* lib/intprops.h, lib/regexec.c, lib/signal.in.h:
* lib/stdint.in.h, lib/stdio.in.h, lib/stdlib.in.h:
* lib/string.in.h, lib/sys_select.in.h, lib/sys_time.in.h:
* lib/time.in.h, lib/unistd.in.h, m4/time_r.m4:
Copy from Gnulib.
Diffstat (limited to 'm4')
| -rw-r--r-- | m4/time_r.m4 | 45 |
1 files changed, 43 insertions, 2 deletions
diff --git a/m4/time_r.m4 b/m4/time_r.m4 index 5caeca75093..cc4b3e009b9 100644 --- a/m4/time_r.m4 +++ b/m4/time_r.m4 | |||
| @@ -17,7 +17,15 @@ AC_DEFUN([gl_TIME_R], | |||
| 17 | 17 | ||
| 18 | dnl Some systems don't declare localtime_r() and gmtime_r() if _REENTRANT is | 18 | dnl Some systems don't declare localtime_r() and gmtime_r() if _REENTRANT is |
| 19 | dnl not defined. | 19 | dnl not defined. |
| 20 | AC_CHECK_DECLS([localtime_r], [], [], [[#include <time.h>]]) | 20 | AC_CHECK_DECLS([localtime_r], [], [], |
| 21 | [[/* mingw's <time.h> provides the functions asctime_r, ctime_r, | ||
| 22 | gmtime_r, localtime_r only if <unistd.h> or <pthread.h> has | ||
| 23 | been included before. */ | ||
| 24 | #if defined __MINGW32__ | ||
| 25 | # include <unistd.h> | ||
| 26 | #endif | ||
| 27 | #include <time.h> | ||
| 28 | ]]) | ||
| 21 | if test $ac_cv_have_decl_localtime_r = no; then | 29 | if test $ac_cv_have_decl_localtime_r = no; then |
| 22 | HAVE_DECL_LOCALTIME_R=0 | 30 | HAVE_DECL_LOCALTIME_R=0 |
| 23 | fi | 31 | fi |
| @@ -29,7 +37,14 @@ AC_DEFUN([gl_TIME_R], | |||
| 29 | [gl_cv_time_r_posix], | 37 | [gl_cv_time_r_posix], |
| 30 | [AC_COMPILE_IFELSE( | 38 | [AC_COMPILE_IFELSE( |
| 31 | [AC_LANG_PROGRAM( | 39 | [AC_LANG_PROGRAM( |
| 32 | [[#include <time.h>]], | 40 | [[/* mingw's <time.h> provides the functions asctime_r, ctime_r, |
| 41 | gmtime_r, localtime_r only if <unistd.h> or <pthread.h> has | ||
| 42 | been included before. */ | ||
| 43 | #if defined __MINGW32__ | ||
| 44 | # include <unistd.h> | ||
| 45 | #endif | ||
| 46 | #include <time.h> | ||
| 47 | ]], | ||
| 33 | [[/* We don't need to append 'restrict's to the argument types, | 48 | [[/* We don't need to append 'restrict's to the argument types, |
| 34 | even though the POSIX signature has the 'restrict's, | 49 | even though the POSIX signature has the 'restrict's, |
| 35 | since C99 says they can't affect type compatibility. */ | 50 | since C99 says they can't affect type compatibility. */ |
| @@ -49,6 +64,32 @@ AC_DEFUN([gl_TIME_R], | |||
| 49 | fi | 64 | fi |
| 50 | else | 65 | else |
| 51 | HAVE_LOCALTIME_R=0 | 66 | HAVE_LOCALTIME_R=0 |
| 67 | dnl On mingw, localtime_r() is defined as an inline function; use through a | ||
| 68 | dnl direct function call works but the use as a function pointer leads to a | ||
| 69 | dnl link error. | ||
| 70 | AC_CACHE_CHECK([whether localtime_r exists as an inline function], | ||
| 71 | [gl_cv_func_localtime_r_inline], | ||
| 72 | [AC_LINK_IFELSE( | ||
| 73 | [AC_LANG_PROGRAM( | ||
| 74 | [[/* mingw's <time.h> provides the functions asctime_r, ctime_r, | ||
| 75 | gmtime_r, localtime_r only if <unistd.h> or <pthread.h> has | ||
| 76 | been included before. */ | ||
| 77 | #if defined __MINGW32__ | ||
| 78 | # include <unistd.h> | ||
| 79 | #endif | ||
| 80 | #include <time.h> | ||
| 81 | ]], | ||
| 82 | [[time_t a; | ||
| 83 | struct tm r; | ||
| 84 | localtime_r (&a, &r); | ||
| 85 | ]]) | ||
| 86 | ], | ||
| 87 | [gl_cv_func_localtime_r_inline=yes], | ||
| 88 | [gl_cv_func_localtime_r_inline=no]) | ||
| 89 | ]) | ||
| 90 | if test $gl_cv_func_localtime_r_inline = yes; then | ||
| 91 | REPLACE_LOCALTIME_R=1 | ||
| 92 | fi | ||
| 52 | fi | 93 | fi |
| 53 | ]) | 94 | ]) |
| 54 | 95 | ||