Bug 5616 – std.datetime: not cross-platform

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
FreeBSD
Creation time
2011-02-19T15:48:00Z
Last change time
2011-02-20T02:17:33Z
Assigned to
nobody
Creator
ibuclaw

Comments

Comment #0 by ibuclaw — 2011-02-19T15:48:13Z
This is how not to write platform independent code: version(Posix) { //This should be in core.stdc.time, but it isn't, so //we're declaring it here. extern(C) { extern __gshared char* tzname[2]; extern __gshared int daylight; } } Breaks on FreeBSD because 'daylight' isn't defined in the standard C library. Regards.
Comment #1 by ibuclaw — 2011-02-19T15:51:07Z
From: http://wiki.freebsd.org/FreeBSD_and_Standards daylight broken (both in FreeBSD and in POSIX); won't fix getdate(3) not implemented timezone broken (both in FreeBSD and in POSIX); won't fix tzname broken (both in FreeBSD and in POSIX); won't fix
Comment #2 by issues.dlang — 2011-02-19T18:13:45Z
You're right. It's not standard C, but it _is_ Posix. I have no clue why FreeBSD wouldn't have it implemented. See bug# 4944. Unfortunately, I don't have a machine with FreeBSD running, we don't have an autotester with FreeBSD running, and apparently no one with FreeBSD tested std.datetime before the release.
Comment #3 by issues.dlang — 2011-02-20T02:17:33Z