However, I am using Paul Semdley's build evnironment and my time.h
has:
#if 0 /* bird: LIBC isn't implementing tm_gmtoff and tm_zone. */
long tm_gmtoff; /* offset from UTC in seconds */
char *tm_zone; /* timezone abbreviation */
#endif
This, of course, results in compilation errors.
Would it be appropriate to use:
tzset();
m_time -= timezone;
in place of:
if ((tm = localtime(&m_time)) != (struct tm *)NULL)
m_time -= tm->tm_gmtoff; /* sec. EAST of GMT:
subtr. */
Or is there a better solution?
--
John Small
parser.c: In function 'parse_record_w3c':
parser.c:721: error: 'struct tm' has no member named 'tm_gmtoff'
make.exe: *** [parser.o] Error 1
I just comment out the line 721 and that fix that error..
--
With the best regards from the Netherlands,
> On Sat, 31 Jan 2009 01:14:26 UTC, "John Small" <jsm...@os2world.net>
> wrote:
> Hi John,
> > I am trying to port software which references tm_gmtoff as a member of
> > "struct tm".
> >
> > However, I am using Paul Semdley's build evnironment and my time.h
> > has:
> > #if 0 /* bird: LIBC isn't implementing tm_gmtoff and tm_zone. */
> > long tm_gmtoff; /* offset from UTC in seconds */
> > char *tm_zone; /* timezone abbreviation */
> > #endif
> >
> > This, of course, results in compilation errors.
> >
> I have port a prog that also had that error:
>
> parser.c: In function 'parse_record_w3c':
> parser.c:721: error: 'struct tm' has no member named 'tm_gmtoff'
> make.exe: *** [parser.o] Error 1
>
> I just comment out the line 721 and that fix that error..
It fixes the compilation error. But doesn't that mean you are losing
the functionality of whatever your line 721 is doing?
> > Would it be appropriate to use:
> > tzset();
> > m_time -= timezone;
> > in place of:
> > if ((tm = localtime(&m_time)) != (struct tm *)NULL)
> > m_time -= tm->tm_gmtoff; /* sec. EAST of GMT:
> > subtr. */
> >
> > Or is there a better solution?
--
John Small
This looks like the correct solution. Just beware that tzset() is picky
about the value of %TZ%. See the emx 0.9d C library reference
Dave