Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Ticket #1638 (closed defect: fixed)

Opened 10 years ago

Last modified 10 years ago

Strange definitions of ssize_t for Darwin/FreeBSD

Reported by: Deewiant Assigned to: fawzi
Priority: major Milestone: 0.99.9
Component: Tango Version: trunk
Keywords: Cc:

Description

tango.stdc.posix.sys.types has some weird-looking definitions of ssize_t. It's supposed to be a signed version of size_t, but here's what's currently done:

version( linux )
    alias c_long ssize_t;
else version( darwin )
    alias size_t ssize_t;
else version( freebsd )
    alias size_t ssize_t;
else version( solaris )
    alias c_long ssize_t;

Linux and Solaris seem fine, but surely it's not the same type as size_t on any platform? The whole point is that it's a signed version of size_t. I don't have machines on which I could check what they actually are, but I very much doubt that they're size_t.

For all D-supported platforms I believe just aliasing it to ptrdiff_t would be correct and the simplest solution. (I haven't even heard of platforms where ptrdiff_t and ssize_t are different, although they could be, in theory.)

Change History

05/09/09 17:13:50 changed by larsivi

  • owner changed from kris to fawzi.

05/09/09 20:16:06 changed by fawzi

  • status changed from new to closed.
  • resolution set to fixed.

(In [4638]) unforming ssize_t (thanks Deewiant), closes #1638