[Insight-developers] Differentiate Xcode 2.1 from Xcode 2.0

Hans Johnson hans-johnson at uiowa.edu
Fri Jul 22 14:27:45 EDT 2005


Solution Found!

Well the good news is that I have found a solution.  And only 30 minutes
after giving up and sending an e-mail for help!

Brad:  The problems that I was having are concerned with wrapping on on the
gcc version supplied with Xcode 2.1 (more precisely the stl version supplied
with Xcode 2.1).

I've listed the fix below, and it seems to be working with gcc from both
Xcode 2.0 and Xcode 2.1.
 
-----start snip----
pwd
/scratch/hjohnson/src/brains2/iplFreeware/unpackdir/Insight/Utilities/CableS
wig/GCC_XML/Support/GCC/4.0/bits
[hjohnson at vermis bits]$ cvs diff
cvs diff: Diffing .
Index: basic_string.h
===================================================================
RCS file: 
/cvsroot/CableSwig/CableSwig/GCC_XML/Support/GCC/4.0/bits/basic_string.h,v
retrieving revision 1.2
diff -r1.2 basic_string.h
1c1
< #if defined(__APPLE__)
---
> #if defined(__APPLE__) && (__GLIBCXX__ < 20050421)
-----end snip----

This has been submitted as Bug #2068, and the solution is also in that bug
listing.

Thanks,
Hans

On 7/22/05 12:44 PM, "Hans Johnson" <hans-johnson at uiowa.edu> wrote:

> 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.
> 
>   
> 
> 
> _______________________________________________
> Insight-developers mailing list
> Insight-developers at itk.org
> http://www.itk.org/mailman/listinfo/insight-developers
> 




More information about the Insight-developers mailing list