In s3compat, to ifdef or not to ifdef, that's the issue

simo idra at samba.org
Tue May 25 18:37:04 MDT 2010


While reviewing abartlet's merge branch for the s3compat effort I came
up on a change in loadparm.c that splits out some functions in a
separate file. The intent is to not build that file in the merged build
because the s4 side of the code provides it's own version.

In this case to me it seemed a better choice to just use an #ifdef. The
reason is that loadparm.c traditionally has been a single file and
people expect to find everything lp_* related in there. But also that
this makes it easy to see in the code what pieces still causes conflicts
(just search for the ifdefs), while a separate file doesn't give much
clue unless you go and compare which files are included in Makefile.in
vs what are included in wscript files.


This is my take, but I guess that ifdefs may also be annoying in some
cases.
So I think it would be nice to have input from those who care about what
is the approach people like more.

a) #ifdef blocks around functions
b) move functions out of the way in separate files

I think in some cases it may also depend on the subsystem, so comments
are very welcome.

Simo.

-- 
Simo Sorce
Samba Team GPL Compliance Officer <simo at samba.org>
Principal Software Engineer at Red Hat, Inc. <simo at redhat.com>



More information about the samba-technical mailing list