--- Leopold Toetsch <[EMAIL PROTECTED]> wrote:
> Goplat <[EMAIL PROTECTED]> wrote:
> > ops/sys.ops:169: warning: implicit declaration of function `gmtime_r'
> > ops/sys.ops:170: warning: implicit declaration of function `asctime_r'
> > ops/sys.ops:178: warning: implicit declaration of function `localtime_r'
> 
> > msvcrt doesn't have these functions (it uses thread-local storage to make
> > the traditional functions thread safe)
> 
> I've moved these functions now all to platform/generic/time.c with a
> C<Parrot_> prefix, so that people can implement proper wrappers around
> in their relevant platform subdir.
> 
> leo

Thanks, with that and the attached patch to add said wrappers (and include
time.h) parrot compiles once again.

__________________________________
Do you Yahoo!?
Yahoo! Mail - More reliable, more storage, less spam
http://mail.yahoo.com
--- config/gen/platform/win32/time.c~   Thu Feb 19 09:06:20 2004
+++ config/gen/platform/win32/time.c    Sun Mar 14 09:03:18 2004
@@ -39,3 +39,35 @@
 {
     Sleep(seconds * 1000);
 }
+
+/*
+ * Parrot_gmtime_r()
+ */
+
+struct tm *
+Parrot_gmtime_r(const time_t *t, struct tm *tm)
+{
+    *tm = *gmtime(t);
+    return tm;
+}
+
+/*
+ * Parrot_localtime_r()
+ */
+
+struct tm *
+Parrot_localtime_r(const time_t *t, struct tm *tm)
+{
+    *tm = *localtime(t);
+    return tm;
+}
+
+/*
+ * Parrot_asctime_r()
+ */
+
+char*
+Parrot_asctime_r(const struct tm *tm, char *buffer)
+{
+    return strcpy(buffer, asctime(tm));
+}
--- include/parrot/parrot.h~    Sat Feb 21 10:09:38 2004
+++ include/parrot/parrot.h     Sun Mar 14 08:49:40 2004
@@ -75,6 +75,10 @@
 #  include <sys/time.h>
 #endif
 
+#ifdef PARROT_HAS_HEADER_TIME
+#  include <time.h>
+#endif
+
 #ifdef PARROT_HAS_HEADER_MATH
 #  include <math.h>
 #endif

Reply via email to