Matthieu Herrb writes: > Hi, > > While working on OpenBSD/amd64 support for XFree86, I found out that the > C preprocessor symbol for AMD64 machines was changed from __x86_64__ to > __AMD64__. But looking at what gcc defines on different AMD63 systems > (*BSD, Linux), it looks __AMD64__ is never used. Generally __amd64__ is > defined. > linux.cf add -D__AMD64__ to StandardCppDefines, so the code actually > works there. > Also, in many places where checks are done for 64 bits arches, the test > is in the form > > #if defined(_LP64) || defined(__alpha__) .... || defined(__AMD64__). > > Since on the BSDs gcc defines _LP64, these conditions will be true. But > there are a few cases where the _LP64 test is missing.
LP64 should be set correctly by more recent versions of gcc and should be used instead of the architectural defines for identifying wether long is 32 or 64 bit. I would think that any versions of gcc for AMD64 which were ever released to the wild seem to set this correctly. > > Any clues on how to fix that correctly (after 4.4) ? Instead of > enumerating all the LP64 arches in several different places, it would be > better imho to make sure _LP64 is defined and only testing on this. > > For other cases (where the dependance is not a general LP64 problem, but > AMD64 specific, it would be more logic imho to use __amd64__. > Right. It should be straight forward to change this. I used a script to change it fron __x86_64__ to __AMD64__ when AMD announced this name. (That was what I was told to use if I remember correctly). However everything should work as long as the define __x86_64__ is still supported by gcc. Egbert. _______________________________________________ Devel mailing list [EMAIL PROTECTED] http://XFree86.Org/mailman/listinfo/devel
