On 05/20/2015 11:01 PM, Paul Eggert wrote: > Eric Blake wrote: >> I'm still open to any cleaner test, easy enough to maintain. > > All we care about is (1) is it MingW and (2) has it defined PRIdMAX to > be "lld" or to be "I64d". Is that right? If so, the first we can tell > via inspecting a predefined preprocessor macro, and the second we can > tell by a horrible trick like this:
Horrible indeed - but I like it. > > /* Do this test only on MingW. */ > char PRIdMAX_is_I64d[sizeof PRIdMAX == sizeof "I64d" ? 1 : -1]; > > which will give us a compile-time failure if PRIdMAX is "lld". And compile time is always better than searching a .o. I'll update my patch along those lines, as well as test it (since I've got access to mingw systems to reproduce if the fix works). Thanks for the idea! -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature