2008/12/10 Theo Markettos <[email protected]>: > On Wed, Dec 10, 2008 at 09:11:15PM +0100, Kees Grinwis wrote: >> It is my intention to make these defines global, either by adding them >> to the compiler-flags or by separating them to a dedicated header >> file. I prefer the first solution, so that we don't have to include >> the "defines header file" each time we need it. (Although I've >> realised, just before sending this mail that there is a charm to the >> solution with the "defines header file", when using the file based >> solution the identification of files containing platform specific code >> has become somewhat easier...) > > A silly question, but for what purpose do you intend to use these flags?
The purpose of the flags would be to get rid of the __linux and _WIN32 || WIN32 (etc) defines. The best way to do that seemed to be to introduce a few RPCEmu specific defines. > The reason I ask is that autoconf does quite a bit of that stuff for you. > If you want to find out whether usleep() is provided, you do something like: > AC_CHECK_FUNCS(usleep) > in configure.in and it provides a handy #define HAVE_USLEEP in config.h if > usleep() is available. > > Obviously this isn't suitable for everything, but it does make it easy to > test for specific things. That means it'll work more smoothly on OS > upgrades or OSes you haven't seen before. Checking for features is always better, however is the automake configuration also supported in a Windows and Mac OS X environment? I fore see problems, especially with the Windows port or caused by the Windows, when using the autoconf features. Although we could introduce an RPCEMU_WIN32 define which must be set in the Windows configuration and use the autoconf option on all other platforms. > "Test for the feature you want, not the OS that happens to have it at the > moment" To which I completely agree, I'm advocating the same when this issue pops up in website development :-) >> However I'm unsure what the impact of that solution would be on the >> Win32 version of RPCEmu. Is the compiler used for the Win32 version >> also capable of adding one (or more) defines from the command line? > > Yes, both MSVC++ and gcc support the -DNAME=value syntax > (it's /DNAME=value in MSVC++, though you usually use a dialogue box) OK, then above solution would be feasable. (Use autoconf on Linux (and Mac OS X?) and use the DNAME=value syntax in a Win32 environment. -- Greetingz Kees _______________________________________________ Rpcemu mailing list [email protected] http://www.riscos.info/cgi-bin/mailman/listinfo/rpcemu
