Win32 Port

Havoc Pennington hp at redhat.com
Fri Apr 28 15:58:42 PDT 2006


Kosina, Martin wrote:
> Looks like we had couple different philosophies - I #ifdef'ed and
> re-implemented individual calls or small blocks in the original
> dbus-sysdeps* files, ala Tor's diff. The amount of platform-specific
> linecount is ultimately pretty low, so duplicating lot of otherwise
> independent logic seemed somehow undesirable. But the dual-file approach
> has its merits, as well, so its ultimately up to the maintainers - which
> approach is preferable? 

Depends on the specifics of each case I guess...  I would try to create 
a sensible abstraction that people developing on either platform won't 
mess up. e.g. if sockets and files have to be handled separately, then 
ideally they are separate types and failure to do it right will also 
fail on unix (if someone is using the dbus-sysdeps abstraction).

Another guideline is that "the same" #ifdef shouldn't show up in two 
places... i.e. if there are two cases where it's needed to do
#ifdef WIN32
  A
#else
  B
#endif

then that should be factored out into a function...

I haven't looked at the code for either patch, though.

Havoc



More information about the dbus mailing list