20 #ifndef INCLUDED_SAL_TYPES_H 21 #define INCLUDED_SAL_TYPES_H 30 #if defined LIBO_INTERNAL_ONLY 31 #include "config_global.h" 39 # define sal_False ((sal_Bool)0) 40 # define sal_True ((sal_Bool)1) 46 #if SAL_TYPES_SIZEOFSHORT == 2 47 typedef signed short sal_Int16;
48 typedef unsigned short sal_uInt16;
50 #error "Could not find 16-bit type, add support for your architecture" 53 #if SAL_TYPES_SIZEOFLONG == 4 54 typedef signed long sal_Int32;
55 typedef unsigned long sal_uInt32;
56 #define SAL_PRIdINT32 "ld" 57 #define SAL_PRIuUINT32 "lu" 58 #define SAL_PRIxUINT32 "lx" 59 #define SAL_PRIXUINT32 "lX" 60 #elif SAL_TYPES_SIZEOFINT == 4 61 typedef signed int sal_Int32;
62 typedef unsigned int sal_uInt32;
63 #define SAL_PRIdINT32 "d" 64 #define SAL_PRIuUINT32 "u" 65 #define SAL_PRIxUINT32 "x" 66 #define SAL_PRIXUINT32 "X" 68 #error "Could not find 32-bit type, add support for your architecture" 72 typedef __int64 sal_Int64;
73 typedef unsigned __int64 sal_uInt64;
76 #define SAL_CONST_INT64(x) x##i64 77 #define SAL_CONST_UINT64(x) x##ui64 79 #define SAL_PRIdINT64 "I64d" 80 #define SAL_PRIuUINT64 "I64u" 81 #define SAL_PRIxUINT64 "I64x" 82 #define SAL_PRIXUINT64 "I64X" 83 #elif defined (__GNUC__) 84 #if SAL_TYPES_SIZEOFLONG == 8 85 typedef signed long int sal_Int64;
86 typedef unsigned long int sal_uInt64;
90 #define SAL_CONST_INT64(x) x##l 91 #define SAL_CONST_UINT64(x) x##ul 93 #define SAL_PRIdINT64 "ld" 94 #define SAL_PRIuUINT64 "lu" 95 #define SAL_PRIxUINT64 "lx" 96 #define SAL_PRIXUINT64 "lX" 97 #elif SAL_TYPES_SIZEOFLONGLONG == 8 98 typedef signed long long sal_Int64;
99 typedef unsigned long long sal_uInt64;
102 #define SAL_CONST_INT64(x) x##ll 103 #define SAL_CONST_UINT64(x) x##ull 105 #define SAL_PRIdINT64 "lld" 106 #define SAL_PRIuUINT64 "llu" 107 #define SAL_PRIxUINT64 "llx" 108 #define SAL_PRIXUINT64 "llX" 110 #error "Could not find 64-bit type, add support for your architecture" 113 #error "Please define the 64-bit types for your architecture/compiler in include/sal/types.h" 134 #if defined LIBO_INTERNAL_ONLY && defined __cplusplus 135 #define SAL_UNICODE_NOTEQUAL_WCHAR_T 137 #elif defined(_WIN32) 140 #define SAL_UNICODE_NOTEQUAL_WCHAR_T 147 #if SAL_TYPES_SIZEOFPOINTER == 4 148 typedef sal_uInt32 sal_Size;
149 typedef sal_Int32 sal_sSize;
150 #elif SAL_TYPES_SIZEOFPOINTER == 8 151 typedef sal_uInt64 sal_Size;
152 typedef sal_Int64 sal_sSize;
154 #error "Please make sure SAL_TYPES_SIZEOFPOINTER is defined for your architecture/compiler" 158 #if SAL_TYPES_SIZEOFPOINTER == 4 159 typedef sal_Int32 sal_PtrDiff;
160 #elif SAL_TYPES_SIZEOFPOINTER == 8 161 typedef sal_Int64 sal_PtrDiff;
163 #error "Please make sure SAL_TYPES_SIZEOFPOINTER is defined for your architecture/compiler" 168 #if defined(_MSC_VER) 169 #define SAL_PRI_SIZET "I" 170 #define SAL_PRI_PTRDIFFT "I" 172 #define SAL_PRI_SIZET "z" 173 #define SAL_PRI_PTRDIFFT "t" 179 #if SAL_TYPES_SIZEOFPOINTER == 4 180 typedef sal_Int32 sal_IntPtr;
181 typedef sal_uInt32 sal_uIntPtr;
182 #define SAL_PRIdINTPTR SAL_PRIdINT32 183 #define SAL_PRIuUINTPTR SAL_PRIuUINT32 184 #define SAL_PRIxUINTPTR SAL_PRIxUINT32 185 #define SAL_PRIXUINTPTR SAL_PRIXUINT32 186 #elif SAL_TYPES_SIZEOFPOINTER == 8 187 typedef sal_Int64 sal_IntPtr;
188 typedef sal_uInt64 sal_uIntPtr;
189 #define SAL_PRIdINTPTR SAL_PRIdINT64 190 #define SAL_PRIuUINTPTR SAL_PRIuUINT64 191 #define SAL_PRIxUINTPTR SAL_PRIxUINT64 192 #define SAL_PRIXUINTPTR SAL_PRIXUINT64 194 #error "Please make sure SAL_TYPES_SIZEOFPOINTER is defined for your architecture/compiler" 202 #define SAL_MIN_INT8 ((sal_Int8) (-0x7F - 1)) 203 #define SAL_MAX_INT8 ((sal_Int8) 0x7F) 204 #define SAL_MAX_UINT8 ((sal_uInt8) 0xFF) 205 #define SAL_MIN_INT16 ((sal_Int16) (-0x7FFF - 1)) 206 #define SAL_MAX_INT16 ((sal_Int16) 0x7FFF) 207 #define SAL_MAX_UINT16 ((sal_uInt16) 0xFFFF) 208 #define SAL_MIN_INT32 ((sal_Int32) (-0x7FFFFFFF - 1)) 209 #define SAL_MAX_INT32 ((sal_Int32) 0x7FFFFFFF) 210 #define SAL_MAX_UINT32 ((sal_uInt32) 0xFFFFFFFF) 211 #define SAL_MIN_INT64 ((sal_Int64) (SAL_CONST_INT64(-0x7FFFFFFFFFFFFFFF) - 1)) 212 #define SAL_MAX_INT64 ((sal_Int64) SAL_CONST_INT64(0x7FFFFFFFFFFFFFFF)) 213 #define SAL_MAX_UINT64 ((sal_uInt64) SAL_CONST_UINT64(0xFFFFFFFFFFFFFFFF)) 215 #if SAL_TYPES_SIZEOFPOINTER == 4 216 #define SAL_MAX_SSIZE SAL_MAX_INT32 217 #define SAL_MAX_SIZE SAL_MAX_UINT32 218 #elif SAL_TYPES_SIZEOFPOINTER == 8 219 #define SAL_MAX_SSIZE SAL_MAX_INT64 220 #define SAL_MAX_SIZE SAL_MAX_UINT64 223 #define SAL_MAX_ENUM 0x7fffffff 225 #if defined(_MSC_VER) 226 # define SAL_DLLPUBLIC_EXPORT __declspec(dllexport) 227 # define SAL_JNI_EXPORT __declspec(dllexport) 228 # define SAL_DLLPUBLIC_IMPORT __declspec(dllimport) 229 # define SAL_DLLPRIVATE 230 # define SAL_DLLPUBLIC_TEMPLATE 231 # define SAL_DLLPUBLIC_RTTI 232 # define SAL_CALL __cdecl 233 #elif defined SAL_UNX 234 # if defined(__GNUC__) 235 # if defined(DISABLE_DYNLOADING) 236 # define SAL_DLLPUBLIC_EXPORT __attribute__ ((visibility("hidden"))) 237 # define SAL_JNI_EXPORT __attribute__ ((visibility("default"))) 238 # define SAL_DLLPUBLIC_IMPORT __attribute__ ((visibility("hidden"))) 239 # define SAL_DLLPRIVATE __attribute__ ((visibility("hidden"))) 240 # define SAL_DLLPUBLIC_TEMPLATE __attribute__ ((visibility("hidden"))) 241 # define SAL_DLLPUBLIC_RTTI 243 # define SAL_DLLPUBLIC_EXPORT __attribute__ ((visibility("default"))) 244 # define SAL_JNI_EXPORT __attribute__ ((visibility("default"))) 245 # define SAL_DLLPUBLIC_IMPORT __attribute__ ((visibility("default"))) 246 # define SAL_DLLPRIVATE __attribute__ ((visibility("hidden"))) 247 # define SAL_DLLPUBLIC_TEMPLATE __attribute__ ((visibility("default"))) 248 # if defined __clang__ 249 # if __has_attribute(type_visibility) 250 # define SAL_DLLPUBLIC_RTTI __attribute__ ((type_visibility("default"))) 252 # define SAL_DLLPUBLIC_RTTI __attribute__ ((visibility("default"))) 255 # define SAL_DLLPUBLIC_RTTI 259 # define SAL_DLLPUBLIC_EXPORT 260 # define SAL_JNI_EXPORT 261 # define SAL_DLLPUBLIC_IMPORT 262 # define SAL_DLLPRIVATE 263 # define SAL_DLLPUBLIC_TEMPLATE 264 # define SAL_DLLPUBLIC_RTTI 268 # error("unknown platform") 277 #if defined(__GNUC__) 278 # if defined(DISABLE_DYNLOADING) 279 # define SAL_EXCEPTION_DLLPUBLIC_EXPORT __attribute__((visibility("default"))) 281 # define SAL_EXCEPTION_DLLPUBLIC_EXPORT SAL_DLLPUBLIC_EXPORT 283 # define SAL_EXCEPTION_DLLPRIVATE SAL_DLLPRIVATE 285 # define SAL_EXCEPTION_DLLPUBLIC_EXPORT 286 # define SAL_EXCEPTION_DLLPRIVATE 295 #if (defined __GNUC__ \ 296 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1))) \ 298 # define SAL_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) 300 # define SAL_WARN_UNUSED_RESULT 308 # define SAL_NO_VTABLE __declspec(novtable) 310 # define SAL_NO_VTABLE 314 # pragma pack(push, 8) 332 #define SAL_SEQUENCE_HEADER_SIZE ((sal_Size) offsetof(sal_Sequence,elements)) 338 #if defined __cplusplus 344 #define SAL_THROW_EXTERN_C() throw () 350 #if defined(LIBO_INTERNAL_ONLY) && defined(__COVERITY__) 351 # define COVERITY_NOEXCEPT_FALSE noexcept(false) 353 # define COVERITY_NOEXCEPT_FALSE 358 #define SAL_THROW_EXTERN_C() 375 namespace com {
namespace sun {
namespace star { } } }
381 namespace css = ::com::sun::star;
391 #if defined LIBO_INTERNAL_ONLY 392 #define SAL_DELETED_FUNCTION = delete 394 #define SAL_DELETED_FUNCTION 404 #if defined LIBO_INTERNAL_ONLY 405 #define SAL_OVERRIDE override 416 #if defined LIBO_INTERNAL_ONLY 417 #define SAL_FINAL final 422 #if defined LIBO_INTERNAL_ONLY 423 #if defined __clang__ 424 #define SAL_FALLTHROUGH [[clang::fallthrough]] 425 #elif defined __GNUC__ && __GNUC__ >= 7 426 #define SAL_FALLTHROUGH [[fallthrough]] 428 #define SAL_FALLTHROUGH 450 return static_cast< T1
>(n);
469 #define SAL_INT_CAST(type, expr) ((type) (expr)) 478 #if HAVE_GCC_DEPRECATED_MESSAGE 479 # define SAL_DEPRECATED(message) __attribute__((deprecated(message))) 480 #elif defined __GNUC__ || defined __clang__ 481 # define SAL_DEPRECATED(message) __attribute__((deprecated)) 482 #elif defined(_MSC_VER) 483 # define SAL_DEPRECATED(message) __declspec(deprecated(message)) 485 # define SAL_DEPRECATED(message) 499 #ifdef LIBO_INTERNAL_ONLY 500 # define SAL_DEPRECATED_INTERNAL(message) 502 # define SAL_DEPRECATED_INTERNAL(message) SAL_DEPRECATED(message) 512 #if HAVE_GCC_PRAGMA_OPERATOR 513 #define SAL_WNODEPRECATED_DECLARATIONS_PUSH \ 514 _Pragma(SAL_STRINGIFY_ARG(GCC diagnostic push)) \ 515 _Pragma(SAL_STRINGIFY_ARG(GCC diagnostic ignored "-Wdeprecated-declarations")) 516 #define SAL_WNODEPRECATED_DECLARATIONS_POP \ 517 _Pragma(SAL_STRINGIFY_ARG(GCC diagnostic pop)) 519 # define SAL_WNODEPRECATED_DECLARATIONS_PUSH 520 # define SAL_WNODEPRECATED_DECLARATIONS_POP 540 #define SAL_WNOUNREACHABLE_CODE_PUSH \ 541 __pragma(warning(push)) \ 542 __pragma(warning(disable:4702)) \ 543 __pragma(warning(disable:4722)) 544 #define SAL_WNOUNREACHABLE_CODE_POP \ 545 __pragma(warning(pop)) 548 #define SAL_WNOUNREACHABLE_CODE_PUSH 549 #define SAL_WNOUNREACHABLE_CODE_POP 575 #if defined __cplusplus 576 #if defined __GNUC__ || defined __clang__ 577 #define SAL_UNUSED_PARAMETER __attribute__ ((unused)) 579 #define SAL_UNUSED_PARAMETER 595 #if HAVE_GCC_ATTRIBUTE_WARN_UNUSED 596 #define SAL_WARN_UNUSED __attribute__((warn_unused)) 598 #define SAL_WARN_UNUSED 603 #if defined __GNUC__ || defined __clang__ 605 # define SAL_DETAIL_BOOLEAN_EXPR(expr) \ 607 int sal_boolean_var_; \ 609 sal_boolean_var_ = 1; \ 611 sal_boolean_var_ = 0; \ 625 # define SAL_LIKELY(expr) __builtin_expect(SAL_DETAIL_BOOLEAN_EXPR((expr)), 1) 637 # define SAL_UNLIKELY(expr) __builtin_expect(SAL_DETAIL_BOOLEAN_EXPR((expr)), 0) 650 # define SAL_HOT __attribute__((hot)) 665 # define SAL_COLD __attribute__((cold)) 667 # define SAL_LIKELY(expr) (expr) 668 # define SAL_UNLIKELY(expr) (expr) 685 #ifndef __has_attribute 686 #define __has_attribute(x) 0 689 #if defined LIBO_INTERNAL_ONLY && ((defined __GNUC__ && __GNUC__ > 4) || (defined __clang__ && __has_attribute(returns_nonnull))) 690 #define SAL_RETURNS_NONNULL __attribute__((returns_nonnull)) 692 #define SAL_RETURNS_NONNULL 696 #endif // INCLUDED_SAL_TYPES_H void * sal_Handle
Definition: types.h:144
signed char sal_Int8
Definition: types.h:43
struct _sal_Sequence sal_Sequence
This is the binary specification of a SAL sequence.
signed char sal_sChar
A legacy synonym for signed char.
Definition: types.h:126
sal_uInt16 sal_Unicode
Definition: types.h:141
unsigned char sal_Bool
Definition: types.h:38
unsigned char sal_uChar
A legacy synonym for unsigned char.
Definition: types.h:132
__sal_NoAcquire
Definition: types.h:368
char elements[1]
elements array
Definition: types.h:329
definition of a no acquire enum for ctors
Definition: types.h:372
T1 static_int_cast(T2 n)
A static_cast between integral types, to avoid C++ compiler warnings.
Definition: types.h:449
char sal_Char
A legacy synonym for char.
Definition: types.h:120
sal_Int32 nRefCount
reference count of sequence
Definition: types.h:323
sal_Int32 nElements
element count
Definition: types.h:326
This is the binary specification of a SAL sequence.
Definition: types.h:319
unsigned char sal_uInt8
Definition: types.h:44