blob: f04c61c04b696921cb7499532daccdbe521515c5 [file] [log] [blame]
John Koleszar0ea50ce2010-05-18 11:58:33 -04001/*
John Koleszarc2140b82010-09-09 08:16:39 -04002 * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
John Koleszar0ea50ce2010-05-18 11:58:33 -04003 *
John Koleszar94c52e42010-06-18 12:39:21 -04004 * Use of this source code is governed by a BSD-style license
John Koleszar09202d82010-06-04 16:19:40 -04005 * 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
John Koleszar94c52e42010-06-18 12:39:21 -04007 * in the file PATENTS. All contributing project authors may
John Koleszar09202d82010-06-04 16:19:40 -04008 * be found in the AUTHORS file in the root of the source tree.
John Koleszar0ea50ce2010-05-18 11:58:33 -04009 */
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
John Koleszar4ead98f2011-05-05 10:53:24 -040018#if (defined(_MSC_VER) && (_MSC_VER < 1600)) || defined(VPX_EMULATE_INTTYPES)
John Koleszar0ea50ce2010-05-18 11:58:33 -040019typedef 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
John Koleszar4ead98f2011-05-05 10:53:24 -040027#if (defined(_MSC_VER) && (_MSC_VER < 1600))
John Koleszar0ea50ce2010-05-18 11:58:33 -040028typedef signed __int64 int64_t;
29typedef unsigned __int64 uint64_t;
John Koleszar24bc1a72013-01-14 11:49:30 -080030#define INT64_MAX _I64_MAX
John Koleszar0ea50ce2010-05-18 11:58:33 -040031#endif
32
John Koleszar0ea50ce2010-05-18 11:58:33 -040033#ifndef _UINTPTR_T_DEFINED
John Koleszar83b1d902012-11-05 12:37:14 -080034typedef size_t uintptr_t;
John Koleszar0ea50ce2010-05-18 11:58:33 -040035#endif
36
John Koleszar1df03142010-05-20 14:44:18 -040037#else
38
39/* Most platforms have the C99 standard integer types. */
40
41#if defined(__cplusplus) && !defined(__STDC_FORMAT_MACROS)
42#define __STDC_FORMAT_MACROS
43#endif
44#include <stdint.h>
John Koleszar1df03142010-05-20 14:44:18 -040045
John Koleszar0ea50ce2010-05-18 11:58:33 -040046#endif
47
John Koleszar4ead98f2011-05-05 10:53:24 -040048/* VS2010 defines stdint.h, but not inttypes.h */
49#if defined(_MSC_VER)
50#define PRId64 "I64d"
51#else
52#include <inttypes.h>
53#endif
54
John Koleszar0ea50ce2010-05-18 11:58:33 -040055#endif