X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Ftime.in.h;h=984b0b323fb6e5179d86d6ea914660fc15b9660f;hb=fb5d9e612ab8fb7a87542a5ec355732604110ea9;hp=4d5cab8dafae71e09edf90e1e44ee1f34d8859fc;hpb=9ac0b22ea04bd638026bc0047f7ad714092d02cc;p=gnulib.git diff --git a/lib/time.in.h b/lib/time.in.h index 4d5cab8da..984b0b323 100644 --- a/lib/time.in.h +++ b/lib/time.in.h @@ -1,6 +1,6 @@ /* A more-standard . - Copyright (C) 2007 Free Software Foundation, Inc. + Copyright (C) 2007-2010 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -16,6 +16,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif + /* Don't get in the way of glibc when it includes time.h merely to declare a few standard symbols, rather than to declare all the symbols. Also, Solaris 8 eventually includes itself @@ -33,6 +37,11 @@ # @INCLUDE_NEXT@ @NEXT_TIME_H@ +/* NetBSD 5.0 mis-defines NULL. */ +#include + +/* The definition of _GL_ARG_NONNULL is copied here. */ + # ifdef __cplusplus extern "C" { # endif @@ -59,7 +68,14 @@ struct timespec . */ # if @REPLACE_NANOSLEEP@ # define nanosleep rpl_nanosleep -int nanosleep (struct timespec const *__rqtp, struct timespec *__rmtp); +extern int nanosleep (struct timespec const *__rqtp, struct timespec *__rmtp) + _GL_ARG_NONNULL ((1)); +# endif + +/* Return the 'time_t' representation of TP and normalize TP. */ +# if @REPLACE_MKTIME@ +# define mktime rpl_mktime +extern time_t mktime (struct tm *__tp) _GL_ARG_NONNULL ((1)); # endif /* Convert TIMER to RESULT, assuming local time and UTC respectively. See @@ -70,10 +86,12 @@ int nanosleep (struct timespec const *__rqtp, struct timespec *__rmtp); # define localtime_r rpl_localtime_r # undef gmtime_r # define gmtime_r rpl_gmtime_r -struct tm *localtime_r (time_t const *restrict __timer, - struct tm *restrict __result); -struct tm *gmtime_r (time_t const *restrict __timer, - struct tm *restrict __result); +extern struct tm *localtime_r (time_t const *restrict __timer, + struct tm *restrict __result) + _GL_ARG_NONNULL ((1, 2)); +extern struct tm *gmtime_r (time_t const *restrict __timer, + struct tm *restrict __result) + _GL_ARG_NONNULL ((1, 2)); # endif /* Parse BUF as a time stamp, assuming FORMAT specifies its layout, and store @@ -82,15 +100,17 @@ struct tm *gmtime_r (time_t const *restrict __timer, # if @REPLACE_STRPTIME@ # undef strptime # define strptime rpl_strptime -char *strptime (char const *restrict __buf, char const *restrict __format, - struct tm *restrict __tm); +extern char *strptime (char const *restrict __buf, + char const *restrict __format, + struct tm *restrict __tm) + _GL_ARG_NONNULL ((1, 2, 3)); # endif /* Convert TM to a time_t value, assuming UTC. */ # if @REPLACE_TIMEGM@ # undef timegm # define timegm rpl_timegm -time_t timegm (struct tm *__tm); +extern time_t timegm (struct tm *__tm) _GL_ARG_NONNULL ((1)); # endif /* Encourage applications to avoid unsafe functions that can overrun