Net-Radio-Location-SUPL-Test
view release on metacpan or search on metacpan
asn1/GeneralizedTime.c view on Meta::CPAN
* Where to look for offset from GMT, Phase II.
*/
#ifdef HAVE_TM_GMTOFF
#define GMTOFF(tm) ((tm).tm_gmtoff)
#else /* HAVE_TM_GMTOFF */
#define GMTOFF(tm) (-timezone)
#endif /* HAVE_TM_GMTOFF */
#if (defined(_EMULATE_TIMEGM) || !defined(HAVE_TM_GMTOFF))
#warning "PLEASE STOP AND READ!"
#warning " timegm() is implemented via getenv(\"TZ\")/setenv(\"TZ\"), which may be not thread-safe."
#warning " "
#warning " You must fix the code by inserting appropriate locking"
#warning " if you want to use asn_GT2time() or asn_UT2time()."
#warning "PLEASE STOP AND READ!"
#endif /* _EMULATE_TIMEGM */
/*
* Override our GMTOFF decision for other known platforms.
*/
#ifdef __CYGWIN__
asn1/GeneralizedTime.c view on Meta::CPAN
tzold = getenv("TZ"); \
if(tzold) { \
size_t tzlen = strlen(tzold); \
if(tzlen < sizeof(tzoldbuf)) { \
tzold = memcpy(tzoldbuf, tzold, tzlen + 1); \
} else { \
char *dupptr = tzold; \
tzold = MALLOC(tzlen + 1); \
if(tzold) memcpy(tzold, dupptr, tzlen + 1); \
} \
setenv("TZ", "UTC", 1); \
} \
tzset(); \
} while(0)
#define ATZOLDTZ do { \
if (tzold) { \
setenv("TZ", tzold, 1); \
*tzoldbuf = 0; \
if(tzold != tzoldbuf) \
FREEMEM(tzold); \
} else { \
unsetenv("TZ"); \
} \
tzset(); \
} while(0); } while(0);
#ifdef _EMULATE_TIMEGM
static time_t timegm(struct tm *tm) {
time_t tloc;
ATZVARS;
ATZSAVETZ;
tloc = mktime(tm);
( run in 0.689 second using v1.01-cache-2.11-cpan-6aa56a78535 )