On Sat, 31 Aug 2002, Mark Wedel wrote: > pstolarc at theperlguru.com wrote: > >> but almost. And I know, the sprintf with only constants isn't really >> necessary, but it seems more readable to me. > > Any reason you just can't redefine DATADIR in the case of the CF_WIN32 > instance? Can't remember if DATADIR is used for other stuff, but there are > probably other areas that may use some unix type features. Yes. Windows has it's own DATADIR defined somewhere that does something else. I don't know what it does. It's in some standard library. It didn't appear to be worth the time it would take to work around. > > Given the number of #ifdef blocks you current have, proabably inlining it is > OK. If there were cases where a large portion of the file was ifdef'd, then > maybe a seperate file. > > Also, my personal opinion is that #ifdef/else isn't too bad for good sized > blocks. What I found annoying in the server code is cases where you had a bunch > of things like > > ifdef <few lines> else <few lines> endif > <few more lines of code that are common > ifdef <few lines> else <few lines> endif > > etc, such that it became really hard to read through the function to see what > it was doing, because not only did you have to try to parse the code, but you > also had to parse the ifdefs. So I tended to prefer longer ifdef/else/endif, > even if they included some common code. I don't think I did that to the server source. It's probably some other Win32 guy. We all look alike. Anyway, I'll keep that in mind. > Well, beyond unix and windows, the next big one would probably be macos. I know > the newer versions are more unix like, so maybe won't be as much of a problem. > Dunno -it really depends on the next person who tries to port it to something new. I would guess MacOS would build from the Unix source, as there is no GUI code in the common files, but that's just a guess. -Philip