[Insight-developers] Differentiate Xcode 2.1 from Xcode 2.0

Hans Johnson hans-johnson at uiowa.edu
Fri Jul 22 13:44:21 EDT 2005


Sean,

I am sorry to contact you this way, but I have been reading your very
helpful comments on the Cmake user list.

I need a way to distinguish between the gcc version distributed with Xcode
2.0 and Xcode 2.1 (I am actually not using Xcode itself) with pre-processor
variables.

Here is a little program that illustrates the problem:
================================
#include <iostream>

int main(int argc, char * argv[])
{
    std::cout << "__GNUC__ " << __GNUC__ << std::endl;
    std::cout << "__GNUC_MINOR__ " << __GNUC_MINOR__ << std::endl;
    std::cout << "__GNUC_PATCHLEVEL__ " << __GNUC_PATCHLEVEL__ << std::endl;
    std::cout << "__VERSION__ " << __VERSION__ << std::endl;
    return 0;
}
================================
Xcode 2.0 version of gcc:
__GNUC__ 4
__GNUC_MINOR__ 0
__GNUC_PATCHLEVEL__ 0
__VERSION__ 4.0.0 20041026 (Apple Computer, Inc. build 4061)
================================
Xcode 2.1 version of gcc:
__GNUC__ 4
__GNUC_MINOR__ 0
__GNUC_PATCHLEVEL__ 0
__VERSION__ 4.0.0 (Apple Computer, Inc. build 5026)
================================

Ideally there would be a __GNUC_BUILDLEVEL__  and my conditional would just
key off of that.  Any suggestions would be greatly appreciated.

Thanks,
Hans

PS:  To be even more specific, the problem arises in that the file
bits/basic_string.h has changed between the two releases.  I have a fix in
place, but it depends upon version of gcc being used.

  




More information about the Insight-developers mailing list