On 26 Feb 2003, David L Norris wrote:
> I suspect that was an oversight on my part when I replaced the #ifdef
> WIN32 with a more general version. Windows prefixes Standard C
> functions with _ unless STDC (or something like that) is defined. It
> should be safe to remove the _ prefix completely.
I think it's correct to test for a feature instead of an OS, but it might
require a bit more testing in the configure script.
Bill Meier replied to me with a bit of research. It's not entirely clear
what the correct thing to do is (especially since you build the Windows
binary on Linux).
Bill found example code that does this:
#define FTIME(dummy) _ftime(dummy)
#define TIMEB _timeb
#define FTIME(dummy) ftime(dummy)
#define TIMEB timeb
So that might be one option, but not really the "autoconf" way of testing
He also pointed out:
"The timer class is based in the C function gettimeofday() on POSIX
systems, the C function _ftime() on MS Visual C++, the C function ftime()
on Borland C++, and time() on Metrowerks Codewarrior."
So I'm not sure change to just ftime() wouldn't break things on Windows.
Perhaps the check for gettimeofday needs to be expanded in configure.in.
[I would think that there would be a standard macro for checking this as
it seems like a common need in portable programs.]
That code is getting close to two years old, so it has not been a huge
issue for people.
Bill Moseley firstname.lastname@example.org
Received on Wed Feb 26 16:23:42 2003