OLD | NEW |
| (Empty) |
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 __VPXTYPES_H__ | |
13 #define __VPXTYPES_H__ | |
14 | |
15 #include "vpx_config.h" | |
16 | |
17 // #include <sys/types.h> | |
18 #ifdef _MSC_VER | |
19 # include <basetsd.h> | |
20 typedef SSIZE_T ssize_t; | |
21 #endif | |
22 | |
23 #if defined(HAVE_STDINT_H) && HAVE_STDINT_H | |
24 /* C99 types are preferred to vpx integer types */ | |
25 # include <stdint.h> | |
26 #endif | |
27 | |
28 /*!\defgroup basetypes Base Types | |
29 @{*/ | |
30 #if !defined(HAVE_STDINT_H) && !defined(INT_T_DEFINED) | |
31 # ifdef STRICTTYPES | |
32 typedef signed char int8_t; | |
33 typedef signed short int16_t; | |
34 typedef signed int int32_t; | |
35 # else | |
36 typedef char int8_t; | |
37 typedef short int16_t; | |
38 typedef int int32_t; | |
39 # endif | |
40 typedef unsigned char uint8_t; | |
41 typedef unsigned short uint16_t; | |
42 typedef unsigned int uint32_t; | |
43 #endif | |
44 | |
45 typedef int8_t vpxs8; | |
46 typedef uint8_t vpxu8; | |
47 typedef int16_t vpxs16; | |
48 typedef uint16_t vpxu16; | |
49 typedef int32_t vpxs32; | |
50 typedef uint32_t vpxu32; | |
51 typedef int32_t vpxbool; | |
52 | |
53 enum {vpxfalse, vpxtrue}; | |
54 | |
55 /*!\def OTC | |
56 \brief a macro suitable for declaring a constant #vpxtc*/ | |
57 /*!\def VPXTC | |
58 \brief printf format string suitable for printing an #vpxtc*/ | |
59 #ifdef UNICODE | |
60 # ifdef NO_WCHAR | |
61 # error "no non-wchar support added yet" | |
62 # else | |
63 # include <wchar.h> | |
64 typedef wchar_t vpxtc; | |
65 # define OTC(str) L ## str | |
66 # define VPXTC "ls" | |
67 # endif /*NO_WCHAR*/ | |
68 #else | |
69 typedef char vpxtc; | |
70 # define OTC(str) (vpxtc*)str | |
71 # define VPXTC "s" | |
72 #endif /*UNICODE*/ | |
73 /*@} end - base types*/ | |
74 | |
75 /*!\addtogroup basetypes | |
76 @{*/ | |
77 /*!\def VPX64 | |
78 \brief printf format string suitable for printing an #vpxs64*/ | |
79 #if defined(HAVE_STDINT_H) | |
80 # define VPX64 PRId64 | |
81 typedef int64_t vpxs64; | |
82 #elif defined(HASLONGLONG) | |
83 # undef PRId64 | |
84 # define PRId64 "lld" | |
85 # define VPX64 PRId64 | |
86 typedef long long vpxs64; | |
87 #elif defined(WIN32) || defined(_WIN32_WCE) | |
88 # undef PRId64 | |
89 # define PRId64 "I64d" | |
90 # define VPX64 PRId64 | |
91 typedef __int64 vpxs64; | |
92 typedef unsigned __int64 vpxu64; | |
93 #elif defined(__uClinux__) && defined(CHIP_DM642) | |
94 # include <lddk.h> | |
95 # undef PRId64 | |
96 # define PRId64 "lld" | |
97 # define VPX64 PRId64 | |
98 typedef long vpxs64; | |
99 #else | |
100 # error "64 bit integer type undefined for this platform!" | |
101 #endif | |
102 #if !defined(HAVE_STDINT_H) && !defined(INT_T_DEFINED) | |
103 typedef vpxs64 int64_t; | |
104 typedef vpxu64 uint64_t; | |
105 #endif | |
106 /*!@} end - base types*/ | |
107 | |
108 /*!\ingroup basetypes | |
109 \brief Common return type*/ | |
110 typedef enum { | |
111 VPX_NOT_FOUND = -404, | |
112 VPX_BUFFER_EMPTY = -202, | |
113 VPX_BUFFER_FULL = -201, | |
114 | |
115 VPX_CONNREFUSED = -102, | |
116 VPX_TIMEDOUT = -101, | |
117 VPX_WOULDBLOCK = -100, | |
118 | |
119 VPX_NET_ERROR = -9, | |
120 VPX_INVALID_VERSION = -8, | |
121 VPX_INPROGRESS = -7, | |
122 VPX_NOT_SUPP = -6, | |
123 VPX_NO_MEM = -3, | |
124 VPX_INVALID_PARAMS = -2, | |
125 VPX_ERROR = -1, | |
126 VPX_OK = 0, | |
127 VPX_DONE = 1 | |
128 } vpxsc; | |
129 | |
130 #if defined(WIN32) || defined(_WIN32_WCE) | |
131 # define DLLIMPORT __declspec(dllimport) | |
132 # define DLLEXPORT __declspec(dllexport) | |
133 # define DLLLOCAL | |
134 #elif defined(LINUX) | |
135 # define DLLIMPORT | |
136 /*visibility attribute support is available in 3.4 and later. | |
137 see: http:// gcc.gnu.org/wiki/Visibility for more info*/ | |
138 # if defined(__GNUC__) && ((__GNUC__<<16|(__GNUC_MINOR__&0xff)) >= (3<<16|4)) | |
139 # define GCC_HASCLASSVISIBILITY | |
140 # endif /*defined(__GNUC__) && __GNUC_PREREQ(3,4)*/ | |
141 # ifdef GCC_HASCLASSVISIBILITY | |
142 # define DLLEXPORT __attribute__ ((visibility("default"))) | |
143 # define DLLLOCAL __attribute__ ((visibility("hidden"))) | |
144 # else | |
145 # define DLLEXPORT | |
146 # define DLLLOCAL | |
147 # endif /*GCC_HASCLASSVISIBILITY*/ | |
148 #endif /*platform ifdefs*/ | |
149 | |
150 #endif /*__VPXTYPES_H__*/ | |
151 | |
152 #undef VPXAPI | |
153 /*!\def VPXAPI | |
154 \brief library calling convention/storage class attributes. | |
155 | |
156 Specifies whether the function is imported through a dll | |
157 or is from a static library.*/ | |
158 #ifdef VPXDLL | |
159 # ifdef VPXDLLEXPORT | |
160 # define VPXAPI DLLEXPORT | |
161 # else | |
162 # define VPXAPI DLLIMPORT | |
163 # endif /*VPXDLLEXPORT*/ | |
164 #else | |
165 # define VPXAPI | |
166 #endif /*VPXDLL*/ | |
OLD | NEW |