]> git.mxchange.org Git - flightgear.git/commitdiff
Incorporated some automake conditionals to try to support mktime() correctly
authorcurt <curt>
Fri, 5 Jun 1998 18:18:12 +0000 (18:18 +0000)
committercurt <curt>
Fri, 5 Jun 1998 18:18:12 +0000 (18:18 +0000)
on a wider variety of platforms.
Added the declaration of memmove needed by the stl which apparently
solaris only defines for cc compilations and not for c++ (__STDC__)

Time/Makefile.am
Time/event.cxx
Time/fg_time.cxx

index f2916865aa623022f791f4b977f2d0a72658158e..50a761c58b4a661116cb246cacac6d95198398c5 100644 (file)
@@ -1,3 +1,11 @@
+if HAVE_DAYLIGHT
+DEFS += -DHAVE_DAYLIGHT
+endif
+
+if HAVE_TIMEZONE
+DEFS += -DHAVE_TIMEZONE
+endif
+
 libdir = ${exec_prefix}/lib
 
 lib_LTLIBRARIES = libTime.la
index 15acbd6c3804aaf5554e4c23469f018c613a543a..2dfaae93657733ae8351137e6bf5d65a409edd7c 100644 (file)
 #include "event.hxx"
 
 
+#ifdef __sun__
+extern "C" {
+  extern void *memmove(void *, const void *, size_t);
+}
+#endif
+
+
 fgEVENT_MGR global_events;
 
 
@@ -235,6 +242,12 @@ void fgEventPrintStats( void ) {
 
 
 // $Log$
+// Revision 1.4  1998/06/05 18:18:12  curt
+// Incorporated some automake conditionals to try to support mktime() correctly
+// on a wider variety of platforms.
+// Added the declaration of memmove needed by the stl which apparently
+// solaris only defines for cc compilations and not for c++ (__STDC__)
+//
 // Revision 1.3  1998/05/22 21:14:53  curt
 // Rewrote event.cxx in C++ as a class using STL for the internal event list
 // and run queue this removes the arbitrary list sizes and makes things much
index f74529f24fc5cc695c72ecf257d3f25f3c01ab1a..9c0510df17685c14b753bee16fef1c532fc8e298 100644 (file)
@@ -217,18 +217,41 @@ double sidereal_course(struct tm *gmt, time_t now, double lng) {
     long int offset;
     double diff, part, days, hours, lst;
 
-    // I believe the following is Unix vs. Win32 behavior difference.
+    // I believe the mktime() has a SYSV vs. BSD behavior difference.
+
+    // The BSD style mktime() is nice because it returns its result
+    // assuming you have specified the input time in GMT
+
+    // The SYSV style mktime() is a pain because it returns its result
+    // assuming you have specified the input time in your local
+    // timezone.  Therefore you have to go to extra trouble to convert
+    // back to GMT.
+
     // If you are having problems with incorrectly positioned
     // astronomical bodies, this is a really good place to start
     // looking.
-#ifdef WIN32
-    int daylight;       // not used but need to keep the compiler happy
-    long int timezone;  // not used but need to keep the compiler happy
+
+#if !defined(HAVE_DAYLIGHT)
+    // For now we assume that if daylight is not defined in
+    // /usr/include/time.h that we have a machine with a BSD behaving
+    // mktime()
     int mktime_is_gmt = 1;
+
+    // only used for systems with SYSV style mktime() to compensate
+    // for mktime() assuming local timezone but we need to define this
+    // to keep the compiler happy
+    int daylight;
 #else
     int mktime_is_gmt = 0;
 #endif
 
+#if !defined(HAVE_TIMEZONE)
+    // only used for systems with SYSV style mktime() to compensate
+    // for mktime() assuming local timezone but we need to define this
+    // to keep the compiler happy
+    long int timezone;
+#endif
+
     // ftime() needs a little extra help finding the current timezone
 #if defined( HAVE_GETTIMEOFDAY )
 #elif defined( HAVE_FTIME )
@@ -379,6 +402,12 @@ void fgTimeUpdate(fgFLIGHT *f, fgTIME *t) {
 
 
 // $Log$
+// Revision 1.8  1998/06/05 18:18:13  curt
+// Incorporated some automake conditionals to try to support mktime() correctly
+// on a wider variety of platforms.
+// Added the declaration of memmove needed by the stl which apparently
+// solaris only defines for cc compilations and not for c++ (__STDC__)
+//
 // Revision 1.7  1998/05/30 01:57:25  curt
 // misc updates.
 //