2 * Copyright (c) 2010 The VP8 project authors. All Rights Reserved.
4 * Use of this source code is governed by a BSD-style license and patent
5 * grant that can be found in the LICENSE file in the root of the source
6 * tree. All contributing project authors may be found in the AUTHORS
7 * file in the root of the source tree.
11 #ifndef __VPXTYPES_H__
12 #define __VPXTYPES_H__
14 #include "vpx_ports/config.h"
16 //#include <sys/types.h>
19 typedef SSIZE_T ssize_t;
22 #if defined(HAVE_STDINT_H) && HAVE_STDINT_H
23 /* C99 types are preferred to vpx integer types */
27 /*!\defgroup basetypes Base Types
29 #if !defined(HAVE_STDINT_H) && !defined(INT_T_DEFINED)
31 typedef signed char int8_t;
32 typedef signed short int16_t;
33 typedef signed int int32_t;
36 typedef short int16_t;
39 typedef unsigned char uint8_t;
40 typedef unsigned short uint16_t;
41 typedef unsigned int uint32_t;
45 typedef uint8_t vpxu8;
46 typedef int16_t vpxs16;
47 typedef uint16_t vpxu16;
48 typedef int32_t vpxs32;
49 typedef uint32_t vpxu32;
50 typedef int32_t vpxbool;
52 enum {vpxfalse, vpxtrue};
55 \brief a macro suitable for declaring a constant #vpxtc*/
57 \brief printf format string suitable for printing an #vpxtc*/
60 # error "no non-wchar support added yet"
63 typedef wchar_t vpxtc;
64 # define OTC(str) L ## str
69 # define OTC(str) (vpxtc*)str
72 /*@} end - base types*/
74 /*!\addtogroup basetypes
77 \brief printf format string suitable for printing an #vpxs64*/
78 #if defined(HAVE_STDINT_H)
80 typedef int64_t vpxs64;
81 #elif defined(HASLONGLONG)
85 typedef long long vpxs64;
86 #elif defined(WIN32) || defined(_WIN32_WCE)
88 # define PRId64 "I64d"
90 typedef __int64 vpxs64;
91 typedef unsigned __int64 vpxu64;
92 #elif defined(__uClinux__) && defined(CHIP_DM642)
98 #elif defined(__SYMBIAN32__)
101 # define VPX64 PRId64
102 typedef unsigned int vpxs64;
104 # error "64 bit integer type undefined for this platform!"
106 #if !defined(HAVE_STDINT_H) && !defined(INT_T_DEFINED)
107 typedef vpxs64 int64_t;
108 typedef vpxu64 uint64_t;
110 /*!@} end - base types*/
112 /*!\ingroup basetypes
113 \brief Common return type*/
116 VPX_NOT_FOUND = -404,
117 VPX_BUFFER_EMPTY = -202,
118 VPX_BUFFER_FULL = -201,
120 VPX_CONNREFUSED = -102,
122 VPX_WOULDBLOCK = -100,
125 VPX_INVALID_VERSION = -8,
129 VPX_INVALID_PARAMS = -2,
135 #if defined(WIN32) || defined(_WIN32_WCE)
136 # define DLLIMPORT __declspec(dllimport)
137 # define DLLEXPORT __declspec(dllexport)
141 /*visibility attribute support is available in 3.4 and later.
142 see: http://gcc.gnu.org/wiki/Visibility for more info*/
143 # if defined(__GNUC__) && ((__GNUC__<<16|(__GNUC_MINOR__&0xff)) >= (3<<16|4))
144 # define GCC_HASCLASSVISIBILITY
145 # endif /*defined(__GNUC__) && __GNUC_PREREQ(3,4)*/
146 # ifdef GCC_HASCLASSVISIBILITY
147 # define DLLEXPORT __attribute__ ((visibility("default")))
148 # define DLLLOCAL __attribute__ ((visibility("hidden")))
152 # endif /*GCC_HASCLASSVISIBILITY*/
153 #endif /*platform ifdefs*/
155 #endif /*__VPXTYPES_H__*/
159 \brief library calling convention/storage class attributes.
161 Specifies whether the function is imported through a dll
162 or is from a static library.*/
165 # define VPXAPI DLLEXPORT
167 # define VPXAPI DLLIMPORT
168 # endif /*VPXDLLEXPORT*/