[Insight-developers] JPEG2000 bool issue on OSX ppc

Sean McBride sean at rogue-research.com
Tue May 28 11:25:01 EDT 2013


On Tue, 28 May 2013 10:53:22 -0400, Bradley Lowekamp said:

>Look at the file link below on github.

They only #define 'bool' after:

  #if defined(HAVE_STDBOOL_H)
    #include <stdbool.h>
  #else

I would expect all Mac builds to have stdbool.h; my old 10.5 build machine does.  Have you checked that HAVE_STDBOOL_H is indeed defined on the failing dashboard?

>I am having a little trouble with the getting the try_run to work. So I
>am debating about just hard coding the PPC case in the pre-processor.

That would be preferable anyway!  Then when compiling universal, each architecture will get the right value.

>What are your suggestions?

Do something like ITK already does in a few places, ex:

/* On Apple, universal builds use different settings on each build.
the sizes can be different.*/
#if defined(__APPLE__)
#undef SIZEOF_SIGNED_LONG
#  if defined(__LP64__) && __LP64__
#    define SIZEOF_SIGNED_LONG 8
#  else
#    define SIZEOF_SIGNED_LONG 4
#  endif
#undef SIZEOF_UNSIGNED_LONG
#  if defined(__LP64__) && __LP64__
#    define SIZEOF_UNSIGNED_LONG 8
#  else
#    define SIZEOF_UNSIGNED_LONG 4
#  endif
#endif


BTW: the OS X bool sizes are here:
<https://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/LowLevelABI/Mac_OS_X_ABI_Function_Calls.pdf>

ppc     4 bytes
ppc64   1 byte
i386    1 byte
x86_64  1 byte

Cheers,

-- 
____________________________________________________________
Sean McBride, B. Eng                 sean at rogue-research.com
Rogue Research                        www.rogue-research.com 
Mac Software Developer              Montréal, Québec, Canada




More information about the Insight-developers mailing list