Remove sgGMTime, no longer used.
(And the implementation was wrong on Windows)
This commit is contained in:
@@ -1134,24 +1134,3 @@ char *tzstring (const char* string)
|
|||||||
|
|
||||||
return strncpy (p, string, needed);
|
return strncpy (p, string, needed);
|
||||||
}
|
}
|
||||||
|
|
||||||
time_t sgGMTime()
|
|
||||||
{
|
|
||||||
// this was created to fix:
|
|
||||||
// https://code.google.com/p/flightgear-bugs/issues/detail?id=1207
|
|
||||||
// however applying the code on Unix causes bug:
|
|
||||||
// https://code.google.com/p/flightgear-bugs/issues/detail?id=1301
|
|
||||||
// One solution would be to deinfe our own 'timegm' as suggested here:
|
|
||||||
// http://linux.die.net/man/3/timegm
|
|
||||||
// but for the moment we'll assume time(0) on Unix is UTC, and hence we
|
|
||||||
// return it directly.
|
|
||||||
|
|
||||||
time_t now_sec = time(0);
|
|
||||||
#if defined(SG_WINDOWS)
|
|
||||||
struct tm now;
|
|
||||||
now = *gmtime(&now_sec);
|
|
||||||
return mktime(&now);
|
|
||||||
#else
|
|
||||||
return now_sec;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -41,11 +41,6 @@ void show (const char *zone, time_t t, int v);
|
|||||||
/* adapted from <time.h> */
|
/* adapted from <time.h> */
|
||||||
struct tm * fgLocaltime (const time_t *t, const char *tzName);
|
struct tm * fgLocaltime (const time_t *t, const char *tzName);
|
||||||
|
|
||||||
/* version of time() which returns a value in GMT/UTC, without
|
|
||||||
any timezone adjustment. Necessary on Windows where calling time()
|
|
||||||
returns a value in the local time-zone. */
|
|
||||||
time_t sgGMTime();
|
|
||||||
|
|
||||||
/* Prototype for the internal function to get information based on TZ. */
|
/* Prototype for the internal function to get information based on TZ. */
|
||||||
extern struct tm *fgtz_convert (const time_t *t, int use_localtime,
|
extern struct tm *fgtz_convert (const time_t *t, int use_localtime,
|
||||||
struct tm *tp, const char *tzName);
|
struct tm *tp, const char *tzName);
|
||||||
|
|||||||
Reference in New Issue
Block a user