On Wed, Dec 10, 2008 at 09:11:15PM +0100, Kees Grinwis wrote: > I'm currently working on the implementation of the real time clock > emulation in the Linux version of RPCEmu and although the changes > required are pretty straightforward, there are some (other) issues > that I want to tackle at the same time. These issues are mainly > related to the way platform specific code is marked in the RPCEmu > source.
Sounds good. > I suggest to have a look at the attached source of a simple test > application related to the implementation of the retrieval of the > current time from the operating system before continuing reading this > posting. I don't think you attached it, but I'll go by what you say below. > 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 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. "Test for the feature you want, not the OS that happens to have it at the moment" > 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) Theo (feel free to ignore me if you disagree) _______________________________________________ Rpcemu mailing list [email protected] http://www.riscos.info/cgi-bin/mailman/listinfo/rpcemu
