Difference between revisions of "Porting/Macros"
Jump to navigation
Jump to search
m |
|||
Line 1: | Line 1: | ||
Some projects have been ported to Apple ppc64. In that case, they may test macros like this: | Some projects have been ported to Apple ppc64. In that case, they may test macros like this: | ||
− | < | + | <pre> |
− | #if defined(__ppc64__) | + | #if defined(__ppc64__) |
#endif | #endif | ||
− | </ | + | </pre> |
GCC does not define __ppc64__ (lowercase). It defines __PPC64__ (uppercase). To make the above code also build on Debian ppc64le or ppc64 (big endian) change the above code to: | GCC does not define __ppc64__ (lowercase). It defines __PPC64__ (uppercase). To make the above code also build on Debian ppc64le or ppc64 (big endian) change the above code to: | ||
− | < | + | <pre> |
− | #if defined(__ppc64__) || defined(__PPC64__) | + | #if defined(__ppc64__) || defined(__PPC64__) |
#endif | #endif | ||
− | </ | + | </pre> |
Revision as of 11:05, 13 September 2023
Some projects have been ported to Apple ppc64. In that case, they may test macros like this:
#if defined(__ppc64__) #endif
GCC does not define __ppc64__ (lowercase). It defines __PPC64__ (uppercase). To make the above code also build on Debian ppc64le or ppc64 (big endian) change the above code to:
#if defined(__ppc64__) || defined(__PPC64__) #endif