>> As a general rule I believe it is a bad idea to have anything in the code
>> along the lines of #ifdef WINDOWS, #ifdef MAC etc. unless it is
surrounding a
>> function that is guaranteed to pnly exist on that platform. And even in that
>> case it is probably better to stick it in a os dependant file or similar.
>
>I agree.
For instance, compare with the style of the ACE library
(http://www.cs.wustl.edu/~schmidt/ACE.html), in which the authors maintain
support for many operating systems and a lot of os dependent features from
a comon source code tree.
Instead of scattering os checks (#ifdef WIN32) everywhere in the code, they
focus on the feature at hand, say #ifdef OPENSSL_LACKS_SYSLOG.
Then, in some global configuration file, the user would be able to select
the *features* he is interested in for a particular build, maybe depending
on his particular os:
#ifdef WIN32
# define OPENSSL_LACKS_SYSLOG
#endif
Then it becomes much more clear *why* a particular line in the code is
sometimes omitted:
#ifndef OPENSSL_LACKS_SYSLOG
syslog(...);
#endif
It also becomes easy to add support for new platforms without having to
touch thousands of files. Just select the features supported by your
platform and create a new configuration file.
Mats Nilsson
______________________________________________________________________
OpenSSL Project http://www.openssl.org
Development Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]