1
0
Fork 0

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__)
This commit is contained in:
curt 1998-06-05 18:18:12 +00:00
parent 5098aa800e
commit 274ba49906
3 changed files with 54 additions and 4 deletions

View 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

View file

@ -44,6 +44,13 @@
#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

View 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.
//