3 ?RCS: Copyright (c) 2008 H.Merijn Brand
5 ?RCS: You may distribute under the terms of either the GNU General Public
6 ?RCS: License or the Artistic License, as specified in the README file.
8 ?MAKE:sGMTIME_max sGMTIME_min: cat rm_try Setvar Compile run i_values
11 ?S: This variable defines the maximum value of the time_t offset that
12 ?S: the system function gmtime () accepts
15 ?S: This variable defines the minimum value of the time_t offset that
16 ?S: the system function gmtime () accepts
19 ?C: This symbol contains the maximum value for the time_t offset that
20 ?C: the system function gmtime () accepts, and defaults to 0
23 ?C: This symbol contains the minimum value for the time_t offset that
24 ?C: the system function gmtime () accepts, and defaults to 0
26 ?H:#define GMTIME_MAX $sGMTIME_max /**/
27 ?H:#define GMTIME_MIN $sGMTIME_min /**/
33 : Check the max offset that gmtime accepts
34 echo "Checking max offsets that gmtime () accepts"
37 define) yyy="#include <values.h>" ;;
42 #include <sys/types.h>
51 void gm_check (time_t t)
54 if (tmp == NULL || tmp->tm_year < -1900)
67 if (tmp == NULL || tmp->tm_year < 0) {
68 for (i = 63; i >= 0; i--) {
69 time_t x = pt | ((time_t)1 << i);
74 printf ("sGMTIME_max=%ld\n", pt);
86 for (i = 36; i >= 0; i--) {
87 time_t x = pt - ((time_t)1 << i);
92 printf ("sGMTIME_min=%ld\n", pt);
96 int main (int argc, char *argv[])
98 fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
105 if eval $compile; then
109 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4