Merge "Use average mb energy from first pass in AQ2 test."
[aom.git] / vpx / vpx_integer.h
blob500f9b901ebb6f71d88f594f5a8469b44499b99e
1 /*
2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
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 */
12 #ifndef VPX_VPX_INTEGER_H_
13 #define VPX_VPX_INTEGER_H_
15 /* get ptrdiff_t, size_t, wchar_t, NULL */
16 #include <stddef.h>
18 #if defined(_MSC_VER)
19 #define VPX_FORCE_INLINE __forceinline
20 #define VPX_INLINE __inline
21 #else
22 #define VPX_FORCE_INLINE __inline__ __attribute__(always_inline)
23 // TODO(jbb): Allow a way to force inline off for older compilers.
24 #define VPX_INLINE inline
25 #endif
27 #if (defined(_MSC_VER) && (_MSC_VER < 1600)) || defined(VPX_EMULATE_INTTYPES)
28 typedef signed char int8_t;
29 typedef signed short int16_t;
30 typedef signed int int32_t;
32 typedef unsigned char uint8_t;
33 typedef unsigned short uint16_t;
34 typedef unsigned int uint32_t;
36 #if (defined(_MSC_VER) && (_MSC_VER < 1600))
37 typedef signed __int64 int64_t;
38 typedef unsigned __int64 uint64_t;
39 #define INT64_MAX _I64_MAX
40 #define INT16_MAX _I16_MAX
41 #define INT16_MIN _I16_MIN
42 #endif
44 #ifndef _UINTPTR_T_DEFINED
45 typedef size_t uintptr_t;
46 #endif
48 #else
50 /* Most platforms have the C99 standard integer types. */
52 #if defined(__cplusplus)
53 # if !defined(__STDC_FORMAT_MACROS)
54 # define __STDC_FORMAT_MACROS
55 # endif
56 # if !defined(__STDC_LIMIT_MACROS)
57 # define __STDC_LIMIT_MACROS
58 # endif
59 #endif // __cplusplus
61 #include <stdint.h>
63 #endif
65 /* VS2010 defines stdint.h, but not inttypes.h */
66 #if defined(_MSC_VER) && _MSC_VER < 1800
67 #define PRId64 "I64d"
68 #else
69 #include <inttypes.h>
70 #endif
72 #endif // VPX_VPX_INTEGER_H_