Paul Eggert <[EMAIL PROTECTED]> writes: > It's a bit of a pain that this will reject all cross-compiled snprintfs. > Is there some way you can test for this at compile-time? > > Does the nonstandard snprintf have exactly the same signature as the > C99 snprintf? If not, we should be able to catch this at > compile-time. > > Does the nonstandard implementation have a vsnprintf? If not, we > could test for that at link-time and cross-compiles wouldn't have to > substitute snprintf except on clearly pre-C99 systems. > > Basically, I'm looking for any way we can distinguish the nonstandard > implementation without running it.
I agree that it would be nicer to distinguish the non-C99 snprintf at compile time. Unfortunately, the noncompliant snprintf has exactly the same signature and return value, and the system also has vsnprintf. We could of course test whether the system is Windows, using #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ or similar. Is that a better idea? -- Ben Pfaff [EMAIL PROTECTED] http://benpfaff.org