FreeRDP
Loading...
Searching...
No Matches
platform.h
1
20#ifndef WINPR_PLATFORM_H
21#define WINPR_PLATFORM_H
22
23#include <stdlib.h>
24
25/* MSVC only defines _Pragma if you compile with /std:c11 with no extensions
26 * see
27 * https://learn.microsoft.com/en-us/cpp/preprocessor/pragma-directives-and-the-pragma-keyword?view=msvc-170#the-pragma-preprocessing-operator
28 */
29#if !defined(_MSC_VER)
30#define WINPR_DO_PRAGMA(x) _Pragma(#x)
31#else
32#define WINPR_DO_PRAGMA(x) __pragma(#x)
33#endif
34
35/* COVERITY_BUILD must be defined by build system */
36#if !defined(COVERITY_BUILD)
37#define WINPR_DO_COVERITY_PRAGMA(x)
38#else
39#define WINPR_DO_COVERITY_PRAGMA(x) WINPR_DO_PRAGMA(x)
40#endif
41
42#if defined(__GNUC__)
43#define WINPR_PRAGMA_WARNING(msg) WINPR_DO_PRAGMA(GCC warning #msg)
44#elif defined(__clang__)
45#define WINPR_PRAGMA_WARNING(msg) WINPR_DO_PRAGMA(GCC warning #msg)
46#elif defined(_MSC_VER) && (_MSC_VER >= 1920)
47#define WINPR_PRAGMA_WARNING(msg) WINPR_DO_PRAGMA(message \x28 #msg \x29)
48#else
49#define WINPR_PRAGMA_WARNING(msg)
50#endif
51
52// C99 related macros
53#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
54#define WINPR_RESTRICT restrict
55#elif defined(_MSC_VER) && _MSC_VER >= 1900
56#define WINPR_RESTRICT __restrict
57#else
58#define WINPR_RESTRICT
59#endif
60
61// C23 related macros
62#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 202311L)
63#define WINPR_FALLTHROUGH \
64 (void)0; \
65 [[fallthrough]];
66#elif defined(__clang__)
67#define WINPR_FALLTHROUGH \
68 (void)0; \
69 __attribute__((fallthrough));
70#elif defined(__GNUC__) && (__GNUC__ >= 7)
71#define WINPR_FALLTHROUGH \
72 (void)0; \
73 __attribute__((fallthrough));
74#else
75#define WINPR_FALLTHROUGH (void)0;
76#endif
77
78#if defined(__clang__)
79#define WINPR_PRAGMA_DIAG_PUSH WINPR_DO_PRAGMA(clang diagnostic push)
80#define WINPR_PRAGMA_DIAG_IGNORED_OVERLENGTH_STRINGS \
81 WINPR_DO_PRAGMA(clang diagnostic ignored "-Woverlength-strings")
82#define WINPR_PRAGMA_DIAG_IGNORED_QUALIFIERS
83/* unsupported by clang WINPR_DO_PRAGMA(clang diagnostic ignored "-Wdiscarded-qualifiers") */
84#define WINPR_PRAGMA_DIAG_IGNORED_PEDANTIC WINPR_DO_PRAGMA(clang diagnostic ignored "-Wpedantic")
85#define WINPR_PRAGMA_DIAG_IGNORED_MISSING_PROTOTYPES \
86 WINPR_DO_PRAGMA(clang diagnostic ignored "-Wmissing-prototypes")
87#define WINPR_PRAGMA_DIAG_IGNORED_STRICT_PROTOTYPES \
88 WINPR_DO_PRAGMA(clang diagnostic ignored "-Wstrict-prototypes")
89#define WINPR_PRAGMA_DIAG_IGNORED_RESERVED_ID_MACRO \
90 WINPR_DO_PRAGMA(clang diagnostic ignored "-Wreserved-id-macro")
91#define WINPR_PRAGMA_DIAG_IGNORED_UNUSED_MACRO \
92 WINPR_DO_PRAGMA(clang diagnostic ignored "-Wunused-macros")
93#define WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS \
94 WINPR_DO_PRAGMA(clang diagnostic ignored "-Wunknown-pragmas")
96#if __clang_major__ >= 13
97#define WINPR_PRAGMA_DIAG_IGNORED_RESERVED_IDENTIFIER \
98 WINPR_DO_PRAGMA(clang diagnostic ignored "-Wreserved-identifier")
99#else
100#define WINPR_PRAGMA_DIAG_IGNORED_RESERVED_IDENTIFIER
101#endif
102
103#define WINPR_PRAGMA_DIAG_IGNORED_ATOMIC_SEQ_CST \
104 WINPR_DO_PRAGMA(clang diagnostic ignored "-Watomic-implicit-seq-cst")
105#define WINPR_PRAGMA_DIAG_IGNORED_UNUSED_CONST_VAR \
106 WINPR_DO_PRAGMA(clang diagnostic ignored "-Wunused-const-variable")
107#define WINPR_PRAGMA_DIAG_IGNORED_FORMAT_SECURITY \
108 WINPR_DO_PRAGMA(clang diagnostic ignored "-Wformat-security")
109#define WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE \
110 WINPR_DO_PRAGMA(clang diagnostic ignored \
111 "-Wtautological-constant-out-of-range-compare")
115#if __clang_major__ >= 12
116#define WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE \
117 WINPR_DO_PRAGMA(clang diagnostic ignored \
118 "-Wtautological-value-range-compare")
120#else
121#define WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE
122#endif
123
124#define WINPR_PRAGMA_DIAG_IGNORED_FORMAT_NONLITERAL \
125 WINPR_DO_PRAGMA(clang diagnostic ignored "-Wformat-nonliteral")
126#define WINPR_PRAGMA_DIAG_IGNORED_MISMATCHED_DEALLOC /* not supported \
127 WINPR_DO_PRAGMA(clang diagnostic ignored "-Wmismatched-dealloc") */
128#define WINPR_PRAGMA_DIAG_POP WINPR_DO_PRAGMA(clang diagnostic pop)
129#define WINPR_PRAGMA_UNROLL_LOOP \
130 _Pragma("clang loop vectorize_width(8) interleave_count(8)")
132#elif defined(__GNUC__)
133#define WINPR_PRAGMA_DIAG_PUSH WINPR_DO_PRAGMA(GCC diagnostic push)
134#define WINPR_PRAGMA_DIAG_IGNORED_OVERLENGTH_STRINGS \
135 WINPR_DO_PRAGMA(GCC diagnostic ignored "-Woverlength-strings")
136#define WINPR_PRAGMA_DIAG_IGNORED_QUALIFIERS \
137 WINPR_DO_PRAGMA(GCC diagnostic ignored "-Wdiscarded-qualifiers")
138#define WINPR_PRAGMA_DIAG_IGNORED_PEDANTIC WINPR_DO_PRAGMA(GCC diagnostic ignored "-Wpedantic")
139#define WINPR_PRAGMA_DIAG_IGNORED_MISSING_PROTOTYPES \
140 WINPR_DO_PRAGMA(GCC diagnostic ignored "-Wmissing-prototypes")
141#define WINPR_PRAGMA_DIAG_IGNORED_STRICT_PROTOTYPES \
142 WINPR_DO_PRAGMA(GCC diagnostic ignored "-Wstrict-prototypes")
143#define WINPR_PRAGMA_DIAG_IGNORED_RESERVED_ID_MACRO /* not supported WINPR_DO_PRAGMA(GCC \
144 diagnostic ignored "-Wreserved-id-macro") \
145 */
146#define WINPR_PRAGMA_DIAG_IGNORED_UNUSED_MACRO \
147 WINPR_DO_PRAGMA(GCC diagnostic ignored "-Wunused-macros")
148#define WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS \
149 WINPR_DO_PRAGMA(GCC diagnostic ignored "-Wunknown-pragmas")
151#define WINPR_PRAGMA_DIAG_IGNORED_RESERVED_IDENTIFIER
152/* not supported WINPR_DO_PRAGMA(GCC diagnostic ignored "-Wreserved-identifier") */
153#define WINPR_PRAGMA_DIAG_IGNORED_ATOMIC_SEQ_CST /* not supported WINPR_DO_PRAGMA(GCC diagnostic \
154 ignored \
155 "-Watomic-implicit-seq-cst") */
156#define WINPR_PRAGMA_DIAG_IGNORED_UNUSED_CONST_VAR \
157 WINPR_DO_PRAGMA(GCC diagnostic ignored "-Wunused-const-variable")
158#define WINPR_PRAGMA_DIAG_IGNORED_FORMAT_SECURITY \
159 WINPR_DO_PRAGMA(GCC diagnostic ignored "-Wformat-security")
160#define WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE /* not supported
161 WINPR_DO_PRAGMA(GCC diagnostic ignored "-Wtautological-constant-out-of-range-compare") */
162#define WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE /* not supported
163 WINPR_DO_PRAGMA(GCC diagnostic ignored "-Wtautological-value-range-compare") */
164#define WINPR_PRAGMA_DIAG_IGNORED_FORMAT_NONLITERAL \
165 WINPR_DO_PRAGMA(GCC diagnostic ignored "-Wformat-nonliteral")
166#if __GNUC__ >= 11
167#define WINPR_PRAGMA_DIAG_IGNORED_MISMATCHED_DEALLOC \
168 WINPR_DO_PRAGMA(GCC diagnostic ignored "-Wmismatched-dealloc")
169#else
170#define WINPR_PRAGMA_DIAG_IGNORED_MISMATCHED_DEALLOC
171#endif
172#define WINPR_PRAGMA_DIAG_POP WINPR_DO_PRAGMA(GCC diagnostic pop)
173#define WINPR_PRAGMA_UNROLL_LOOP \
174 WINPR_DO_PRAGMA(GCC unroll 8) WINPR_DO_PRAGMA(GCC ivdep)
175#else
176#define WINPR_PRAGMA_DIAG_PUSH
177#define WINPR_PRAGMA_DIAG_IGNORED_PEDANTIC
178#define WINPR_PRAGMA_DIAG_IGNORED_QUALIFIERS
179#define WINPR_PRAGMA_DIAG_IGNORED_OVERLENGTH_STRINGS
180#define WINPR_PRAGMA_DIAG_IGNORED_MISSING_PROTOTYPES
181#define WINPR_PRAGMA_DIAG_IGNORED_STRICT_PROTOTYPES
182#define WINPR_PRAGMA_DIAG_IGNORED_RESERVED_ID_MACRO
183#define WINPR_PRAGMA_DIAG_IGNORED_UNUSED_MACRO
184#define WINPR_PRAGMA_DIAG_IGNORED_UNKNOWN_PRAGMAS
185#define WINPR_PRAGMA_DIAG_IGNORED_RESERVED_IDENTIFIER
186#define WINPR_PRAGMA_DIAG_IGNORED_ATOMIC_SEQ_CST
187#define WINPR_PRAGMA_DIAG_IGNORED_UNUSED_CONST_VAR
188#define WINPR_PRAGMA_DIAG_IGNORED_FORMAT_SECURITY
189#define WINPR_PRAGMA_DIAG_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE
190#define WINPR_PRAGMA_DIAG_TAUTOLOGICAL_VALUE_RANGE_COMPARE
191#define WINPR_PRAGMA_DIAG_IGNORED_FORMAT_NONLITERAL
192#define WINPR_PRAGMA_DIAG_IGNORED_MISMATCHED_DEALLOC
193#define WINPR_PRAGMA_DIAG_POP
194#define WINPR_PRAGMA_UNROLL_LOOP
195#endif
196
197#if defined(MSVC)
198#undef WINPR_PRAGMA_UNROLL_LOOP
199#define WINPR_PRAGMA_UNROLL_LOOP WINPR_DO_PRAGMA(loop(ivdep))
200#endif
201
202WINPR_PRAGMA_DIAG_PUSH
203
204WINPR_PRAGMA_DIAG_IGNORED_RESERVED_ID_MACRO
205
206/*
207 * Processor Architectures:
208 * http://sourceforge.net/p/predef/wiki/Architectures/
209 *
210 * Visual Studio Predefined Macros:
211 * http://msdn.microsoft.com/en-ca/library/vstudio/b0084kay.aspx
212 */
213
214/* Intel x86 (_M_IX86) */
215
216#if defined(i386) || defined(__i386) || defined(__i386__) || defined(__i486__) || \
217 defined(__i586__) || defined(__i686__) || defined(__X86__) || defined(_X86_) || \
218 defined(__I86__) || defined(__IA32__) || defined(__THW_INTEL__) || defined(__INTEL__) || \
219 defined(_M_IX86)
220#ifndef _M_IX86
221#define _M_IX86 1
222#endif
223#endif
224
225/* AMD64 (_M_AMD64) */
226
227#if defined(__amd64) || defined(__amd64__) || defined(__x86_64) || defined(__x86_64__) || \
228 defined(_M_X64)
229#ifndef _M_AMD64
230#define _M_AMD64 1
231#endif
232#endif
233
234/* Intel ia64 */
235#if defined(__ia64) || defined(__ia64__) || defined(_M_IA64)
236#ifndef _M_IA64
237#define _M_IA64 1
238#endif
239#endif
240
241/* Intel x86 or AMD64 (_M_IX86_AMD64) */
242
243#if defined(_M_IX86) || defined(_M_AMD64)
244#ifndef _M_IX86_AMD64
245#define _M_IX86_AMD64 1
246#endif
247#endif
248
249/* ARM (_M_ARM) */
250
251#if defined(__arm__) || defined(__thumb__) || defined(__TARGET_ARCH_ARM) || \
252 defined(__TARGET_ARCH_THUMB)
253#ifndef _M_ARM
254#define _M_ARM 1
255#endif
256#endif
257
258/* ARM64 (_M_ARM64) */
259
260#if defined(__aarch64__)
261#ifndef _M_ARM64
262#define _M_ARM64 1
263#endif
264#endif
265
266/* MIPS (_M_MIPS) */
267
268#if defined(mips) || defined(__mips) || defined(__mips__) || defined(__MIPS__)
269#ifndef _M_MIPS
270#define _M_MIPS 1
271#endif
272#endif
273
274/* MIPS64 (_M_MIPS64) */
275
276#if defined(mips64) || defined(__mips64) || defined(__mips64__) || defined(__MIPS64__)
277#ifndef _M_MIPS64
278#define _M_MIPS64 1
279#endif
280#endif
281
282/* PowerPC (_M_PPC) */
283
284#if defined(__ppc__) || defined(__powerpc) || defined(__powerpc__) || defined(__POWERPC__) || \
285 defined(_ARCH_PPC)
286#ifndef _M_PPC
287#define _M_PPC 1
288#endif
289#endif
290
291/* Intel Itanium (_M_IA64) */
292
293#if defined(__ia64) || defined(__ia64__) || defined(_IA64) || defined(__IA64__)
294#ifndef _M_IA64
295#define _M_IA64 1
296#endif
297#endif
298
299/* Alpha (_M_ALPHA) */
300
301#if defined(__alpha) || defined(__alpha__)
302#ifndef _M_ALPHA
303#define _M_ALPHA 1
304#endif
305#endif
306
307/* SPARC (_M_SPARC) */
308
309#if defined(__sparc) || defined(__sparc__)
310#ifndef _M_SPARC
311#define _M_SPARC 1
312#endif
313#endif
314
315/* E2K (_M_E2K) */
316
317#if defined(__e2k__)
318#ifndef _M_E2K
319#define _M_E2K 1
320#endif
321#endif
322
328/* Windows (_WIN32) */
329
330/* WinRT (_WINRT) */
331
332#if defined(WINAPI_FAMILY)
333#if (WINAPI_FAMILY == WINAPI_FAMILY_APP)
334#ifndef _WINRT
335#define _WINRT 1
336#endif
337#endif
338#endif
339
340#if defined(__cplusplus_winrt)
341#ifndef _WINRT
342#define _WINRT 1
343#endif
344#endif
345
346/* Linux (__linux__) */
347
348#if defined(linux) || defined(__linux)
349#ifndef __linux__
350#define __linux__ 1
351#endif
352#endif
353
354/* GNU/Linux (__gnu_linux__) */
355
356/* Apple Platforms (iOS, Mac OS X) */
357
358#if (defined(__APPLE__) && defined(__MACH__))
359
360#include <TargetConditionals.h>
361
362#if (TARGET_OS_IPHONE == 1) || (TARGET_IPHONE_SIMULATOR == 1)
363
364/* iOS (__IOS__) */
365
366#ifndef __IOS__
367#define __IOS__ 1
368#endif
369
370#elif (TARGET_OS_MAC == 1)
371
372/* Mac OS X (__MACOSX__) */
373
374#ifndef __MACOSX__
375#define __MACOSX__ 1
376#endif
377
378#endif
379#endif
380
381/* Android (__ANDROID__) */
382
383/* Cygwin (__CYGWIN__) */
384
385/* FreeBSD (__FreeBSD__) */
386
387/* NetBSD (__NetBSD__) */
388
389/* OpenBSD (__OpenBSD__) */
390
391/* DragonFly (__DragonFly__) */
392
393/* Solaris (__sun) */
394
395#if defined(sun)
396#ifndef __sun
397#define __sun 1
398#endif
399#endif
400
401/* IRIX (__sgi) */
402
403#if defined(sgi)
404#ifndef __sgi
405#define __sgi 1
406#endif
407#endif
408
409/* AIX (_AIX) */
410
411#if defined(__TOS_AIX__)
412#ifndef _AIX
413#define _AIX 1
414#endif
415#endif
416
417/* HP-UX (__hpux) */
418
419#if defined(hpux) || defined(_hpux)
420#ifndef __hpux
421#define __hpux 1
422#endif
423#endif
424
425/* BeOS (__BEOS__) */
426
427/* QNX (__QNXNTO__) */
428
434#if defined(__gnu_linux__)
435#include <endian.h>
436#endif
437
438#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || \
439 defined(__DragonFly__) || defined(__APPLE__)
440#include <sys/param.h>
441#endif
442
443/* Big-Endian */
444
445#ifdef __BYTE_ORDER
446
447#if (__BYTE_ORDER == __BIG_ENDIAN)
448#ifndef __BIG_ENDIAN__
449#define __BIG_ENDIAN__ 1
450#endif
451#endif
452
453#else
454
455#if defined(__ARMEB__) || defined(__THUMBEB__) || defined(__AARCH64EB__) || defined(_MIPSEB) || \
456 defined(__MIPSEB) || defined(__MIPSEB__)
457#ifndef __BIG_ENDIAN__
458#define __BIG_ENDIAN__ 1
459#endif
460#endif
461
462#endif /* __BYTE_ORDER */
463
464/* Little-Endian */
465
466#ifdef __BYTE_ORDER
467
468#if (__BYTE_ORDER == __LITTLE_ENDIAN)
469#ifndef __LITTLE_ENDIAN__
470#define __LITTLE_ENDIAN__ 1
471#endif
472#endif
473
474#else
475
476#if defined(__ARMEL__) || defined(__THUMBEL__) || defined(__AARCH64EL__) || defined(_MIPSEL) || \
477 defined(__MIPSEL) || defined(__MIPSEL__) || defined(__e2k__)
478#ifndef __LITTLE_ENDIAN__
479#define __LITTLE_ENDIAN__ 1
480#endif
481#endif
482
483#endif /* __BYTE_ORDER */
484
485WINPR_PRAGMA_DIAG_POP
486
487#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 202311L)
488#define WINPR_DEPRECATED(obj) [[deprecated]] obj
489#define WINPR_DEPRECATED_VAR(text, obj) [[deprecated(text)]] obj
490#define WINPR_NORETURN(obj) [[noreturn]] obj
491#elif defined(WIN32) && !defined(__CYGWIN__)
492#define WINPR_DEPRECATED(obj) __declspec(deprecated) obj
493#define WINPR_DEPRECATED_VAR(text, obj) __declspec(deprecated(text)) obj
494#define WINPR_NORETURN(obj) __declspec(noreturn) obj
495#elif defined(__GNUC__)
496#define WINPR_DEPRECATED(obj) obj __attribute__((deprecated))
497#define WINPR_DEPRECATED_VAR(text, obj) obj __attribute__((deprecated(text)))
498#define WINPR_NORETURN(obj) __attribute__((__noreturn__)) obj
499#else
500#define WINPR_DEPRECATED(obj) obj
501#define WINPR_DEPRECATED_VAR(text, obj) obj
502#define WINPR_NORETURN(obj) obj
503#endif
504
505#ifdef _WIN32
506#define INLINE __inline
507#else
508#define INLINE inline
509#endif
510
511#ifdef WINPR_DLL
512#if defined _WIN32 || defined __CYGWIN__
513#ifdef WINPR_EXPORTS
514#ifdef __GNUC__
515#define WINPR_API __attribute__((dllexport))
516#else
517#define WINPR_API __declspec(dllexport)
518#endif
519#else
520#ifdef __GNUC__
521#define WINPR_API __attribute__((dllimport))
522#else
523#define WINPR_API __declspec(dllimport)
524#endif
525#endif
526#else
527#if defined(__GNUC__) && (__GNUC__ >= 4)
528#define WINPR_API __attribute__((visibility("default")))
529#else
530#define WINPR_API
531#endif
532#endif
533#else /* WINPR_DLL */
534#define WINPR_API
535#endif
536
537#if defined(__clang__) || defined(__GNUC__) && (__GNUC__ <= 10)
538#define WINPR_ATTR_MALLOC(deallocator, ptrindex) \
539 __attribute__((malloc, warn_unused_result))
540#elif defined(__GNUC__)
541#define WINPR_ATTR_MALLOC(deallocator, ptrindex) \
542 __attribute__((malloc(deallocator, ptrindex), warn_unused_result))
543#else
544#define WINPR_ATTR_MALLOC(deallocator, ptrindex) __declspec(restrict)
545#endif
546
547#if defined(__GNUC__) || defined(__clang__)
548#define WINPR_ATTR_FORMAT_ARG(pos, args) __attribute__((__format__(__printf__, pos, args)))
549#define WINPR_FORMAT_ARG
550#else
551#define WINPR_ATTR_FORMAT_ARG(pos, args)
552#define WINPR_FORMAT_ARG _Printf_format_string_
553#endif
554
555#if defined(EXPORT_ALL_SYMBOLS)
556#define WINPR_LOCAL WINPR_API
557#else
558#if defined _WIN32 || defined __CYGWIN__
559#define WINPR_LOCAL
560#else
561#if defined(__GNUC__) && (__GNUC__ >= 4)
562#define WINPR_LOCAL __attribute__((visibility("hidden")))
563#else
564#define WINPR_LOCAL
565#endif
566#endif
567#endif
568
569// WARNING: *do not* use thread-local storage for new code because it is not portable
570// It is only used for VirtualChannelInit, and all FreeRDP channels use VirtualChannelInitEx
571// The old virtual channel API is only realistically used on Windows where TLS is available
572#if defined _WIN32 || defined __CYGWIN__
573#ifdef __GNUC__
574#define WINPR_TLS __thread
575#else
576#define WINPR_TLS __declspec(thread)
577#endif
578#elif !defined(__IOS__)
579#define WINPR_TLS __thread
580#else
581// thread-local storage is not supported on iOS
582// don't warn because it isn't actually used on iOS
583#define WINPR_TLS
584#endif
585
586#if defined(__GNUC__) || defined(__clang__)
587#define WINPR_ALIGN64 __attribute__((aligned(8)))
588#else
589#ifdef _WIN32
590#define WINPR_ALIGN64 __declspec(align(8))
591#else
592#define WINPR_ALIGN64
593#endif
594#endif
595
596#if defined(__cplusplus) && (__cplusplus >= 201703L)
597#define WINPR_ATTR_UNUSED [[maybe_unused]]
598#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 202000L)
599#define WINPR_ATTR_UNUSED [[maybe_unused]]
600#elif defined(__GNUC__) || defined(__clang__)
601#define WINPR_ATTR_UNUSED __attribute__((unused))
602#else
603#define WINPR_ATTR_UNUSED
604#endif
605
606#define WINPR_UNUSED(x) (void)(x)
607
608#endif /* WINPR_PLATFORM_H */