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.
12 #ifndef __VPXTYPES_H__
13 #define __VPXTYPES_H__
15 #include "vpx_ports/config.h"
17 //#include <sys/types.h>
20 typedef SSIZE_T ssize_t
;
23 #if defined(HAVE_STDINT_H) && HAVE_STDINT_H
24 /* C99 types are preferred to vpx integer types */
28 /*!\defgroup basetypes Base Types
30 #if !defined(HAVE_STDINT_H) && !defined(INT_T_DEFINED)
32 typedef signed char int8_t;
33 typedef signed short int16_t;
34 typedef signed int int32_t;
37 typedef short int16_t;
40 typedef unsigned char uint8_t;
41 typedef unsigned short uint16_t;
42 typedef unsigned int uint32_t;
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
;
53 enum {vpxfalse
, vpxtrue
};
56 \brief a macro suitable for declaring a constant #vpxtc*/
58 \brief printf format string suitable for printing an #vpxtc*/
61 # error "no non-wchar support added yet"
64 typedef wchar_t vpxtc
;
65 # define OTC(str) L ## str
70 # define OTC(str) (vpxtc*)str
73 /*@} end - base types*/
75 /*!\addtogroup basetypes
78 \brief printf format string suitable for printing an #vpxs64*/
79 #if defined(HAVE_STDINT_H)
81 typedef int64_t vpxs64
;
82 #elif defined(HASLONGLONG)
86 typedef long long vpxs64
;
87 #elif defined(WIN32) || defined(_WIN32_WCE)
89 # define PRId64 "I64d"
91 typedef __int64 vpxs64
;
92 typedef unsigned __int64 vpxu64
;
93 #elif defined(__uClinux__) && defined(CHIP_DM642)
99 #elif defined(__SYMBIAN32__)
102 # define VPX64 PRId64
103 typedef unsigned int vpxs64
;
105 # error "64 bit integer type undefined for this platform!"
107 #if !defined(HAVE_STDINT_H) && !defined(INT_T_DEFINED)
108 typedef vpxs64
int64_t;
109 typedef vpxu64
uint64_t;
111 /*!@} end - base types*/
113 /*!\ingroup basetypes
114 \brief Common return type*/
117 VPX_NOT_FOUND
= -404,
118 VPX_BUFFER_EMPTY
= -202,
119 VPX_BUFFER_FULL
= -201,
121 VPX_CONNREFUSED
= -102,
123 VPX_WOULDBLOCK
= -100,
126 VPX_INVALID_VERSION
= -8,
130 VPX_INVALID_PARAMS
= -2,
136 #if defined(WIN32) || defined(_WIN32_WCE)
137 # define DLLIMPORT __declspec(dllimport)
138 # define DLLEXPORT __declspec(dllexport)
142 /*visibility attribute support is available in 3.4 and later.
143 see: http://gcc.gnu.org/wiki/Visibility for more info*/
144 # if defined(__GNUC__) && ((__GNUC__<<16|(__GNUC_MINOR__&0xff)) >= (3<<16|4))
145 # define GCC_HASCLASSVISIBILITY
146 # endif /*defined(__GNUC__) && __GNUC_PREREQ(3,4)*/
147 # ifdef GCC_HASCLASSVISIBILITY
148 # define DLLEXPORT __attribute__ ((visibility("default")))
149 # define DLLLOCAL __attribute__ ((visibility("hidden")))
153 # endif /*GCC_HASCLASSVISIBILITY*/
154 #endif /*platform ifdefs*/
156 #endif /*__VPXTYPES_H__*/
160 \brief library calling convention/storage class attributes.
162 Specifies whether the function is imported through a dll
163 or is from a static library.*/
166 # define VPXAPI DLLEXPORT
168 # define VPXAPI DLLIMPORT
169 # endif /*VPXDLLEXPORT*/