Lines 64-69
Link Here
|
64 |
|
64 |
|
65 |
#include <sal/config.h> |
65 |
#include <sal/config.h> |
66 |
|
66 |
|
|
|
67 |
/* Grab __SIZEOFxxx constants from typesconfig tool on Unix */ |
68 |
#if defined UNX |
69 |
#include <sal/typesizes.h> |
70 |
#elif define WNT |
71 |
/* FIXME: autogeneration of type sizes on Win32/Win64? */ |
72 |
#define SAL_TYPES_LITTLEENDIAN |
73 |
#define SAL_TYPES_ALIGNMENT2 1 |
74 |
#define SAL_TYPES_ALIGNMENT4 1 |
75 |
#define SAL_TYPES_ALIGNMENT8 1 |
76 |
#define SAL_TYPES_SIZEOFSHORT 2 |
77 |
#define SAL_TYPES_SIZEOFINT 4 |
78 |
#define SAL_TYPES_SIZEOFLONG 4 |
79 |
#define SAL_TYPES_SIZEOFLONGLONG 8 |
80 |
#define SAL_TYPES_SIZEOFPOINTER 4 |
81 |
#define SAL_TYPES_SIZEOFDOUBLE 8 |
82 |
#define SAL_TYPES_IEEEDOUBLE |
83 |
#endif |
84 |
|
67 |
#ifdef __cplusplus |
85 |
#ifdef __cplusplus |
68 |
extern "C" { |
86 |
extern "C" { |
69 |
#endif |
87 |
#endif |
Lines 74-153
Link Here
|
74 |
|
92 |
|
75 |
/* Boolean */ |
93 |
/* Boolean */ |
76 |
typedef unsigned char sal_Bool; |
94 |
typedef unsigned char sal_Bool; |
77 |
# define sal_False ((unsigned char)0) |
95 |
# define sal_False ((sal_Bool)0) |
78 |
# define sal_True ((unsigned char)1) |
96 |
# define sal_True ((sal_Bool)1) |
79 |
|
97 |
|
|
|
98 |
/* char is assumed to always be 1 byte long */ |
80 |
typedef signed char sal_Int8; |
99 |
typedef signed char sal_Int8; |
81 |
typedef unsigned char sal_uInt8; |
100 |
typedef unsigned char sal_uInt8; |
82 |
typedef signed short sal_Int16; |
|
|
83 |
typedef unsigned short sal_uInt16; |
84 |
|
101 |
|
85 |
/* #i8593#: On 64bit systems, use int for sal_*32 types. */ |
102 |
#if SAL_TYPES_SIZEOFSHORT == 2 |
86 |
#if __SIZEOFLONG == 4 |
103 |
typedef signed short sal_Int16; |
87 |
typedef signed long sal_Int32; |
104 |
typedef unsigned short sal_uInt16; |
88 |
typedef unsigned long sal_uInt32; |
105 |
#else |
|
|
106 |
#error "Could not find 16-bit type, add support for your architecture" |
107 |
#endif |
108 |
|
109 |
#if SAL_TYPES_SIZEOFLONG == 4 |
110 |
typedef signed long sal_Int32; |
111 |
typedef unsigned long sal_uInt32; |
112 |
#elif SAL_TYPES_SIZEOFINT == 4 |
113 |
typedef signed int sal_Int32; |
114 |
typedef unsigned int sal_uInt32; |
115 |
#else |
116 |
#error "Could not find 32-bit type, add support for your architecture" |
117 |
#endif |
118 |
|
119 |
#if (_MSC_VER >= 1000) |
120 |
typedef __int64 sal_Int64; |
121 |
typedef unsigned __int64 sal_uInt64; |
122 |
|
123 |
// The following are macros that will add the 64 bit constant suffix. |
124 |
#define SAL_CONST_INT64(x) x##i64 |
125 |
#define SAL_CONST_UINT64(x) x##ui64 |
126 |
#elif defined(__SUNPRO_CC) || defined(__SUNPRO_C) || defined (__GNUC__) || defined(__hpux) || defined (sgi) |
127 |
#if SAL_TYPES_SIZEOFLONGLONG == 8 |
128 |
typedef signed long long sal_Int64; |
129 |
typedef unsigned long long sal_uInt64; |
130 |
#elif SAL_TYPES_SIZEOFLONG == 8 |
131 |
typedef signed long sal_Int64; |
132 |
typedef unsigned long sal_uInt64; |
133 |
#else |
134 |
#error "Could not find 64-bit type, add support for your architecture" |
135 |
#endif |
136 |
|
137 |
// The following are macros that will add the 64 bit constant suffix. |
138 |
#define SAL_CONST_INT64(x) x##ll |
139 |
#define SAL_CONST_UINT64(x) x##ull |
140 |
#else |
141 |
#error "Please define the 64-bit types for your architecture/compiler in sal/inc/sal/types.h" |
142 |
#endif |
143 |
|
144 |
typedef char sal_Char; |
145 |
typedef signed char sal_sChar; |
146 |
typedef unsigned char sal_uChar; |
147 |
|
148 |
#if defined(SAL_W32) |
149 |
typedef wchar_t sal_Unicode; |
89 |
#else |
150 |
#else |
90 |
typedef signed int sal_Int32; |
151 |
#define SAL_UNICODE_NOTEQUAL_WCHAR_T |
91 |
typedef unsigned int sal_uInt32; |
152 |
typedef sal_uInt16 sal_Unicode; |
92 |
#endif |
153 |
#endif |
93 |
|
154 |
|
94 |
# if (_MSC_VER >= 1000) |
155 |
typedef void * sal_Handle; |
95 |
typedef __int64 sal_Int64; |
|
|
96 |
typedef unsigned __int64 sal_uInt64; |
97 |
// The following are macros that will add the 64 bit constant suffix. |
98 |
# define SAL_CONST_INT64(x) x##i64 |
99 |
# define SAL_CONST_UINT64(x) x##ui64 |
100 |
|
156 |
|
101 |
# elif defined(__SUNPRO_CC) || defined(__SUNPRO_C) || defined (__GNUC__) || defined (__MWERKS__) || defined(__hpux) || defined (sgi) |
157 |
/* sal_Size should currently be the native width of the platform */ |
102 |
#if __SIZEOFLONG == 4 |
158 |
#if SAL_TYPES_SIZEOFLONG == 4 |
103 |
typedef long long sal_Int64; |
159 |
typedef sal_uInt32 sal_Size; |
104 |
typedef unsigned long long sal_uInt64; |
160 |
#elif SAL_TYPES_SIZEOFLONG == 8 |
|
|
161 |
typedef sal_uInt64 sal_Size; |
105 |
#else |
162 |
#else |
106 |
typedef long sal_Int64; |
163 |
#error "Please make sure SAL_TYPES_SIZEOFLONG is defined for your architecture/compiler" |
107 |
typedef unsigned long sal_uInt64; |
|
|
108 |
#endif |
164 |
#endif |
109 |
|
165 |
|
110 |
// The following are macros that will add the 64 bit constant suffix. |
166 |
|
111 |
# define SAL_CONST_INT64(x) x##ll |
167 |
/********************************************************************************/ |
112 |
# define SAL_CONST_UINT64(x) x##ull |
168 |
/* Useful defines |
113 |
#else |
169 |
*/ |
114 |
# error "Please define the 64 bit definitions in sal/inc/sal/types.h" |
|
|
115 |
#endif |
116 |
|
170 |
|
117 |
/* The following SAL_MIN_INTn defines codify the assumption that the signed |
171 |
/* The following SAL_MIN_INTn defines codify the assumption that the signed |
118 |
sal_Int types use two's complement representation. Defining them as |
172 |
sal_Int types use two's complement representation. Defining them as |
119 |
"-0x7F... - 1" instead of as "-0x80..." prevents warnings about applying the |
173 |
"-0x7F... - 1" instead of as "-0x80..." prevents warnings about applying the |
120 |
unary minus operator to unsigned quantities. */ |
174 |
unary minus operator to unsigned quantities. */ |
121 |
#define SAL_MIN_INT8 ((sal_Int8) (-0x7F - 1)) |
175 |
#define SAL_MIN_INT8 ((sal_Int8) (-0x7F - 1)) |
122 |
#define SAL_MAX_INT8 ((sal_Int8) 0x7F) |
176 |
#define SAL_MAX_INT8 ((sal_Int8) 0x7F) |
123 |
#define SAL_MAX_UINT8 ((sal_uInt8) 0xFF) |
177 |
#define SAL_MAX_UINT8 ((sal_uInt8) 0xFF) |
124 |
#define SAL_MIN_INT16 ((sal_Int16) (-0x7FFF - 1)) |
178 |
#define SAL_MIN_INT16 ((sal_Int16) (-0x7FFF - 1)) |
125 |
#define SAL_MAX_INT16 ((sal_Int16) 0x7FFF) |
179 |
#define SAL_MAX_INT16 ((sal_Int16) 0x7FFF) |
126 |
#define SAL_MAX_UINT16 ((sal_uInt16) 0xFFFF) |
180 |
#define SAL_MAX_UINT16 ((sal_uInt16) 0xFFFF) |
127 |
#define SAL_MIN_INT32 ((sal_Int32) (-0x7FFFFFFF - 1)) |
181 |
#define SAL_MIN_INT32 ((sal_Int32) (-0x7FFFFFFF - 1)) |
128 |
#define SAL_MAX_INT32 ((sal_Int32) 0x7FFFFFFF) |
182 |
#define SAL_MAX_INT32 ((sal_Int32) 0x7FFFFFFF) |
129 |
#define SAL_MAX_UINT32 ((sal_uInt32) 0xFFFFFFFF) |
183 |
#define SAL_MAX_UINT32 ((sal_uInt32) 0xFFFFFFFF) |
130 |
#define SAL_MIN_INT64 ((sal_Int64) (-0x7FFFFFFFFFFFFFFF - 1)) |
184 |
#define SAL_MIN_INT64 ((sal_Int64) (-0x7FFFFFFFFFFFFFFF - 1)) |
131 |
#define SAL_MAX_INT64 ((sal_Int64) 0x7FFFFFFFFFFFFFFF) |
185 |
#define SAL_MAX_INT64 ((sal_Int64) 0x7FFFFFFFFFFFFFFF) |
132 |
#define SAL_MAX_UINT64 ((sal_uInt64) 0xFFFFFFFFFFFFFFFF) |
186 |
#define SAL_MAX_UINT64 ((sal_uInt64) 0xFFFFFFFFFFFFFFFF) |
133 |
|
|
|
134 |
typedef char sal_Char; |
135 |
typedef signed char sal_sChar; |
136 |
typedef unsigned char sal_uChar; |
137 |
#if defined(SAL_W32) |
138 |
typedef wchar_t sal_Unicode; |
139 |
#else |
140 |
#define SAL_UNICODE_NOTEQUAL_WCHAR_T |
141 |
typedef sal_uInt16 sal_Unicode; |
142 |
#endif |
143 |
|
187 |
|
144 |
typedef void* sal_Handle; |
188 |
#if defined(SAL_W32) || defined(SAL_OS2) || defined(SAL_UNX) |
145 |
typedef unsigned long sal_Size; |
189 |
# define SAL_MAX_ENUM 0x7fffffff |
146 |
|
|
|
147 |
#if defined(SAL_W32) || defined(SAL_OS2) || defined(SAL_UNX) || defined(SAL_MAC) |
148 |
#define SAL_MAX_ENUM 0x7fffffff |
149 |
#elif defined(SAL_W16) |
190 |
#elif defined(SAL_W16) |
150 |
#define SAL_MAX_ENUM 0x7fff |
191 |
# define SAL_MAX_ENUM 0x7fff |
151 |
#endif |
192 |
#endif |
152 |
|
193 |
|
153 |
#ifdef _MSC_VER |
194 |
#ifdef _MSC_VER |
Lines 162-171
Link Here
|
162 |
# define SAL_DLLEXPORT |
203 |
# define SAL_DLLEXPORT |
163 |
# define SAL_CALL |
204 |
# define SAL_CALL |
164 |
# define SAL_CALL_ELLIPSE |
205 |
# define SAL_CALL_ELLIPSE |
165 |
#elif defined SAL_MAC |
|
|
166 |
# define SAL_DLLEXPORT |
167 |
# define SAL_CALL |
168 |
# define SAL_CALL_ELLIPSE |
169 |
#else |
206 |
#else |
170 |
# error("unknown platform") |
207 |
# error("unknown platform") |
171 |
#endif |
208 |
#endif |
Lines 175-189
Link Here
|
175 |
a pure virtual function was called and thus slightly reduces code size. |
212 |
a pure virtual function was called and thus slightly reduces code size. |
176 |
*/ |
213 |
*/ |
177 |
#ifdef _MSC_VER |
214 |
#ifdef _MSC_VER |
178 |
#define SAL_NO_VTABLE __declspec(novtable) |
215 |
# define SAL_NO_VTABLE __declspec(novtable) |
179 |
#else |
216 |
#else |
180 |
#define SAL_NO_VTABLE |
217 |
# define SAL_NO_VTABLE |
181 |
#endif |
218 |
#endif |
182 |
|
219 |
|
183 |
#ifdef SAL_W32 |
220 |
#ifdef SAL_W32 |
184 |
#pragma pack(push, 8) |
221 |
# pragma pack(push, 8) |
185 |
#elif defined(SAL_OS2) |
222 |
#elif defined(SAL_OS2) |
186 |
#pragma pack(8) |
223 |
# pragma pack(8) |
187 |
#endif |
224 |
#endif |
188 |
|
225 |
|
189 |
/** This is the binary specification of a SAL sequence. |
226 |
/** This is the binary specification of a SAL sequence. |