Changeset: e74b7bf26968 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e74b7bf26968
Modified Files:
        MonetDB4/src/modules/plain/alarm.mx
        MonetDB5/src/modules/kernel/alarm.mx
        buildtools/conf/winconfig.h
Branch: Oct2010
Log Message:

Use ctime_s, asctime_s, and localtime_s on Windows.
ctime_r, asctime_r, and localtime_r are not avaliable on Windows, but
there are functions that serve the same purpose.


diffs (87 lines):

diff -r 6585656d5f30 -r e74b7bf26968 MonetDB4/src/modules/plain/alarm.mx
--- a/MonetDB4/src/modules/plain/alarm.mx       Tue Nov 16 13:00:45 2010 +0100
+++ b/MonetDB4/src/modules/plain/alarm.mx       Tue Nov 16 14:29:19 2010 +0100
@@ -286,12 +286,14 @@
 #ifdef HAVE_CTIME_R3
        char buf[26];
 
-       *retval = GDKstrdup(ctime_r(&t, buf, sizeof(buf)));
+       ctime_r(&t, buf, sizeof(buf));
+       *retval = GDKstrdup(buf);
 #else
 #ifdef HAVE_CTIME_R
        char buf[26];
 
-       *retval = GDKstrdup(ctime_r(&t, buf));
+       ctime_r(&t, buf);
+       *retval = GDKstrdup(buf);
 #else
        *retval = GDKstrdup(ctime(&t));
 #endif
diff -r 6585656d5f30 -r e74b7bf26968 MonetDB5/src/modules/kernel/alarm.mx
--- a/MonetDB5/src/modules/kernel/alarm.mx      Tue Nov 16 13:00:45 2010 +0100
+++ b/MonetDB5/src/modules/kernel/alarm.mx      Tue Nov 16 14:29:19 2010 +0100
@@ -315,12 +315,14 @@
 #ifdef HAVE_CTIME_R3
        char buf[26];
 
-       base = ctime_r(&t, buf, sizeof(buf));
+       ctime_r(&t, buf, sizeof(buf));
+       base = buf;
 #else
 #ifdef HAVE_CTIME_R
        char buf[26];
 
-       base = ctime_r(&t, buf);
+       ctime_r(&t, buf);
+       base = buf;
 #else
        base = ctime(&t);
 #endif
diff -r 6585656d5f30 -r e74b7bf26968 buildtools/conf/winconfig.h
--- a/buildtools/conf/winconfig.h       Tue Nov 16 13:00:45 2010 +0100
+++ b/buildtools/conf/winconfig.h       Tue Nov 16 14:29:19 2010 +0100
@@ -76,10 +76,13 @@
 /* #undef HAVE_ALLOCA_H */
 
 /* Define to 1 if you have the `asctime_r' function. */
-/* #undef HAVE_ASCTIME_R */
+#define HAVE_ASCTIME_R 1
 
 /* Define if you have asctime_r(struct tm*,char *buf,size_t s) */
-/* #undef HAVE_ASCTIME_R3 */
+#define HAVE_ASCTIME_R3 1
+
+/* there is something very similar to asctime_r on Windows: */
+#define asctime_r(t,b,s)       asctime_s(b,s,t)
 
 /* Define to 1 if you have the `basename' function. */
 /* #undef HAVE_BASENAME */
@@ -91,10 +94,13 @@
 /* #undef HAVE_CRYPT_H */
 
 /* Define to 1 if you have the `ctime_r' function. */
-/* #undef HAVE_CTIME_R */
+#define HAVE_CTIME_R 1
 
 /* Define if you have ctime_r(time_t*,char *buf,size_t s) */
-/* #undef HAVE_CTIME_R3 */
+#define HAVE_CTIME_R3 1
+
+/* there is something very similar to ctime_r on Windows: */
+#define ctime_r(t,b,s) ctime_s(b,s,t)
 
 /* Define if you have the cURL library */
 /* #undef HAVE_CURL */
@@ -266,7 +272,10 @@
 #define HAVE_LOCALE_H 1
 
 /* Define to 1 if you have the `localtime_r' function. */
-/* #undef HAVE_LOCALTIME_R */
+#define HAVE_LOCALTIME_R 1
+
+/* there is something very similar to localtime_r on Windows: */
+#define localtime_r(tp,tm)     localtime_s(tm,tp)
 
 /* Define to 1 if you have the `lockf' function. */
 /* #undef HAVE_LOCKF */
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to