www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Mac OSX std.datetime / Posix daylight variable

reply Jonathan M Davis <jmdavisProg gmx.com> writes:
Posix defines the tzset function along with a few helper items. From the Linux 
man page:

extern int daylight; 
extern long timezone; 
extern char *tzname[2]; 
void tzset(void); 

It seems that while these _are_ Posix, not all Posix systems declare all of
them 
(which baffles me, but that's the way it goes it seems). tzset seem pretty 
universal, and I believe that tzname is essentially universal, but I'm not so 
sure about the others.

Currently, std.datetime uses tzset, tzname, and daylight on all Posix systems. 
It appears that for some reason, daylight is not declared on FreeBSD ( 
http://d.puremagic.com/issues/show_bug.cgi?id=5616 ). What I want to confirm is 
that this is _not_ a problem on Mac OS X.

As I understand it, std.datetime has been working just fine on Mac OS X, which 
would indicate that daylight _is_ declared on Mac OS X. Can anyone confirm
this? 
If it is indeed the case, I'd like to have daylight added to druntime (where it 
belongs) for OSX. But if it's not actually on OSX, then we definitely don't
want 
to declare it there.

- Jonathan M Davis
Feb 19 2011
parent reply Michel Fortin <michel.fortin michelf.com> writes:
On 2011-02-20 00:11:11 -0500, Jonathan M Davis <jmdavisProg gmx.com> said:

 Posix defines the tzset function along with a few helper items. From the Linux
 man page:
 
 extern int daylight;
 extern long timezone;
 extern char *tzname[2];
 void tzset(void);
 
 It seems that while these _are_ Posix, not all Posix systems declare 
 all of them
 (which baffles me, but that's the way it goes it seems). tzset seem pretty
 universal, and I believe that tzname is essentially universal, but I'm not so
 sure about the others.
 
 Currently, std.datetime uses tzset, tzname, and daylight on all Posix systems.
 It appears that for some reason, daylight is not declared on FreeBSD (
 http://d.puremagic.com/issues/show_bug.cgi?id=5616 ). What I want to confirm is
 that this is _not_ a problem on Mac OS X.
 
 As I understand it, std.datetime has been working just fine on Mac OS X, which
 would indicate that daylight _is_ declared on Mac OS X. Can anyone 
 confirm this?
 If it is indeed the case, I'd like to have daylight added to druntime (where it
 belongs) for OSX. But if it's not actually on OSX, then we definitely 
 don't want
 to declare it there.
time.h has daylight in the Mac OS X 10.6 SDK: extern int daylight; -- Michel Fortin michel.fortin michelf.com http://michelf.com/
Feb 20 2011
next sibling parent Jonathan M Davis <jmdavisProg gmx.com> writes:
On Sunday 20 February 2011 04:53:03 Michel Fortin wrote:
 On 2011-02-20 00:11:11 -0500, Jonathan M Davis <jmdavisProg gmx.com> said:
 Posix defines the tzset function along with a few helper items. From the
 Linux man page:
 
 extern int daylight;
 extern long timezone;
 extern char *tzname[2];
 void tzset(void);
 
 It seems that while these _are_ Posix, not all Posix systems declare
 all of them
 (which baffles me, but that's the way it goes it seems). tzset seem
 pretty universal, and I believe that tzname is essentially universal,
 but I'm not so sure about the others.
 
 Currently, std.datetime uses tzset, tzname, and daylight on all Posix
 systems. It appears that for some reason, daylight is not declared on
 FreeBSD ( http://d.puremagic.com/issues/show_bug.cgi?id=5616 ). What I
 want to confirm is that this is _not_ a problem on Mac OS X.
 
 As I understand it, std.datetime has been working just fine on Mac OS X,
 which would indicate that daylight _is_ declared on Mac OS X. Can anyone
 confirm this?
 If it is indeed the case, I'd like to have daylight added to druntime
 (where it belongs) for OSX. But if it's not actually on OSX, then we
 definitely don't want
 to declare it there.
time.h has daylight in the Mac OS X 10.6 SDK: extern int daylight;
Okay. Thanks for the confirmation. I've now added it to druntime for Mac OS X. - Jonathan M Davis
Feb 20 2011
prev sibling parent Jacob Carlborg <doob me.com> writes:
On 2011-02-20 13:53, Michel Fortin wrote:
 On 2011-02-20 00:11:11 -0500, Jonathan M Davis <jmdavisProg gmx.com> said:

 Posix defines the tzset function along with a few helper items. From
 the Linux
 man page:

 extern int daylight;
 extern long timezone;
 extern char *tzname[2];
 void tzset(void);

 It seems that while these _are_ Posix, not all Posix systems declare
 all of them
 (which baffles me, but that's the way it goes it seems). tzset seem
 pretty
 universal, and I believe that tzname is essentially universal, but I'm
 not so
 sure about the others.

 Currently, std.datetime uses tzset, tzname, and daylight on all Posix
 systems.
 It appears that for some reason, daylight is not declared on FreeBSD (
 http://d.puremagic.com/issues/show_bug.cgi?id=5616 ). What I want to
 confirm is
 that this is _not_ a problem on Mac OS X.

 As I understand it, std.datetime has been working just fine on Mac OS
 X, which
 would indicate that daylight _is_ declared on Mac OS X. Can anyone
 confirm this?
 If it is indeed the case, I'd like to have daylight added to druntime
 (where it
 belongs) for OSX. But if it's not actually on OSX, then we definitely
 don't want
 to declare it there.
time.h has daylight in the Mac OS X 10.6 SDK: extern int daylight;
All those four mentioned above is available both on Mac OS X 10.5 and 10.6. -- /Jacob Carlborg
Feb 20 2011