hmm...
This commit is contained in:
parent
387ae1dbb8
commit
9cfbc441e7
1 changed files with 4 additions and 5 deletions
|
|
@ -6,16 +6,15 @@
|
||||||
|
|
||||||
#define _HAVETIMEGM 1
|
#define _HAVETIMEGM 1
|
||||||
#define _HAVETMZONE 1
|
#define _HAVETMZONE 1
|
||||||
#define _HAVETMTZOFF 1
|
#define _HAVETMGMTOFF 1
|
||||||
|
|
||||||
#if defined(__linux__)
|
#if defined(__linux__)
|
||||||
# undef _HAVETMZONE
|
# undef _HAVETMZONE
|
||||||
# undef _HAVETMTZOFF
|
|
||||||
|
|
||||||
#elif defined(__sun__)
|
#elif defined(__sun__)
|
||||||
# undef _HAVETIMEGM
|
# undef _HAVETIMEGM
|
||||||
# undef _HAVETMZONE
|
# undef _HAVETMZONE
|
||||||
# undef _HAVETMTZOFF
|
# undef _HAVETMGMTOFF
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -35,7 +34,7 @@ tm2Tm(struct tm *tm, Tm *bigtm)
|
||||||
bigtm->year = tm->tm_year;
|
bigtm->year = tm->tm_year;
|
||||||
bigtm->wday = tm->tm_wday;
|
bigtm->wday = tm->tm_wday;
|
||||||
strftime(bigtm->zone, sizeof bigtm->zone, "%Z", tm);
|
strftime(bigtm->zone, sizeof bigtm->zone, "%Z", tm);
|
||||||
#ifdef _HAVETZOFF
|
#ifdef _HAVETMGMTOFF
|
||||||
bigtm->tzoff = tm->tm_gmtoff;
|
bigtm->tzoff = tm->tm_gmtoff;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -62,7 +61,7 @@ Tm2tm(Tm *bigtm, struct tm *tm)
|
||||||
#ifdef _HAVETMZONE
|
#ifdef _HAVETMZONE
|
||||||
tm->tm_zone = bigtm->zone;
|
tm->tm_zone = bigtm->zone;
|
||||||
#endif
|
#endif
|
||||||
#ifdef _HAVETZOFF
|
#ifdef _HAVETMGMTOFF
|
||||||
tm->tm_gmtoff = bigtm->tzoff;
|
tm->tm_gmtoff = bigtm->tzoff;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue