1 /****************************************************************************
2 ** LIBEBML : parse EBML files, see http://ebml.sourceforge.net/
4 ** <file/class description>
6 ** Copyright (C) 2002-2003 Steve Lhomme. All rights reserved.
8 ** This file is part of LIBEBML.
10 ** This library is free software; you can redistribute it and/or
11 ** modify it under the terms of the GNU Lesser General Public
12 ** License as published by the Free Software Foundation; either
13 ** version 2.1 of the License, or (at your option) any later version.
15 ** This library is distributed in the hope that it will be useful,
16 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 ** Lesser General Public License for more details.
20 ** You should have received a copy of the GNU Lesser General Public
21 ** License along with this library; if not, write to the Free Software
22 ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 ** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.
26 ** Contact license@matroska.org if any conditions of this licensing are
29 **********************************************************************/
33 \version \$Id: libebml_t.h 1298 2008-02-21 22:14:18Z mosu $
34 \author Steve Lhomme <robux4 @ users.sf.net>
35 \author Ingo Ralf Blum <ingoralfblum @ users.sf.net>
36 \author Moritz Bunkus <moritz@bunkus.org>
38 \brief Misc type definitions for the C API of LIBEBML
40 \note These types should be compiler/language independant (just platform dependant)
41 \todo recover the sized types (uint16, int32, etc) here too (or maybe here only)
44 #ifndef _LIBEBML_T_H_INCLUDED_
45 #define _LIBEBML_T_H_INCLUDED_
51 // Changed char is unsigned now (signedness was causing trouble in endil)
53 # if !defined(__GNUC__) // Microsoft Visual C++
54 typedef signed __int64 int64
;
55 typedef signed __int32 int32
;
56 typedef signed __int16 int16
;
57 typedef signed __int8 int8
;
58 typedef __int8 character
;
59 typedef unsigned __int64 uint64
;
60 typedef unsigned __int32 uint32
;
61 typedef unsigned __int16 uint16
;
62 typedef unsigned __int8 uint8
;
63 # else // __GNUC__, this is mingw
65 typedef int64_t int64
;
66 typedef int32_t int32
;
67 typedef int16_t int16
;
69 typedef int8_t character
;
70 typedef uint64_t uint64
;
71 typedef uint32_t uint32
;
72 typedef uint16_t uint16
;
73 typedef uint8_t uint8
;
75 #elif (defined(__BEOS__) || defined(__HAIKU__))
76 #include <SupportDefs.h>
77 #elif defined(DJGPP) /* SL : DJGPP doesn't support POSIX types ???? */
78 typedef signed long long int64
;
79 typedef signed long int32
;
80 typedef signed short int16
;
81 typedef signed char int8
;
82 typedef char character
;
83 typedef unsigned long long uint64
;
84 typedef unsigned long uint32
;
85 typedef unsigned short uint16
;
86 typedef unsigned char uint8
;
87 #elif defined(__sun) && (defined(__svr4__) || defined(__SVR4)) // SOLARIS
88 # include <inttypes.h>
90 # error This compiler does not support 64bit integers.
92 typedef long long int64
; // int64_t is not always defined :(
93 typedef int32_t int32
;
94 typedef int16_t int16
;
96 typedef int8_t character
;
97 typedef unsigned long long uint64
; // uint64_t is not always defined :(
98 typedef uint32_t uint32
;
99 typedef uint16_t uint16
;
100 typedef uint8_t uint8
;
101 #elif (defined(__BEOS__) || defined(__HAIKU__))
102 # include <support/SupportDefs.h>
103 #else // anything else (Linux, BSD, ...)
104 # include <sys/types.h>
105 typedef int64_t int64
;
106 typedef int32_t int32
;
107 typedef int16_t int16
;
109 typedef int8_t character
;
110 typedef u_int64_t uint64
;
111 typedef u_int32_t uint32
;
112 typedef u_int16_t uint16
;
113 typedef u_int8_t uint8
;
114 #endif /* anything else */
116 typedef uint8 binary
;
119 typedef enum open_mode
{
126 #define EBML_MIN(x,y) ((x)<(y) ? (x) : (y))
132 #endif /* _LIBEBML_T_H_INCLUDED_ */