@@ -395,12 +395,18 @@ OIIO_INLINE_CONSTEXPR TypeDesc TypeUstringhash(TypeDesc::USTRINGHASH);
395395template <typename T> struct BaseTypeFromC {};
396396template <> struct BaseTypeFromC <unsigned char > { static const TypeDesc::BASETYPE value = TypeDesc::UINT8; };
397397template <> struct BaseTypeFromC <char > { static const TypeDesc::BASETYPE value = TypeDesc::INT8; };
398- template <> struct BaseTypeFromC <unsigned short > { static const TypeDesc::BASETYPE value = TypeDesc::UINT16; };
399- template <> struct BaseTypeFromC <short > { static const TypeDesc::BASETYPE value = TypeDesc::INT16; };
400- template <> struct BaseTypeFromC <unsigned int > { static const TypeDesc::BASETYPE value = TypeDesc::UINT; };
401- template <> struct BaseTypeFromC <int > { static const TypeDesc::BASETYPE value = TypeDesc::INT; };
398+ template <> struct BaseTypeFromC <uint16_t > { static const TypeDesc::BASETYPE value = TypeDesc::UINT16; };
399+ template <> struct BaseTypeFromC <int16_t > { static const TypeDesc::BASETYPE value = TypeDesc::INT16; };
400+ template <> struct BaseTypeFromC <uint32_t > { static const TypeDesc::BASETYPE value = TypeDesc::UINT; };
401+ template <> struct BaseTypeFromC <int32_t > { static const TypeDesc::BASETYPE value = TypeDesc::INT; };
402402template <> struct BaseTypeFromC <uint64_t > { static const TypeDesc::BASETYPE value = TypeDesc::UINT64; };
403403template <> struct BaseTypeFromC <int64_t > { static const TypeDesc::BASETYPE value = TypeDesc::INT64; };
404+ #if OIIO_GNUC_VERSION && sizeof(void*) == 8
405+ // gcc on 64 bit machines consides int64_t and long long to be different
406+ // types, even though they are actually the same size.
407+ template <> struct BaseTypeFromC <unsigned long long > { static const TypeDesc::BASETYPE value = TypeDesc::UINT64; };
408+ template <> struct BaseTypeFromC <long long > { static const TypeDesc::BASETYPE value = TypeDesc::INT64; };
409+ #endif
404410#if defined(_HALF_H_) || defined(IMATH_HALF_H_)
405411template <> struct BaseTypeFromC <half> { static const TypeDesc::BASETYPE value = TypeDesc::HALF; };
406412#endif
0 commit comments