[phobos] std.socket.timeval conflict with core.sys.posix.sys.time.timeval

David Nadlinger code at klickverbot.at
Mon Aug 29 18:15:37 PDT 2011


On 8/30/11 2:39 AM, Graham Cole wrote:
> If a source module imports both std.socket and core.sys.posix.sys.time (or std.c.linux.linux) then a conflict for the definition of timeval occurs: […] Is there any easy fix for this ?

Yes, D offers facilities to resolve name collisions: Either import only 
the symbols you need from the modules using selective imports (possibly 
renaming one of the timeval structs if you need both), or use static 
imports on at least one module so you won't end up with two conflicting 
symbols.

Your concrete problem aside, if we decide to keep std.socket, we should 
really remove timeval (need to go though the deprecation cycle, 
unfortunately) and change Socket.select() to accept a Duration.

> If I change the structure name in socket.d I presume the whole library needs to be recompiled from it's source so that the mangled names match. There aren't many instructions in the github source on how to recompile. Do I just download the druntime and phobos source trees, do a make -f posix.mak MODEL=64 and change the install path to suit my machine (/usr/lib64) or is it more complicated than this ?
It isn't more complicated than that, although I am not sure if the 
makefiles have working install targets.

David


More information about the phobos mailing list