vpx_integer.h revision 1b362b15af34006e6a11974088a46d42b903418e
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 11 12#ifndef VPX_INTEGER_H 13#define VPX_INTEGER_H 14 15/* get ptrdiff_t, size_t, wchar_t, NULL */ 16#include <stddef.h> 17 18#if (defined(_MSC_VER) && (_MSC_VER < 1600)) || defined(VPX_EMULATE_INTTYPES) 19typedef signed char int8_t; 20typedef signed short int16_t; 21typedef signed int int32_t; 22 23typedef unsigned char uint8_t; 24typedef unsigned short uint16_t; 25typedef unsigned int uint32_t; 26 27#if (defined(_MSC_VER) && (_MSC_VER < 1600)) 28typedef signed __int64 int64_t; 29typedef unsigned __int64 uint64_t; 30#endif 31 32#ifndef _UINTPTR_T_DEFINED 33typedef size_t uintptr_t; 34#endif 35 36#else 37 38/* Most platforms have the C99 standard integer types. */ 39 40#if defined(__cplusplus) && !defined(__STDC_FORMAT_MACROS) 41#define __STDC_FORMAT_MACROS 42#endif 43#include <stdint.h> 44 45#endif 46 47/* VS2010 defines stdint.h, but not inttypes.h */ 48#if defined(_MSC_VER) 49#define PRId64 "I64d" 50#else 51#include <inttypes.h> 52#endif 53 54#endif 55