From: Paul Eggert Date: Tue, 17 Dec 2013 20:43:43 +0000 (-0800) Subject: Merge from gnulib, incorporating: X-Git-Url: http://git.hcoop.net/bpt/emacs.git/commitdiff_plain/e9ad5665ede9f7599b7b26a7e478fd3e56ddf36e Merge from gnulib, incorporating: 2013-12-17 gettimeofday: port recent C++ fix to Emacs 2013-12-17 gettimeofday: fix C++ crosscompilation 2013-12-17 qacl: port to Windows better * lib/file-has-acl.c, lib/time.in.h, m4/gettimeofday.m4, m4/time_h.m4: Update from gnulib. * lib/gnulib.mk: Regenerate. --- diff --git a/ChangeLog b/ChangeLog index 1eb90c663b..9bc922990a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2013-12-17 Paul Eggert + + Merge from gnulib, incorporating: + 2013-12-17 gettimeofday: port recent C++ fix to Emacs + 2013-12-17 gettimeofday: fix C++ crosscompilation + 2013-12-17 qacl: port to Windows better + * lib/file-has-acl.c, lib/time.in.h, m4/gettimeofday.m4, m4/time_h.m4: + Update from gnulib. + * lib/gnulib.mk: Regenerate. + 2013-12-16 Paul Eggert * INSTALL: Clarify treatment of image libraries. diff --git a/lib/file-has-acl.c b/lib/file-has-acl.c index bb8bae1286..53ac317c0b 100644 --- a/lib/file-has-acl.c +++ b/lib/file-has-acl.c @@ -75,8 +75,7 @@ acl_access_nontrivial (acl_t acl) } return got_one; -# else /* IRIX, Tru64 */ -# if HAVE_ACL_TO_SHORT_TEXT /* IRIX */ +# elif HAVE_ACL_TO_SHORT_TEXT /* IRIX */ /* Don't use acl_get_entry: it is undocumented. */ int count = acl->acl_cnt; @@ -93,8 +92,7 @@ acl_access_nontrivial (acl_t acl) } return 0; -# endif -# if HAVE_ACL_FREE_TEXT /* Tru64 */ +# elif HAVE_ACL_FREE_TEXT /* Tru64 */ /* Don't use acl_get_entry: it takes only one argument and does not work. */ int count = acl->acl_num; @@ -117,7 +115,10 @@ acl_access_nontrivial (acl_t acl) } return 0; -# endif +# else + + errno = ENOSYS; + return -1; # endif } diff --git a/lib/gnulib.mk b/lib/gnulib.mk index 9617452a79..16a4ed8700 100644 --- a/lib/gnulib.mk +++ b/lib/gnulib.mk @@ -1573,6 +1573,7 @@ time.h: time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $( -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ -e 's|@''NEXT_TIME_H''@|$(NEXT_TIME_H)|g' \ + -e 's/@''GNULIB_GETTIMEOFDAY''@/$(GNULIB_GETTIMEOFDAY)/g' \ -e 's/@''GNULIB_MKTIME''@/$(GNULIB_MKTIME)/g' \ -e 's/@''GNULIB_NANOSLEEP''@/$(GNULIB_NANOSLEEP)/g' \ -e 's/@''GNULIB_STRPTIME''@/$(GNULIB_STRPTIME)/g' \ @@ -1582,6 +1583,8 @@ time.h: time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $( -e 's|@''HAVE_NANOSLEEP''@|$(HAVE_NANOSLEEP)|g' \ -e 's|@''HAVE_STRPTIME''@|$(HAVE_STRPTIME)|g' \ -e 's|@''HAVE_TIMEGM''@|$(HAVE_TIMEGM)|g' \ + -e 's|@''REPLACE_GMTIME''@|$(REPLACE_GMTIME)|g' \ + -e 's|@''REPLACE_LOCALTIME''@|$(REPLACE_LOCALTIME)|g' \ -e 's|@''REPLACE_LOCALTIME_R''@|$(REPLACE_LOCALTIME_R)|g' \ -e 's|@''REPLACE_MKTIME''@|$(REPLACE_MKTIME)|g' \ -e 's|@''REPLACE_NANOSLEEP''@|$(REPLACE_NANOSLEEP)|g' \ diff --git a/lib/time.in.h b/lib/time.in.h index 8ced794744..d4c9906146 100644 --- a/lib/time.in.h +++ b/lib/time.in.h @@ -187,6 +187,39 @@ _GL_CXXALIASWARN (gmtime_r); # endif # endif +/* Convert TIMER to RESULT, assuming local time and UTC respectively. See + and + . */ +# if @GNULIB_GETTIMEOFDAY@ +# if @REPLACE_LOCALTIME@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef localtime +# define localtime rpl_localtime +# endif +_GL_FUNCDECL_RPL (localtime, struct tm *, (time_t const *__timer) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (localtime, struct tm *, (time_t const *__timer)); +# else +_GL_CXXALIAS_SYS (localtime, struct tm *, (time_t const *__timer)); +# endif +_GL_CXXALIASWARN (localtime); +# endif + +# if @GNULIB_GETTIMEOFDAY@ +# if @REPLACE_GMTIME@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef gmtime +# define gmtime rpl_gmtime +# endif +_GL_FUNCDECL_RPL (gmtime, struct tm *, (time_t const *__timer) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (gmtime, struct tm *, (time_t const *__timer)); +# else +_GL_CXXALIAS_SYS (gmtime, struct tm *, (time_t const *__timer)); +# endif +_GL_CXXALIASWARN (gmtime); +# endif + /* Parse BUF as a time stamp, assuming FORMAT specifies its layout, and store the resulting broken-down time into TM. See . */ diff --git a/m4/gettimeofday.m4 b/m4/gettimeofday.m4 index 3c05e59f06..f48ef4365c 100644 --- a/m4/gettimeofday.m4 +++ b/m4/gettimeofday.m4 @@ -1,4 +1,4 @@ -# serial 20 +# serial 21 # Copyright (C) 2001-2003, 2005, 2007, 2009-2013 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation @@ -127,10 +127,8 @@ AC_DEFUN([gl_FUNC_GETTIMEOFDAY_CLOBBER], ]) AC_DEFUN([gl_GETTIMEOFDAY_REPLACE_LOCALTIME], [ - AC_DEFINE([gmtime], [rpl_gmtime], - [Define to rpl_gmtime if the replacement function should be used.]) - AC_DEFINE([localtime], [rpl_localtime], - [Define to rpl_localtime if the replacement function should be used.]) + REPLACE_GMTIME=1 + REPLACE_LOCALTIME=1 ]) # Prerequisites of lib/gettimeofday.c. diff --git a/m4/time_h.m4 b/m4/time_h.m4 index 3b83900534..3fefb01b21 100644 --- a/m4/time_h.m4 +++ b/m4/time_h.m4 @@ -2,7 +2,7 @@ # Copyright (C) 2000-2001, 2003-2007, 2009-2013 Free Software Foundation, Inc. -# serial 7 +# serial 8 # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -106,4 +106,13 @@ AC_DEFUN([gl_HEADER_TIME_H_DEFAULTS], REPLACE_MKTIME=GNULIB_PORTCHECK; AC_SUBST([REPLACE_MKTIME]) REPLACE_NANOSLEEP=GNULIB_PORTCHECK; AC_SUBST([REPLACE_NANOSLEEP]) REPLACE_TIMEGM=GNULIB_PORTCHECK; AC_SUBST([REPLACE_TIMEGM]) + + dnl Hack so that the time module doesn't depend on the sys_time module. + dnl First, default GNULIB_GETTIMEOFDAY to 0 if sys_time is absent. + : ${GNULIB_GETTIMEOFDAY=0}; AC_SUBST([GNULIB_GETTIMEOFDAY]) + dnl Second, it's OK to not use GNULIB_PORTCHECK for REPLACE_GMTIME + dnl and REPLACE_LOCALTIME, as portability to Solaris 2.6 and earlier + dnl is no longer a big deal. + REPLACE_GMTIME=0; AC_SUBST([REPLACE_GMTIME]) + REPLACE_LOCALTIME=0; AC_SUBST([REPLACE_LOCALTIME]) ])