Difference between revisions of "Porting/Macros"

From RCS Wiki
Jump to navigation Jump to search
m
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:
  
<nowiki>#if defined(__ppc64__)
+
<code>
 +
#if defined(__ppc64__)
 
#endif
 
#endif
</nowiki>
+
</code>
  
 
GCC does not define __ppc64__.  It defines __PPC64__.  To make the above code build on Debian ppc64le or Debian ppc64, the summary is: change the above code to:
 
GCC does not define __ppc64__.  It defines __PPC64__.  To make the above code build on Debian ppc64le or Debian ppc64, the summary is: change the above code to:
  
<nowiki>#if defined(__ppc64__) || defined(__PPC64__)
+
<code>
 +
#if defined(__ppc64__) || defined(__PPC64__)
 
#endif
 
#endif
</nowiki>
+
</code>

Revision as of 11:02, 13 September 2023

Some projects have been ported to Apple ppc64. In that case, they may test macros like this:

  1. if defined(__ppc64__)
  2. endif

GCC does not define __ppc64__. It defines __PPC64__. To make the above code build on Debian ppc64le or Debian ppc64, the summary is: change the above code to:

  1. if defined(__ppc64__) || defined(__PPC64__)
  2. endif