[swift-dev] [SR-40] Port Swift to Arm progress / question

Nick Wellnhofer wellnhofer at aevum.de
Wed Dec 9 05:42:46 CST 2015


On 09/12/2015 05:50, Dmitri Gribenko via swift-dev wrote:
> Try preprocessing the following program with 'clang -E' and check how the type
> is defined:
>
> #include <unistd.h>
> #include <sys/types.h>

It's probably defined as `int` as it is on Linux i386:

 
https://github.com/nwellnhof/swift/commit/1a5962c890e43f115fc5d629a7b2ec108e1f489a#diff-58073e2ae1d7149ac7f3fe3d32dff142

> Use #if:
>
> #if defined(__linux__) && defined(__arm__)
> ...
> #else
> ...
> #endif

I guess this only works on 32-bit and needs another check for 64-bit. Why 
isnt't `__swift_ssize_t` simply defined as `ssize_t`? This would avoid this 
kind of problems.

Nick



More information about the swift-dev mailing list