Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #ifndef _SAL_TYPES_H_
21 : #define _SAL_TYPES_H_
22 :
23 : #include <sal/config.h>
24 : #include <sal/macros.h>
25 :
26 : #if defined LIBO_INTERNAL_ONLY
27 : #include <config_global.h>
28 : #endif
29 :
30 : /* Grab __SIZEOFxxx constants from typesconfig tool on Unix */
31 : #if defined UNX
32 : #include <sal/typesizes.h>
33 : #elif defined(WNT)
34 : /* FIXME: autogeneration of type sizes on Win32/Win64? */
35 : #define SAL_TYPES_ALIGNMENT2 1
36 : #define SAL_TYPES_ALIGNMENT4 1
37 : #define SAL_TYPES_ALIGNMENT8 1
38 : #define SAL_TYPES_SIZEOFSHORT 2
39 : #define SAL_TYPES_SIZEOFINT 4
40 : #define SAL_TYPES_SIZEOFLONG 4
41 : #define SAL_TYPES_SIZEOFLONGLONG 8
42 : #ifdef _WIN64
43 : #define SAL_TYPES_SIZEOFPOINTER 8
44 : #else
45 : #define SAL_TYPES_SIZEOFPOINTER 4
46 : #endif
47 : #endif
48 :
49 : #ifdef __cplusplus
50 : extern "C" {
51 : #endif
52 :
53 : /********************************************************************************/
54 : /* Data types
55 : */
56 :
57 : /* Boolean */
58 : typedef unsigned char sal_Bool;
59 : # define sal_False ((sal_Bool)0)
60 : # define sal_True ((sal_Bool)1)
61 :
62 : /* char is assumed to always be 1 byte long */
63 : typedef signed char sal_Int8;
64 : typedef unsigned char sal_uInt8;
65 :
66 : #if SAL_TYPES_SIZEOFSHORT == 2
67 : typedef signed short sal_Int16;
68 : typedef unsigned short sal_uInt16;
69 : #else
70 : #error "Could not find 16-bit type, add support for your architecture"
71 : #endif
72 :
73 : #if SAL_TYPES_SIZEOFLONG == 4
74 : typedef signed long sal_Int32;
75 : typedef unsigned long sal_uInt32;
76 : #define SAL_PRIdINT32 "ld"
77 : #define SAL_PRIuUINT32 "lu"
78 : #define SAL_PRIxUINT32 "lx"
79 : #define SAL_PRIXUINT32 "lX"
80 : #elif SAL_TYPES_SIZEOFINT == 4
81 : typedef signed int sal_Int32;
82 : typedef unsigned int sal_uInt32;
83 : #define SAL_PRIdINT32 "d"
84 : #define SAL_PRIuUINT32 "u"
85 : #define SAL_PRIxUINT32 "x"
86 : #define SAL_PRIXUINT32 "X"
87 : #else
88 : #error "Could not find 32-bit type, add support for your architecture"
89 : #endif
90 :
91 : #ifdef _MSC_VER
92 : typedef __int64 sal_Int64;
93 : typedef unsigned __int64 sal_uInt64;
94 :
95 : /* The following are macros that will add the 64 bit constant suffix. */
96 : #define SAL_CONST_INT64(x) x##i64
97 : #define SAL_CONST_UINT64(x) x##ui64
98 :
99 : #define SAL_PRIdINT64 "I64d"
100 : #define SAL_PRIuUINT64 "I64u"
101 : #define SAL_PRIxUINT64 "I64x"
102 : #define SAL_PRIXUINT64 "I64X"
103 : #elif defined(__SUNPRO_CC) || defined(__SUNPRO_C) || defined (__GNUC__) || defined (sgi)
104 : #if SAL_TYPES_SIZEOFLONG == 8
105 : typedef signed long int sal_Int64;
106 : typedef unsigned long int sal_uInt64;
107 :
108 :
109 : /* The following are macros that will add the 64 bit constant suffix. */
110 : #define SAL_CONST_INT64(x) x##l
111 : #define SAL_CONST_UINT64(x) x##ul
112 :
113 : #define SAL_PRIdINT64 "ld"
114 : #define SAL_PRIuUINT64 "lu"
115 : #define SAL_PRIxUINT64 "lx"
116 : #define SAL_PRIXUINT64 "lX"
117 : #elif SAL_TYPES_SIZEOFLONGLONG == 8
118 : typedef signed long long sal_Int64;
119 : typedef unsigned long long sal_uInt64;
120 :
121 : /* The following are macros that will add the 64 bit constant suffix. */
122 : #define SAL_CONST_INT64(x) x##ll
123 : #define SAL_CONST_UINT64(x) x##ull
124 :
125 : #ifdef __MINGW32__
126 : #define SAL_PRIdINT64 "I64d"
127 : #define SAL_PRIuUINT64 "I64u"
128 : #define SAL_PRIxUINT64 "I64x"
129 : #define SAL_PRIXUINT64 "I64X"
130 : #else
131 : #define SAL_PRIdINT64 "lld"
132 : #define SAL_PRIuUINT64 "llu"
133 : #define SAL_PRIxUINT64 "llx"
134 : #define SAL_PRIXUINT64 "llX"
135 : #endif
136 : #else
137 : #error "Could not find 64-bit type, add support for your architecture"
138 : #endif
139 : #else
140 : #error "Please define the 64-bit types for your architecture/compiler in sal/inc/sal/types.h"
141 : #endif
142 :
143 : typedef char sal_Char;
144 : typedef signed char sal_sChar;
145 : typedef unsigned char sal_uChar;
146 :
147 : #if ( defined(SAL_W32) && !defined(__MINGW32__) )
148 : // http://msdn.microsoft.com/en-us/library/s3f49ktz%28v=vs.80%29.aspx
149 : // "By default wchar_t is a typedef for unsigned short."
150 : // But MinGW has a native wchar_t, and on many places, we cannot deal with
151 : // that, so sal_Unicode has to be explicitly typedef'd as sal_uInt16 there.
152 : typedef wchar_t sal_Unicode;
153 : #else
154 : #define SAL_UNICODE_NOTEQUAL_WCHAR_T
155 : typedef sal_uInt16 sal_Unicode;
156 : #endif
157 :
158 : typedef void * sal_Handle;
159 :
160 : /* sal_Size should currently be the native width of the platform */
161 : #if SAL_TYPES_SIZEOFPOINTER == 4
162 : typedef sal_uInt32 sal_Size;
163 : typedef sal_Int32 sal_sSize;
164 : #elif SAL_TYPES_SIZEOFPOINTER == 8
165 : typedef sal_uInt64 sal_Size;
166 : typedef sal_Int64 sal_sSize;
167 : #else
168 : #error "Please make sure SAL_TYPES_SIZEOFPOINTER is defined for your architecture/compiler"
169 : #endif
170 :
171 : /* sal_PtrDiff holds the result of a pointer subtraction */
172 : #if SAL_TYPES_SIZEOFPOINTER == 4
173 : typedef sal_Int32 sal_PtrDiff;
174 : #elif SAL_TYPES_SIZEOFPOINTER == 8
175 : typedef sal_Int64 sal_PtrDiff;
176 : #else
177 : #error "Please make sure SAL_TYPES_SIZEOFPOINTER is defined for your architecture/compiler"
178 : #endif
179 :
180 : /* printf-style conversion specification length modifiers for size_t and
181 : ptrdiff_t (most platforms support C99, MSC has its own extension) */
182 : #if defined(_MSC_VER) || defined(__MINGW32__)
183 : #define SAL_PRI_SIZET "I"
184 : #define SAL_PRI_PTRDIFFT "I"
185 : #else
186 : #define SAL_PRI_SIZET "z"
187 : #define SAL_PRI_PTRDIFFT "t"
188 : #endif
189 :
190 : /* sal_IntPtr, sal_uIntPtr are integer types designed to hold pointers so that any valid
191 : * pointer to void can be converted to this type and back to a pointer to void and the
192 : * result will compare to the original pointer */
193 : #if SAL_TYPES_SIZEOFPOINTER == 4
194 : typedef sal_Int32 sal_IntPtr;
195 : typedef sal_uInt32 sal_uIntPtr;
196 : #define SAL_PRIdINTPTR SAL_PRIdINT32
197 : #define SAL_PRIuUINTPTR SAL_PRIuUINT32
198 : #define SAL_PRIxUINTPTR SAL_PRIxUINT32
199 : #define SAL_PRIXUINTPTR SAL_PRIXUINT32
200 : #elif SAL_TYPES_SIZEOFPOINTER == 8
201 : typedef sal_Int64 sal_IntPtr;
202 : typedef sal_uInt64 sal_uIntPtr;
203 : #define SAL_PRIdINTPTR SAL_PRIdINT64
204 : #define SAL_PRIuUINTPTR SAL_PRIuUINT64
205 : #define SAL_PRIxUINTPTR SAL_PRIxUINT64
206 : #define SAL_PRIXUINTPTR SAL_PRIXUINT64
207 : #else
208 : #error "Please make sure SAL_TYPES_SIZEOFPOINTER is defined for your architecture/compiler"
209 : #endif
210 :
211 : /********************************************************************************/
212 : /* Useful defines
213 : */
214 :
215 : /* The following SAL_MIN_INTn defines codify the assumption that the signed
216 : * sal_Int types use two's complement representation. Defining them as
217 : * "-0x7F... - 1" instead of as "-0x80..." prevents warnings about applying the
218 : * unary minus operator to unsigned quantities.
219 : */
220 : #define SAL_MIN_INT8 ((sal_Int8) (-0x7F - 1))
221 : #define SAL_MAX_INT8 ((sal_Int8) 0x7F)
222 : #define SAL_MAX_UINT8 ((sal_uInt8) 0xFF)
223 : #define SAL_MIN_INT16 ((sal_Int16) (-0x7FFF - 1))
224 : #define SAL_MAX_INT16 ((sal_Int16) 0x7FFF)
225 : #define SAL_MAX_UINT16 ((sal_uInt16) 0xFFFF)
226 : #define SAL_MIN_INT32 ((sal_Int32) (-0x7FFFFFFF - 1))
227 : #define SAL_MAX_INT32 ((sal_Int32) 0x7FFFFFFF)
228 : #define SAL_MAX_UINT32 ((sal_uInt32) 0xFFFFFFFF)
229 : #define SAL_MIN_INT64 ((sal_Int64) (SAL_CONST_INT64(-0x7FFFFFFFFFFFFFFF) - 1))
230 : #define SAL_MAX_INT64 ((sal_Int64) SAL_CONST_INT64(0x7FFFFFFFFFFFFFFF))
231 : #define SAL_MAX_UINT64 ((sal_uInt64) SAL_CONST_UINT64(0xFFFFFFFFFFFFFFFF))
232 :
233 : #if SAL_TYPES_SIZEOFLONG == 4
234 : #define SAL_MAX_SSIZE SAL_MAX_INT32
235 : #define SAL_MAX_SIZE SAL_MAX_UINT32
236 : #elif SAL_TYPES_SIZEOFLONG == 8
237 : #define SAL_MAX_SSIZE SAL_MAX_INT64
238 : #define SAL_MAX_SIZE SAL_MAX_UINT64
239 : #endif
240 :
241 : #if defined(SAL_W32) || defined(SAL_UNX)
242 : # define SAL_MAX_ENUM 0x7fffffff
243 : #endif
244 :
245 : #if defined(_MSC_VER) || defined(__MINGW32__)
246 : # define SAL_DLLPUBLIC_EXPORT __declspec(dllexport)
247 : # define SAL_JNI_EXPORT __declspec(dllexport)
248 : #if defined(_MSC_VER)
249 : # define SAL_DLLPUBLIC_IMPORT __declspec(dllimport)
250 : #else
251 : # define SAL_DLLPUBLIC_IMPORT
252 : #endif // defined(_MSC_VER)
253 : # define SAL_DLLPRIVATE
254 : # define SAL_DLLPUBLIC_TEMPLATE
255 : # define SAL_CALL __cdecl
256 : # define SAL_CALL_ELLIPSE __cdecl
257 : #elif defined SAL_UNX
258 : # if defined(__SUNPRO_CC) && (__SUNPRO_CC >= 0x550)
259 : # define SAL_DLLPUBLIC_EXPORT __global
260 : # define SAL_JNI_EXPORT __global
261 : # define SAL_DLLPUBLIC_IMPORT
262 : # define SAL_DLLPRIVATE __hidden
263 : # define SAL_DLLPUBLIC_TEMPLATE
264 : # elif defined(__SUNPRO_C ) && (__SUNPRO_C >= 0x550)
265 : # define SAL_DLLPUBLIC_EXPORT __global
266 : # define SAL_JNI_EXPORT __global
267 : # define SAL_DLLPUBLIC_IMPORT
268 : # define SAL_DLLPRIVATE __hidden
269 : # define SAL_DLLPUBLIC_TEMPLATE
270 : # elif defined(__GNUC__) && defined(HAVE_GCC_VISIBILITY_FEATURE)
271 : # if defined(DISABLE_DYNLOADING)
272 : # define SAL_DLLPUBLIC_EXPORT __attribute__ ((visibility("hidden")))
273 : # define SAL_JNI_EXPORT __attribute__ ((visibility("default")))
274 : # define SAL_DLLPUBLIC_IMPORT __attribute__ ((visibility("hidden")))
275 : # define SAL_DLLPRIVATE __attribute__ ((visibility("hidden")))
276 : # define SAL_DLLPUBLIC_TEMPLATE __attribute__ ((visibility("hidden")))
277 : # else
278 : # define SAL_DLLPUBLIC_EXPORT __attribute__ ((visibility("default")))
279 : # define SAL_JNI_EXPORT __attribute__ ((visibility("default")))
280 : # define SAL_DLLPUBLIC_IMPORT __attribute__ ((visibility("default")))
281 : # define SAL_DLLPRIVATE __attribute__ ((visibility("hidden")))
282 : # define SAL_DLLPUBLIC_TEMPLATE __attribute__ ((visibility("default")))
283 : # endif
284 : # else
285 : # define SAL_DLLPUBLIC_EXPORT
286 : # define SAL_JNI_EXPORT
287 : # define SAL_DLLPUBLIC_IMPORT
288 : # define SAL_DLLPRIVATE
289 : # define SAL_DLLPUBLIC_TEMPLATE
290 : # endif
291 : # define SAL_CALL
292 : # define SAL_CALL_ELLIPSE
293 : #else
294 : # error("unknown platform")
295 : #endif
296 :
297 : /**
298 : Exporting the symbols necessary for exception handling on GCC.
299 :
300 : These macros are used for inline declarations of exception classes, as in
301 : rtl/malformeduriexception.hxx.
302 : */
303 : #if defined(__GNUC__) && ! defined(__MINGW32__)
304 : #define SAL_EXCEPTION_DLLPUBLIC_EXPORT SAL_DLLPUBLIC_EXPORT
305 : #define SAL_EXCEPTION_DLLPRIVATE SAL_DLLPRIVATE
306 : #else
307 : #define SAL_EXCEPTION_DLLPUBLIC_EXPORT
308 : #define SAL_EXCEPTION_DLLPRIVATE
309 : #endif
310 :
311 : /** Use this as markup for functions and methods whose return value must be
312 : checked.
313 :
314 : Compilers that support a construct of this nature will emit a compile
315 : time warning on unchecked return value.
316 : */
317 : #if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1))
318 : # define SAL_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
319 : #else
320 : # define SAL_WARN_UNUSED_RESULT
321 : #endif
322 :
323 : /** Use this for pure virtual classes, e.g. class SAL_NO_VTABLE Foo { ...
324 : This hinders the compiler from setting a generic vtable stating that
325 : a pure virtual function was called and thus slightly reduces code size.
326 : */
327 : #ifdef _MSC_VER
328 : # define SAL_NO_VTABLE __declspec(novtable)
329 : #else
330 : # define SAL_NO_VTABLE
331 : #endif
332 :
333 : #ifdef SAL_W32
334 : # pragma pack(push, 8)
335 : #endif
336 :
337 : /** This is the binary specification of a SAL sequence.
338 : <br>
339 : */
340 : typedef struct _sal_Sequence
341 : {
342 : /** reference count of sequence<br>
343 : */
344 : sal_Int32 nRefCount;
345 : /** element count<br>
346 : */
347 : sal_Int32 nElements;
348 : /** elements array<br>
349 : */
350 : char elements[1];
351 : } sal_Sequence;
352 :
353 : #define SAL_SEQUENCE_HEADER_SIZE ((sal_Size)&((sal_Sequence *)0)->elements)
354 :
355 : #if defined( SAL_W32)
356 : #pragma pack(pop)
357 : #endif
358 :
359 : /** Definition of function throw clause macros. These have been introduced
360 : to reduce code size by balancing out compiler bugs.
361 :
362 : These macros are ONLY for function declarations,
363 : use common C++ throw statement for throwing exceptions, e.g.
364 : throw RuntimeException();
365 :
366 : SAL_THROW() should be used for all C++ functions, e.g. SAL_THROW(())
367 : SAL_THROW_EXTERN_C() should be used for all C functions
368 : */
369 : #ifdef __cplusplus
370 : #if defined(__GNUC__) || defined(__SUNPRO_CC) || defined(__sgi)
371 : #define SAL_THROW( exc )
372 : #else /* MSVC, all other */
373 : #define SAL_THROW( exc ) throw exc
374 : #endif /* __GNUC__, __SUNPRO_CC */
375 : #define SAL_THROW_EXTERN_C() throw ()
376 : #else /* ! __cplusplus */
377 : /* SAL_THROW() must not be used in C headers, only SAL_THROW_EXTERN_C() is defined */
378 : #define SAL_THROW_EXTERN_C()
379 : #endif
380 :
381 : #ifdef __cplusplus
382 : }
383 : #endif /* __cplusplus */
384 :
385 : #ifdef __cplusplus
386 :
387 : enum __sal_NoAcquire
388 : {
389 : /** definition of a no acquire enum for ctors
390 : */
391 : SAL_NO_ACQUIRE
392 : };
393 :
394 : namespace com { namespace sun { namespace star { } } }
395 :
396 : /** short-circuit extra-verbose API namespaces
397 :
398 : @since LibreOffice 4.0
399 : */
400 : namespace css = ::com::sun::star;
401 :
402 : /** C++11 "= delete" feature.
403 :
404 : With HAVE_CXX11_DELETE, calling a deleted function will cause a compile-time
405 : error, while otherwise it will only cause a link-time error as the declared
406 : function is not defined.
407 :
408 : @since LibreOffice 4.1
409 : */
410 : #if defined HAVE_CXX11_DELETE
411 : #define SAL_DELETED_FUNCTION = delete
412 : #else
413 : #define SAL_DELETED_FUNCTION
414 : #endif
415 :
416 : #endif /* __cplusplus */
417 :
418 : #ifdef __cplusplus
419 :
420 : namespace sal {
421 :
422 : /**
423 : A static_cast between integral types, to avoid C++ compiler warnings.
424 :
425 : In C++ source code, use sal::static_int_cast<T>(n) instead of
426 : static_cast<T>(n) whenever a compiler warning about integral type problems
427 : shall be silenced. That way, source code that needs to be modified when the
428 : type of any of the expressions involved in the compiler warning is changed
429 : can be found more easily.
430 :
431 : Both template arguments T1 and T2 must be integral types.
432 : */
433 74778020 : template< typename T1, typename T2 > inline T1 static_int_cast(T2 n) {
434 74778020 : return static_cast< T1 >(n);
435 : }
436 :
437 : }
438 :
439 : #else /* __cplusplus */
440 :
441 : /**
442 : A cast between integer types, to avoid C compiler warnings.
443 :
444 : In C source code, use SAL_INT_CAST(type, expr) instead of ((type) (expr))
445 : whenever a compiler warning about integer type problems shall be silenced.
446 : That way, source code that needs to be modified when the type of any of the
447 : expressions involved in the compiler warning is changed can be found more
448 : easily.
449 :
450 : The argument 'type' must be an integer type and the argument 'expr' must be
451 : an integer expression. Both arguments are evaluated exactly once.
452 : */
453 : #define SAL_INT_CAST(type, expr) ((type) (expr))
454 :
455 : #endif /* __cplusplus */
456 :
457 : /**
458 : Use as follows:
459 : SAL_DEPRECATED("Dont use, its evil.") void doit(int nPara);
460 : */
461 :
462 : #if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5))
463 : # define SAL_DEPRECATED(message) __attribute__((deprecated(message)))
464 : #elif (__GNUC__)
465 : # define SAL_DEPRECATED(message) __attribute__((deprecated))
466 : #elif defined(_MSC_VER)
467 : # define SAL_DEPRECATED(message) __declspec(deprecated(message))
468 : #else
469 : # define SAL_DEPRECATED(message)
470 : #endif
471 :
472 : /**
473 : This macro is used to tag interfaces that are deprecated for both
474 : internal and external API users, but where we are still writing
475 : out the internal usage. Ultimately these should be replaced by
476 : SAL_DEPRECATED, and then removed.
477 :
478 : Use as follows:
479 : SAL_DEPRECATED_INTERNAL("Dont use, its evil.") void doit(int nPara);
480 : */
481 : #ifdef LIBO_INTERNAL_ONLY
482 : # define SAL_DEPRECATED_INTERNAL(message)
483 : #else
484 : # define SAL_DEPRECATED_INTERNAL(message) SAL_DEPRECATED(message)
485 : #endif
486 :
487 : /**
488 : Use as follows:
489 : SAL_WNODEPRECATED_DECLARATIONS_PUSH
490 : \::std::auto_ptr<X> ...
491 : SAL_WNODEPRECATED_DECLARATIONS_POP
492 : */
493 :
494 : #if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
495 : #define SAL_WNODEPRECATED_DECLARATIONS_PUSH \
496 : _Pragma(SAL_STRINGIFY_ARG(GCC diagnostic push)) \
497 : _Pragma(SAL_STRINGIFY_ARG(GCC diagnostic ignored "-Wdeprecated-declarations"))
498 : #define SAL_WNODEPRECATED_DECLARATIONS_POP \
499 : _Pragma(SAL_STRINGIFY_ARG(GCC diagnostic pop))
500 : #else
501 : # define SAL_WNODEPRECATED_DECLARATIONS_PUSH
502 : # define SAL_WNODEPRECATED_DECLARATIONS_POP
503 : #endif
504 :
505 : /** Annotate unused but required C++ function parameters.
506 :
507 : An unused parameter is required if the function needs to adhere to a given
508 : type (e.g., if its address is assigned to a function pointer of a specific
509 : type, or if it is called from template code). This annotation helps static
510 : analysis tools suppress false warnings. In the case of virtual functions
511 : (where unused required parameters are common, too), the annotation is not
512 : required (as static analysis tools can themselves derive the information
513 : whether a function is virtual).
514 :
515 : Use the annotation in function definitions like
516 :
517 : void f(SAL_UNUSED_PARAMETER int) {}
518 :
519 : C does not allow unnamed parameters, anyway, so a function definition like
520 : the above needs to be written there as
521 :
522 : void f(int dummy) { (void) dummy; / * avoid warnings * / }
523 :
524 : without a SAL_UNUSED_PARAMETER annotation.
525 :
526 : @since LibreOffice 3.6
527 : */
528 : #if defined __cplusplus
529 : #if defined __GNUC__
530 : #define SAL_UNUSED_PARAMETER __attribute__ ((unused))
531 : #else
532 : #define SAL_UNUSED_PARAMETER
533 : #endif
534 : #endif
535 :
536 : /**
537 :
538 : Annotate classes where a compiler should warn if an instance is unused.
539 :
540 : The compiler cannot warn about unused instances if they have non-trivial
541 : or external constructors or destructors. Classes marked with SAL_WARN_UNUSED
542 : will be warned about.
543 :
544 : Currently implemented by a Clang compiler plugin.
545 :
546 : @since LibreOffice 4.0
547 :
548 : */
549 :
550 : #if defined __clang__
551 : #define SAL_WARN_UNUSED __attribute__((annotate("lo_warn_unused")))
552 : #else
553 : #define SAL_WARN_UNUSED
554 : #endif
555 :
556 : #endif /*_SAL_TYPES_H_ */
557 :
558 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|