michael@0: /* michael@0: * Copyright (c) 2010 The WebM project authors. All Rights Reserved. michael@0: * michael@0: * Use of this source code is governed by a BSD-style license michael@0: * that can be found in the LICENSE file in the root of the source michael@0: * tree. An additional intellectual property rights grant can be found michael@0: * in the file PATENTS. All contributing project authors may michael@0: * be found in the AUTHORS file in the root of the source tree. michael@0: */ michael@0: michael@0: michael@0: #ifndef VPX_INTEGER_H michael@0: #define VPX_INTEGER_H michael@0: michael@0: /* get ptrdiff_t, size_t, wchar_t, NULL */ michael@0: #include michael@0: michael@0: #if !defined(VPX_DONT_DEFINE_STDINT_TYPES) michael@0: michael@0: #if (defined(_MSC_VER) && (_MSC_VER < 1600)) || defined(VPX_EMULATE_INTTYPES) michael@0: typedef signed char int8_t; michael@0: typedef signed short int16_t; michael@0: typedef signed int int32_t; michael@0: michael@0: typedef unsigned char uint8_t; michael@0: typedef unsigned short uint16_t; michael@0: typedef unsigned int uint32_t; michael@0: michael@0: #if (defined(_MSC_VER) && (_MSC_VER < 1600)) michael@0: typedef signed __int64 int64_t; michael@0: typedef unsigned __int64 uint64_t; michael@0: #define INT64_MAX _I64_MAX michael@0: #define INT16_MAX _I16_MAX michael@0: #define INT16_MIN _I16_MIN michael@0: #endif michael@0: michael@0: #ifndef _UINTPTR_T_DEFINED michael@0: typedef size_t uintptr_t; michael@0: #endif michael@0: michael@0: #else michael@0: michael@0: /* Most platforms have the C99 standard integer types. */ michael@0: michael@0: #if defined(__cplusplus) && !defined(__STDC_FORMAT_MACROS) michael@0: #define __STDC_FORMAT_MACROS michael@0: #endif michael@0: #include michael@0: michael@0: #endif michael@0: michael@0: #endif michael@0: michael@0: /* VS2010 defines stdint.h, but not inttypes.h */ michael@0: #if defined(_MSC_VER) michael@0: #define PRId64 "I64d" michael@0: #else michael@0: #include michael@0: #endif michael@0: michael@0: #endif