X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=tests%2Ftest-mktime.cxx;h=037e94e5e3d482734515a3d83be5250988bdbd68;hb=c068049d840c2f4567c7d07e7fb37247d8e23407;hp=9f5d4129ef2f9b8b6a1c741c5d18fd6c07a4b98e;hpb=8d1be9f893820c70ce3a49a8dc16f9a1aa4f2a45;p=flightgear.git diff --git a/tests/test-mktime.cxx b/tests/test-mktime.cxx index 9f5d4129e..037e94e5e 100644 --- a/tests/test-mktime.cxx +++ b/tests/test-mktime.cxx @@ -75,21 +75,27 @@ time_t get_start_gmt(int year) { #else // ! defined ( MK_TIME_IS_GMT ) // timezone seems to work as a proper offset for Linux & Solaris -# if defined( __linux__ ) || defined( __sun__ ) +# if defined( __linux__ ) || defined(__sun) || defined( __CYGWIN__ ) # define TIMEZONE_OFFSET_WORKS 1 # endif - long int start = mktime(&mt); +#if defined(__CYGWIN__) +#define TIMEZONE _timezone +#else +#define TIMEZONE timezone +#endif + + time_t start = mktime(&mt); printf("start1 = %ld\n", start); printf("start2 = %s", ctime(&start)); printf("(tm_isdst = %d)\n", mt.tm_isdst); - timezone = fix_up_timezone( timezone ); - + TIMEZONE = fix_up_timezone( TIMEZONE ); + # if defined( TIMEZONE_OFFSET_WORKS ) - printf("start = %ld, timezone = %ld\n", start, timezone); - return( start - timezone ); + printf("start = %ld, timezone = %ld\n", start, TIMEZONE); + return( start - TIMEZONE ); # else // ! defined( TIMEZONE_OFFSET_WORKS ) daylight = mt.tm_isdst; @@ -99,13 +105,13 @@ time_t get_start_gmt(int year) { printf("OOOPS, problem in fg_time.cxx, no daylight savings info.\n"); } - long int offset = -(timezone / 3600 - daylight); + long int offset = -(TIMEZONE / 3600 - daylight); - printf(" Raw time zone offset = %ld\n", timezone); + printf(" Raw time zone offset = %ld\n", TIMEZONE); printf(" Daylight Savings = %d\n", daylight); printf(" Local hours from GMT = %ld\n", offset); - long int start_gmt = start - timezone + (daylight * 3600); + long int start_gmt = start - TIMEZONE + (daylight * 3600); printf(" March 21 noon (CST) = %ld\n", start); @@ -139,7 +145,7 @@ int main() { printf("This will cause the sun/moon/stars/planets to be in the\n"); printf("wrong place in the sky and the rendered time of day will be\n"); printf("incorrect.\n\n"); - printf("Please report this to curt@me.umn.edu so we can work to fix\n"); + printf("Please report this to http://www.flightgear.org/~curt so we can work to fix\n"); printf("the problem on your platform.\n"); } }