[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Patch: Feature Branch - Windows Build Broken - config.h & relatives
From: |
Conrad T. Pino |
Subject: |
Patch: Feature Branch - Windows Build Broken - config.h & relatives |
Date: |
Thu, 10 Jun 2004 15:17:07 -0700 |
====================
These are best guesses based on brief guidance proved by Derek Price:
> #define inline __inline in windows-NT/config.h.in.in - there should be
> a hook.
Already so defined.
> Add strftime.c to the list of sources compiled for lib on feature.
Done in prior patch that included adding "time_r.c" also.
> #define HAVE_STRFTIME if Windows has a version.
Already so defined.
> #define strftime whatever if Windows has it under another name.
Not required, VC6 provides a definition.
> I don't recall if you need to #define my_strftime to something. Take
> a cue from other files.
Done as: #define my_strftime strftime
--------------------
VC6 doesn't support C99 "restrict" key word.
--------------------
The consequences of "HAVE_RUN_TZSET_TEST" change aren't totally clear
to me and I'd welcome any feedback.
I did extract and compile the "tzset test" program from "m4/tzset.m4"
and the answer is, "No, tzset does NOT clobber localtime's static
buffer and the wrapper function is NOT required".
#if TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
#else
# if HAVE_SYS_TIME_H
# include <sys/time.h>
# else
# include <time.h>
# endif
#endif
#include <stdlib.h>
#include <stdio.h>
int
main ()
{
time_t t1 = 853958121;
struct tm *p, s;
putenv ("TZ=GMT0");
p = localtime (&t1);
s = *p;
putenv ("TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00");
tzset ();
printf( "%d\n", (p->tm_year != s.tm_year
|| p->tm_mon != s.tm_mon
|| p->tm_mday != s.tm_mday
|| p->tm_hour != s.tm_hour
|| p->tm_min != s.tm_min
|| p->tm_sec != s.tm_sec) );
return 0;
}
====================
./windows-NT/ChangeLog:
* config.h.in.in: Replace "#undef HAVE_RUN_TZSET_TEST" macro
with "#define HAVE_RUN_TZSET_TEST 1" macro.
Replace "#undef my_strftime" macro
with "#define my_strftime strftime" macro.
Replace "#undef restrict" macro
with "#define restrict" macro.
* config.h.in: Regenerated for "./config.h.in.in" changes.
* config.h: Regenerated for "./config.h.in" change.
(Patch submitted by Conrad T. Pino <Conrad@Pino.com>.)
Index: windows-NT/config.h.in.in
===================================================================
RCS file: /cvs/ccvs/windows-NT/config.h.in.in,v
retrieving revision 1.2
diff -u -p -r1.2 config.h.in.in
--- windows-NT/config.h.in.in 20 May 2004 05:20:27 -0000 1.2
+++ windows-NT/config.h.in.in 10 Jun 2004 21:10:03 -0000
@@ -406,7 +406,7 @@
#undef HAVE_RENAME
/* Define to 1 if you have run the test for working tzset. */
-#undef HAVE_RUN_TZSET_TEST
+#define HAVE_RUN_TZSET_TEST 1
/* Define if the diff library should use setmode for binary files. */
#define HAVE_SETMODE 1
@@ -923,7 +923,7 @@
#define mode_t int
/* Define to the name of the strftime replacement function. */
-#undef my_strftime
+#define my_strftime strftime
/* Define to rpl_nanosleep if the replacement function should be used. */
#undef nanosleep
@@ -936,7 +936,7 @@
/* Define to equivalent of C99 restrict keyword, or to nothing if this is not
supported. Do not define if restrict is supported directly. */
-#undef restrict
+#define restrict
/* Define to empty if the C compiler doesn't support this keyword. */
#undef signed
- Patch: Feature Branch - Windows Build Broken - config.h & relatives,
Conrad T. Pino <=