vpx_integer.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
  3. *
  4. * Use of this source code is governed by a BSD-style license
  5. * that can be found in the LICENSE file in the root of the source
  6. * tree. An additional intellectual property rights grant can be found
  7. * in the file PATENTS. All contributing project authors may
  8. * be found in the AUTHORS file in the root of the source tree.
  9. */
  10. #ifndef VPX_INTEGER_H
  11. #define VPX_INTEGER_H
  12. /* get ptrdiff_t, size_t, wchar_t, NULL */
  13. #include <stddef.h>
  14. #if (defined(_MSC_VER) && (_MSC_VER < 1600)) || defined(VPX_EMULATE_INTTYPES)
  15. typedef signed char int8_t;
  16. typedef signed short int16_t;
  17. typedef signed int int32_t;
  18. typedef unsigned char uint8_t;
  19. typedef unsigned short uint16_t;
  20. typedef unsigned int uint32_t;
  21. #if (defined(_MSC_VER) && (_MSC_VER < 1600))
  22. typedef signed __int64 int64_t;
  23. typedef unsigned __int64 uint64_t;
  24. #if !defined(INT64_MAX)
  25. #define INT64_MAX _I64_MAX
  26. #endif
  27. #if !defined(INT16_MAX)
  28. #define INT16_MAX _I16_MAX
  29. #endif
  30. #if !defined(INT16_MIN)
  31. #define INT16_MIN _I16_MIN
  32. #endif
  33. #endif
  34. #ifndef _UINTPTR_T_DEFINED
  35. typedef size_t uintptr_t;
  36. #endif
  37. #else
  38. /* Most platforms have the C99 standard integer types. */
  39. #if defined(__cplusplus) && !defined(__STDC_FORMAT_MACROS)
  40. #define __STDC_FORMAT_MACROS
  41. #endif
  42. #include <stdint.h>
  43. #endif
  44. /* VS2010 defines stdint.h, but not inttypes.h */
  45. #if defined(_MSC_VER)
  46. #define PRId64 "I64d"
  47. #else
  48. #include <inttypes.h>
  49. #endif
  50. #endif