On Fri, 19 Jun 2026 at 10:02:22 +0200, Oswald Buddenhagen wrote:
> to avoid having a ton of tiny files, just put everything into one
> imap_auth.c, and keep the ifdefs in there (the alternative would imply ifs
> in the build system, which isn't any better).

Would that not be better?  As far as I can tell, it would only add one
simple if to the build system:

if <using libsasl2>
mbsync_SOURCES += sasl_cyrus.c
else
mbsync_SOURCES += sasl_simple.c
endif

While the alternative would entail either cutting the source file in
half with a sweeping #ifdef (or thirds if GNU SASL is later added), or
scattering numerous #ifdefs across the file where needed (similar to the
current code).

The choice does ultimately come down to preference, but I do think
separate files are much more maintainable here.  You don't have to spend
any time trying to parse which code applies to which implementation;
just open the corresponding file.  (I use this as an example as I myself
have to spend a lot of time visualising which #ifdef blocks apply when.)
If we don't want these files cluttering src/, we could use a src/auth/
subdir?

Take care,
        Seth McDonald.

-- 
E9D1 26A5 F0D4 9DF7 792B  C2E2 B4BF 4530 D39B 2D51


_______________________________________________
isync-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/isync-devel

Reply via email to