[D-runtime] druntime/src/core/sys/posix/sys/un.d

Sean Kelly sean at invisibleduck.org
Mon Sep 19 11:10:55 PDT 2011


Adding this check in all Posix files would also prevent documentation from being generated for them on Windows (not that there's any documentation for these at all right now).  Should I really do this?

On Sep 3, 2011, at 8:18 AM, Rainer Schuetze wrote:

> 
> I guess the reason you had to look at un.d is dmds failure to build the import file under windows. This is happening, because the file is still compiled, even though only di-output is desired. The same currently happens with std.c.linux.socket when generating its documentation:
> 
> std\c\linux\socket.d(44): Error: undefined identifier hostent
> 
> This makes it difficult to create a complete release on a single platform. I think there are two possibilities to resolve this:
> 
> 1. stop compilation after parsing if -o- is given in combination with -H (I'm not sure if this also works for documentation generation, as it might need semantic analysis)
> 
> 2. allow switching predefined versions Windows,Linux,OSX,etc. with a command line option.
> 
> I'd vote for the second option, because it also allows to verify that source code compiles on other platforms, even if you don't have access to it.
> 
> Rainer
> 
> On 02.09.2011 20:54, Walter Bright wrote:
>> Thank you. I discovered this by compiling it under Windows and getting a
>> completely irrelevant error message.
>> 
>> 
>>> Alright. I'll add that at the end of the Required section leading each
>>> module.
>>> 
>>> On Sep 1, 2011, at 4:31 PM, Walter Bright wrote:
>>> 
>>>> Does not have an:
>>>> 
>>>> else
>>>> static assert("Unsupported operating system");
>>>> 
>>>> Nor do many other files.
>>>> 
>>>> It is important to have this to aid in porting code. For example, to
>>>> OpenBSD.
>>>> _______________________________________________
> 
> _______________________________________________
> D-runtime mailing list
> D-runtime at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/d-runtime



More information about the D-runtime mailing list