// $Id$
+#ifdef HAVE_CONFIG_H
+# include <simgear_config.h>
+#endif
+
#include <simgear/compiler.h>
#include <errno.h> // for errno
// Update the time related variables
void SGTime::update( double lon, double lat, long int warp ) {
double gst_precise, gst_course;
+#ifdef _MSC_VER
+ tm * gmt = &m_gmt;
+#endif
SG_LOG( SG_EVENT, SG_DEBUG, "Updating time" );
<< " warp = " << warp );
// get GMT break down for current time
+#ifdef _MSC_VER
+ memcpy( gmt, gmtime(&cur_time), sizeof(tm) );
+#else
gmt = gmtime(&cur_time);
+#endif
SG_LOG( SG_EVENT, SG_DEBUG,
" Current GMT = " << gmt->tm_mon+1 << "/"
- << gmt->tm_mday << "/" << gmt->tm_year << " "
+ << gmt->tm_mday << "/" << (1900 + gmt->tm_year) << " "
<< gmt->tm_hour << ":" << gmt->tm_min << ":"
<< gmt->tm_sec );
time_t cur_time;
// Break down of equivalent GMT time
+#ifdef _MSC_VER
+ struct tm m_gmt; // copy of system gmtime(&time_t) structure
+#else
struct tm *gmt;
+#endif
// offset of local time relative to GMT
time_t local_offset;
inline char* get_zonename() const { return zonename; }
/** @return GMT in a "brokent down" tm structure */
+#ifdef _MSC_VER
+ inline struct tm* getGmt()const { return (struct tm *)&m_gmt; };
+#else
inline struct tm* getGmt()const { return gmt; };
+#endif
/** @return julian date */
inline double getJD() const { return jd; };