[Insight-developers] gdcm and stdint.h

Mathieu Malaterre mathieu.malaterre at gmail.com
Thu Feb 3 11:29:37 EST 2011


On Thu, Feb 3, 2011 at 4:06 PM, Bill Hoffman <bill.hoffman at kitware.com> wrote:
> Sorry, I was not clear, basically, I was pointing out there are issues. The
> issues we are having are in modular ITK, and figuring out the correct -I
> stuff to use a propagate to the rest of the system.  We also found out that
> the intel compiler on windows does not work.
>
> Intel windows break:
> http://www.cdash.org/CDash/viewBuildError.php?buildid=847604

Thanks for the report !

> So, I guess the C99/stdint.h is MSVC only.   So maybe it should be in a
> directory MSVC_C99/stdint.h.

Sure.

> Also, to make this work, we would want to put the MSVC_C99 directory as a
> sub-directory of an existing -I path for gdcm, maybe in
> Source/Common/MSVC_C00?
>
> Are these the only types needed:
>
> typedef  signed char         int8_t;
> typedef  signed short        int16_t;
> typedef  signed int          int32_t;
> typedef  unsigned char       uint8_t;
> typedef  unsigned short      uint16_t;
> typedef  unsigned int        uint32_t;
> typedef  unsigned __int64    uint64_t;
>
> What is the purpose of the C99/stdint.h if the above will work?

No I do not believe the above works on any system but some restricted
32bits machine and limited compiler. So I prefer to keep the
msvc_stdint.h as is, even if I should rename it.
Initially I wrote it so that the day M$ decides to implements C99 in
there compiler suite, then the try_compile will find the compiler
specific stdint.h, I did not imagine keeping the orignal name (as the
author did it), could be a problem one day.

> Maybe it should go back to not using the C99/stdint.h at all...
>
> What about this:
>
>
> #ifdef GDCM_HAVE_STDINT_H
> #include <stdint.h>
> #else
> #ifdef GDCM_HAVE_INTTYPES_H
> // Old system only have this
> #include <inttypes.h>   // For uint8_t uint16_t and uint32_t
> #else
> #ifdef _WIN32
> typedef  signed char         int8_t;
> typedef  signed short        int16_t;
> typedef  signed int          int32_t;
> typedef  unsigned char       uint8_t;
> typedef  unsigned short      uint16_t;
> typedef  unsigned int        uint32_t;
> typedef  unsigned __int64    uint64_t;
> #endif
> #endif

I do not believe this works as we do not check the size of int (AFAIK
int could even be 24bits). I would rather rename
Utilities/C99/stdint.h into Source/Common/gdcmC99StdInt.h and update
gdcmTypes. accordingly.

Thanks,
-- 
Mathieu


More information about the Insight-developers mailing list