daala  unknown
Experimental Daala video codec API reference.
daala_integer.h
1 /*
2  * Original copyright (c) 2010 The WebM project authors. All Rights Reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions are
6  * met:
7  *
8  * * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  *
11  * * Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in
13  * the documentation and/or other materials provided with the
14  * distribution.
15  *
16  * * Neither the name of Google, nor the WebM Project, nor the names
17  * of its contributors may be used to endorse or promote products
18  * derived from this software without specific prior written
19  * permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25  * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32  */
33 
34 
35 #ifndef DAALA_DAALA_INTEGER_H_
36 #define DAALA_DAALA_INTEGER_H_
37 
38 /* get ptrdiff_t, size_t, wchar_t, NULL */
39 #include <stddef.h>
40 
41 #if defined(_MSC_VER)
42 #define DAALA_FORCE_INLINE __forceinline
43 #define DAALA_INLINE __inline
44 #else
45 #define DAALA_FORCE_INLINE __inline__ __attribute__(always_inline)
46 /* TODO(jbb): Allow a way to force inline off for older compilers. */
47 #define DAALA_INLINE inline
48 #endif
49 
50 #if (defined(_MSC_VER) && (_MSC_VER < 1600)) || defined(DAALA_EMULATE_INTTYPES)
51 typedef signed char int8_t;
52 typedef signed short int16_t;
53 typedef signed int int32_t;
54 
55 typedef unsigned char uint8_t;
56 typedef unsigned short uint16_t;
57 typedef unsigned int uint32_t;
58 
59 #if (defined(_MSC_VER) && (_MSC_VER < 1600))
60 typedef signed __int64 int64_t;
61 typedef unsigned __int64 uint64_t;
62 #define INT64_MAX _I64_MAX
63 #define INT32_MAX _I32_MAX
64 #define INT32_MIN _I32_MIN
65 #define INT16_MAX _I16_MAX
66 #define INT16_MIN _I16_MIN
67 #endif
68 
69 #ifndef _UINTPTR_T_DEFINED
70 typedef size_t uintptr_t;
71 #endif
72 
73 #if !defined(UINT64_C)
74 #define UINT64_C(u) (u##ULL)
75 #endif
76 
77 #else
78 
79 /* Most platforms have the C99 standard integer types. */
80 
81 #if defined(__cplusplus)
82 # if !defined(__STDC_FORMAT_MACROS)
83 # define __STDC_FORMAT_MACROS
84 # endif
85 # if !defined(__STDC_LIMIT_MACROS)
86 # define __STDC_LIMIT_MACROS
87 # endif
88 /* __cplusplus */
89 #endif
90 
91 #include <stdint.h>
92 
93 #endif
94 
95 /* VS2010 defines stdint.h, but not inttypes.h */
96 #if defined(_MSC_VER) && _MSC_VER < 1800
97 #define PRId64 "I64d"
98 #else
99 #include <inttypes.h>
100 #endif
101 
102 /* DAALA_DAALA_INTEGER_H_ */
103 #endif