www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 5616] New: std.datetime: not cross-platform

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5616

           Summary: std.datetime: not cross-platform
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: ibuclaw ubuntu.com



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.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 19 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5616


Iain Buclaw <ibuclaw ubuntu.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ibuclaw ubuntu.com
           Platform|Other                       |All
         OS/Version|Linux                       |FreeBSD



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

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 19 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5616


Jonathan M Davis <jmdavisProg gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|                            |jmdavisProg gmx.com



PST ---
You're right. It's not standard C, but it _is_ Posix. I have no clue why


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.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 19 2011
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5616


Jonathan M Davis <jmdavisProg gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED



PST ---
Fixed:
https://github.com/D-Programming-Language/phobos/commit/ac040713d33bdb959007248cd695a1554c574dd0

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 20 2011