--- sysdep.c~	2005-07-01 01:29:16.000000000 +0000
+++ sysdep.c	2006-02-20 19:43:04.000000000 +0000
@@ -159,6 +159,11 @@
 static const char *mode_append_binary_plus = "a+b";
 const char __gnat_text_translation_required = 1;
 
+#ifdef __DJGPP__
+#include <io.h>
+#define _setmode setmode
+#endif
+
 void
 __gnat_set_binary_mode (int handle)
 {
@@ -702,6 +707,26 @@
 /* __gnat_localtime_r is not needed on NT and VMS */
 
 #else
+#if defined (__DJGPP__)
+
+/* FIXME: this is draft version only. Fix me if that is not correct  */
+/*        or not complete (AP)                                       */
+
+extern struct tm *__gnat_localtime_r PARAMS ((const time_t *, struct tm *));
+
+struct tm *
+__gnat_localtime_r (timer, tp)
+     const time_t *timer;
+     struct tm *tp;
+{
+  struct tm *tmp;
+
+  tmp = localtime (timer);
+  memcpy (tp, tmp, sizeof (struct tm));
+  return tp;
+}
+
+#else
 
 /* All other targets provide a standard localtime_r */
 
@@ -715,3 +740,4 @@
 #endif
 #endif
 #endif
+#endif


syntax highlighted by Code2HTML, v. 0.9.1