From: Earnie <ea...@us...> - 2011-02-28 17:01:07
|
Keith Marshall wrote: > On 28 February 2011 15:02, Earnie wrote: >> Keith Marshall wrote: >>> On 28 February 2011 12:22, Michael T. wrote: >>>> So you're saying that mingw gcc defines both _WIN32 and __GNUC__ >>> >>> Yes. FWIW: >>> >>> $ gcc -E -dM nul.c >> >> It shouldn't matter that _WIN32 or __GNUC__ is defined. The autoconf >> macro as follows should be used instead. >> >> — Macro: AC_C_INLINE >> If the C compiler supports the keyword inline, do nothing. Otherwise >> define inline to __inline__ or __inline if it accepts one of those, >> otherwise define inline to be empty. > > Except that the OP said his project uses cmake, not autoconf, so he > cannot use AC_C_INLINE; I don't know if cmake provides an equivalent. > > I know very little about cmake, (and what little I do know doesn't > inspire me to learn more). I will always choose autoconf for my > projects, but I don't want to get embroiled in a religious war over > which is the better choice; each project maintainer is free to make > his or her own choice. > Oh, well, yea, of course. I know even less than you obviously. My point being for pointing out AC_C_INLINE is that the correct way to determine if a compiler can use a feature is to test the feature and then set a macro as appropriate. Having to use predefined macros based on the system and compiler used is not very portable regardless and the purpose of CMake appears to be cross platform, compiler and even makefile vendor format so I would suggest the OP go back to cmake.org to request a change so that true cross platform compatibility can be achieved based on the function of the compiler instead of filtering on the predefined macros. -- Earnie -- http://www.for-my-kids.com |