summaryrefslogtreecommitdiff
path: root/m4/gettimeofday.m4
Commit message (Collapse)AuthorAgeFilesLines
* maint: update almost all copyright ranges to include 2011Jim Meyering2011-01-011-1/+1
| | | | Run the new "make update-copyright" rule.
* gettimeofday: restore support for platforms that lack functionEric Blake2010-02-221-2/+6
| | | | | | | | | | | | | Fixes a regression from 2010-02-04, commit de4d0a3. * m4/gettimeofday.m4 (gl_FUNC_GETTIMEOFDAY): Also compile replacement if function is missing. * m4/sys_time_h.m4 (gl_HEADER_SYS_TIME_H_DEFAULTS): New witness. * modules/sys_time (Makefile.am): Substitute it. * lib/sys_time.in.h (gettimeofday): Check it. Reported by Michael Goffioul. Signed-off-by: Eric Blake <eblake@redhat.com>
* gettimeofday: expose type of second argumentEric Blake2010-02-041-21/+37
| | | | | | | | | | | | | | | Needed to silence compiler warnings such as: test-gettimeofday.c:23: warning: initialization from incompatible pointer type based on whether gettimeofday complies with POSIX or provides the extension of struct timezone. * m4/gettimeofday.m4 (gl_FUNC_GETTIMEOFDAY): Do better detection of glibc extension signature, and define GETTIMEOFDAY_TIMEZONE. * tests/test-gettimeofday.c: Use it to silence warning. * doc/posix-functions/gettimeofday.texi (gettimeofday): Document the issue. Signed-off-by: Eric Blake <ebb9@byu.net>
* sys_time: use link-warningEric Blake2010-02-011-3/+2
| | | | | | | | | | | | | | | | | | | | Modernize replacement header, to allow another GNULIB_POSIXCHECK opportunity. * m4/sys_time_h.m4 (gl_HEADER_SYS_TIME_H_BODY): Split defaults... (gl_HEADER_SYS_TIME_H_DEFAULTS): ...into new macro. (gl_SYS_TIME_MODULE_INDICATOR): New macro. * modules/sys_time (Depends-on): Add warn-on-use. (Makefile.am): Always build replacement. (configure.ac): Update substitutions. * m4/gettimeofday.m4 (gl_FUNC_GETTIMEOFDAY) (gl_FUNC_GETTIMEOFDAY_CLOBBER): Include defaults, and no longer bother with SYS_TIME_H. * modules/gettimeofday (configure.ac): Declare indicator. * lib/sys_time.in.h (gettimeofday): Warn if gnulib module is not in use. Signed-off-by: Eric Blake <ebb9@byu.net>
* update nearly all FSF copyright year lists to include 2010Jim Meyering2010-01-011-1/+1
| | | | | Use the same procedure as for 2009, outlined in http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/20081
* Use spaces for indentation, not tabs.Bruno Haible2009-12-101-25/+25
|
* many *.m4 files: improve m4 quotingJim Meyering2009-01-141-5/+5
| | | | | | | | | | | | | | | | 99% of this change was performed by running the following commands: git ls-files | grep '\.m4$' | xargs perl -pi \ -e 's/(AC_\w+\()([^[()]+?)([,)])/$1\[$2]$3/g;' \ -e 's/(AC_\w+\((?:\[[^,]+?\], ){1})([^,[()]+?)([,)])/$1\[$2]$3/g;' \ -e 's/(AC_\w+\((?:\[[^,]+?\], ){2})([^,[()]+?)([,)])/$1\[$2]$3/g;' \ -e 's/(AC_\w+\((?:\[[^,]+?\], ){3})([^,[()]+?)([,)])/$1\[$2]$3/g' perl -pi -e 's/\[\.\.\.\]/.../' m4/onceonly.m4 The remainder were to add Copyright dates, increment serial numbers, undo some changes in comments, exclude m4/intl.m4, and add quotes around the "1" in ",1" where the unusual spacing prohibited the above regexps from doing the job. For more details, see <http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/16175>.
* Rename GETTIMEOFDAY_REPLACEMENT to REPLACE_GETTIMEOFDAY.Bruno Haible2007-03-041-2/+2
|
* * modules/sys_time (Makefile.am): Build sys/time.h only when it's theJim Meyering2007-01-281-0/+2
| | | | | | | | | | | | value of $(SYS_TIME_H). [MOSTLYCLEANFILES]: Now that sys/time.h is created only when needed, remove it conditionally, too. * m4/sys_time_h.m4 (gl_HEADER_SYS_TIME_H_BODY): Set SYS_TIME_H. * m4/gettimeofday.m4 (gl_FUNC_GETTIMEOFDAY): (gl_FUNC_GETTIMEOFDAY_CLOBBER): Set SYS_TIME_H when setting GETTIMEOFDAY_REPLACEMENT to 1. 2007-01-28 Bruno Haible <bruno@clisp.org>
* Replace HAVE_GETTIMEOFDAY_POSIX_SIGNATURE and GETTIMEOFDAY_CLOBBERS_LOCALTIMEBruno Haible2007-01-191-3/+3
| | | | with GETTIMEOFDAY_REPLACEMENT.
* Undo the last change; it caused a compilation error when cross-compiling toBruno Haible2007-01-191-2/+0
| | | | Cygwin.
* * m4/gettimeofday.m4 (gl_GETTIMEOFDAY_REPLACE_LOCALTIME): AlsoEric Blake2007-01-181-1/+3
| | | | | | replace gettimeofday. * lib/gettimeofday.c (rpl_gettimeofday): Declare with replacement name, to avoid infinite recursion.
* * MODULES.html.sh (Support for systems lacking POSIX:2001): NewPaul Eggert2007-01-181-111/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | module sys_time. * lib/gethrxtime.c: Include <sys/time.h>, since we can no longer assume timespec.h defines struct timeval. * lib/settime.c: Likewise. * lib/utimens.c: Likewise. * lib/gettime.c (gettime): Remove test against HAVE_GETTIMEOFDAY, since we now assume the gettimeofday module. * lib/tempname.c (__gen_tempname): Likewise. * lib/gettimeofday.h: Remove. * lib/gettimeofday.c: Include <sys/time.h> instead of "gettimeofday.h". Don't include <sys/types.h> and <stdlib.h>; shouldn't be needed. Include <time.h>, for 'time()'. (localtime_buffer_addr): Also use this workaround if TZSET_CLOBBERS_LOCALTIME. Set to a dummy static variable by default, to simplify the uses. All uses changed. (localtime, gmtime, tzset, gettimeofday): Reformat slightly so that #undef is inside {}, and 'const' follows type name consistently. (tzset): Define replacement only if TZSET_CLOBBERS_LOCALTIME. (gettimeofday): Do not use the maximum possible value for tv->tv_usec, since that might break usages other than ls.c. Instead, we'll leave ls.c alone. This undoes today's patch by Bruno. Add a compile-time warning for 1s-clock resolution; we've never observed the problem but might as well keep the canary. * lib/nanosleep.c: Include timespec.h first, for interface check. * lib/nanosleep.c: Include <sys/time.h> unconditionally, since we now assume the sys_time module. * lib/tempname.c: Likewise. * lib/timespec.h: Likewise. * lib/nanosleep.c: Don't worry about TIME_WITH_SYS_TIME; no longer needed. * lib/strftime.c: Likewise. * lib/timespec.h: Likewise. * lib/posixtm.c: Include posixtm.h first, for interface check. Don't worry about TM_IN_SYS_TIME; that's wayyy obsolete. * lib/posixtm.h: Include stdbool.h and time.h, for proper interface. * lib/strftime.c: Don't include <sys/types.h>; shouldn't be needed. * lib/sys_time_.h: New file. * lib/timespec.h (struct timespec): Use long int, not long. * m4/gettimeofday.m4 (gl_FUNC_GETTIMEOFDAY): (gl_FUNC_GETTIMEOFDAY_CLOBBER, gl_PREREQ_GETTIMEOFDAY): Remove obsolescent call to AC_HEADER_TIME. * m4/mktime.m4 (AC_FUNC_MKTIME): Likewise. * m4/nanosleep.m4 (gl_FUNC_NANOSLEEP): Likewise. * m4/strftime.m4 (gl_FUNC_STRFTIME): Likewise. * m4/timespec.m4 (gl_TIMESPEC, gl_CHECK_TYPE_STRUCT_TIMESPEC): Likewise. * m4/tzset.m4 (gl_FUNC_TZSET_CLOBBER): Likewise. * m4/utimbuf.m4 (gl_CHECK_TYPE_STRUCT_UTIMBUF): Likewise. * m4/gettimeofday.m4 (gl_FUNC_GETTIMEOFDAY): Move sys/time.h tests into the sys_time module. Check for gettimeofday just once. Prefix our variables with gl_, not with ac_ or jm_. Tighten test for gettimeofday signature to just check the signature. Merely compile it, since linking doesn't test signature. Improve test for whether gettimeofday.o is actually needed. (gl_FUNC_GETTIMEOFDAY_CLOBBER): Renamed from AC_FUNC_GETTIMEOFDAY_CLOBBER. All uses changed. Use AC_RUN_IFELSE rather than AC_TRY_RUN. If clobbering, set and define GETTIMEOFDAY_CLOBBERS_LOCALTIME. (gl_GETTIMEOFDAY_REPLACE_LOCALTIME): Don't define GETTIMEOFDAY_CLOBBERS_LOCALTIME; that's gl_FUNC_GETTIMEOFDAY_CLOBBER's job. Don't define tzset; that's gl_FUNC_TZSET_CLOBBER's job. * m4/mktime.m4 (AC_FUNC_MKTIME): Just include <time.h> rather than worrying about sys/time.h. * m4/nanosleep.m4 (gl_FUNC_NANOSLEEP): Don't bother worrying about TIME_WITH_SYS_TIME. * m4/stat-time.m4 (gl_STAT_TIME): Likewise. * m4/posixtm.m4 (gl_POSIXTM): Remove obsolescent call to AC_STRUCT_TM. * m4/sys_time_h.m4: New file. * m4/tzset.m4 (gl_FUNC_TZSET_CLOBBER): Require gl_HEADER_SYS_TIME_H. Don't include sys/time.h. Return from main rather than exiting. Define TZSET_CLOBBERS_LOCALTIME, for consistency with other names; all uses changed. * modules/gethrxtime (Depends-on): Add sys_time. * modules/gettime (Depends-on): Likewise. * modules/gettimeofday (Depends-on): Likewise. * modules/nanosleep (Depends-on): Likewise. * modules/settime (Depends-on): Likewise. * modules/tempname (Depends-on): Likewise. * modules/utimens (Depends-on): Likewise. * modules/gettimeofday (Files): Remove lib/gettimeofday.h. (Include:) Change back to <sys/time.h>. (Maintainer:) Add self. * modules/sys_time: New file. * modules/tempname (Depends-on): Add gettimeofday. * tests/test-gettimeofday.c: Include <sys/time.h> rather than gettimeofday.h.
* Various fixes to Martin Lambers' gettimeofday patch.Bruno Haible2007-01-171-27/+26
|
* Patch from Martin Lambers <marlam@marlam.de>, from 2005-10-08Bruno Haible2007-01-171-2/+80
| | | | <http://lists.gnu.org/archive/html/bug-gnulib/2005-10/msg00093.html>
* (AC_FUNC_GETTIMEOFDAY_CLOBBER): Don't definePaul Eggert2005-05-181-4/+2
| | | | GETTIMEOFDAY_CLOBBERS_LOCALTIME_BUFFER, since nobody uses it.
* Use an all-permissive copyright notice, recommended by RMS.Paul Eggert2005-01-231-3/+8
|
* Remove K&R cruft.Paul Eggert2003-09-121-8/+3
|
* Add wrappers for gmtime and tzset, too.Paul Eggert2003-08-141-4/+11
|
* An independent .m4 file for each module.Bruno Haible2002-12-311-2/+8
|
* (AC_FUNC_GETTIMEOFDAY_CLOBBER): Also replace localtime.Jim Meyering2002-05-271-3/+5
|
* Use AC_DEFINE rather than AC_DEFINE_UNQUOTED, whenever the right hand side ↵Jim Meyering2001-09-171-1/+1
| | | | need not be expanded by the shell.
* remove unused cruftJim Meyering2001-08-121-1/+0
|
* yes/no were reversedJim Meyering2001-08-121-2/+5
|
* *** empty log message ***Jim Meyering2001-07-151-0/+65