Go to the documentation of this file.
19 #ifndef GRPC_SUPPORT_PORT_PLATFORM_H
20 #define GRPC_SUPPORT_PORT_PLATFORM_H
23 #if __cplusplus >= 201402L
24 #define GRPC_DEPRECATED(reason) [[deprecated(reason)]]
26 #define GRPC_DEPRECATED(reason)
27 #endif // __cplusplus >= 201402L
32 #ifndef GPR_ABSEIL_SYNC
33 #if defined(__APPLE__)
37 #define GPR_ABSEIL_SYNC 1
39 #endif // GPR_ABSEIL_SYNC
42 #if defined(_WIN64) || defined(WIN64) || defined(_WIN32) || defined(WIN32)
43 #ifndef WIN32_LEAN_AND_MEAN
44 #define GRPC_WIN32_LEAN_AND_MEAN_WAS_NOT_DEFINED
45 #define WIN32_LEAN_AND_MEAN
67 #if !defined(GRPC_DLL)
68 #if defined(GRPC_DLL_EXPORTS)
69 #define GRPC_DLL __declspec(dllexport)
70 #elif defined(GRPC_DLL_IMPORTS)
71 #define GRPC_DLL __declspec(dllimport)
74 #endif // defined(GRPC_DLL_EXPORTS)
78 #if !defined(GRPCXX_DLL)
79 #if defined(GRPCXX_DLL_EXPORTS)
80 #define GRPCXX_DLL __declspec(dllexport)
81 #elif defined(GRPCXX_DLL_IMPORTS)
82 #define GRPCXX_DLL __declspec(dllimport)
85 #endif // defined(GRPCXX_DLL_EXPORTS)
90 #if defined(GPR_DLL_EXPORTS)
91 #define GPR_DLL __declspec(dllexport)
92 #elif defined(GPR_DLL_IMPORTS)
93 #define GPR_DLL __declspec(dllimport)
96 #endif // defined(GPR_DLL_EXPORTS)
100 #define GRPC_NOMINMX_WAS_NOT_DEFINED
108 "Please compile grpc with _WIN32_WINNT of at least 0x600 (aka Windows Vista)"
110 #if (_WIN32_WINNT < 0x0600)
112 "Please compile grpc with _WIN32_WINNT of at least 0x600 (aka Windows Vista)"
115 #ifdef GRPC_WIN32_LEAN_AND_MEAN_WAS_NOT_DEFINED
116 #undef GRPC_WIN32_LEAN_AND_MEAN_WAS_NOT_DEFINED
117 #undef WIN32_LEAN_AND_MEAN
120 #ifdef GRPC_NOMINMAX_WAS_NOT_DEFINED
121 #undef GRPC_NOMINMAX_WAS_NOT_DEFINED
135 #if !defined(GPR_NO_AUTODETECT_PLATFORM)
136 #if defined(_WIN64) || defined(WIN64) || defined(_WIN32) || defined(WIN32)
137 #if defined(_WIN64) || defined(WIN64)
138 #define GPR_ARCH_64 1
140 #define GPR_ARCH_32 1
142 #define GPR_PLATFORM_STRING "windows"
143 #define GPR_WINDOWS 1
144 #define GPR_WINDOWS_SUBPROCESS 1
145 #define GPR_WINDOWS_ENV
147 #define GPR_GETPID_IN_UNISTD_H 1
148 #define GPR_MSYS_TMPFILE
149 #define GPR_POSIX_LOG
150 #define GPR_POSIX_STRING
151 #define GPR_POSIX_TIME
153 #define GPR_GETPID_IN_PROCESS_H 1
154 #define GPR_WINDOWS_TMPFILE
155 #define GPR_WINDOWS_LOG
156 #define GPR_WINDOWS_CRASH_HANDLER 1
157 #define GPR_WINDOWS_STAT
158 #define GPR_WINDOWS_STRING
159 #define GPR_WINDOWS_TIME
162 #define GPR_GCC_ATOMIC 1
164 #define GPR_WINDOWS_ATOMIC 1
166 #elif defined(ANDROID) || defined(__ANDROID__)
167 #define GPR_PLATFORM_STRING "android"
168 #define GPR_ANDROID 1
169 #ifndef __ANDROID_API__
170 #error "__ANDROID_API__ must be defined for Android builds."
172 #if __ANDROID_API__ < 21
173 #error "Requires Android API v21 and above"
175 #define GPR_SUPPORT_BINDER_TRANSPORT 1
181 #define GPR_ARCH_64 1
183 #define GPR_ARCH_32 1
185 #define GPR_CPU_POSIX 1
186 #define GPR_GCC_SYNC 1
187 #define GPR_POSIX_ENV 1
188 #define GPR_POSIX_TMPFILE 1
189 #define GPR_POSIX_STAT 1
190 #define GPR_ANDROID_LOG 1
191 #define GPR_POSIX_STRING 1
192 #define GPR_POSIX_SUBPROCESS 1
193 #define GPR_POSIX_SYNC 1
194 #define GPR_POSIX_TIME 1
195 #define GPR_HAS_PTHREAD_H 1
196 #define GPR_GETPID_IN_UNISTD_H 1
197 #define GPR_SUPPORT_CHANNELS_FROM_FD 1
198 #elif defined(__linux__)
199 #define GPR_PLATFORM_STRING "linux"
203 #ifndef _DEFAULT_SOURCE
204 #define _DEFAULT_SOURCE
209 #include <features.h>
210 #define GPR_CPU_LINUX 1
211 #define GPR_GCC_ATOMIC 1
213 #define GPR_LINUX_LOG
214 #define GPR_SUPPORT_CHANNELS_FROM_FD 1
215 #define GPR_LINUX_ENV 1
216 #define GPR_POSIX_TMPFILE 1
217 #define GPR_POSIX_STAT 1
218 #define GPR_POSIX_STRING 1
219 #define GPR_POSIX_SUBPROCESS 1
220 #define GPR_POSIX_SYNC 1
221 #define GPR_POSIX_TIME 1
222 #define GPR_HAS_PTHREAD_H 1
223 #define GPR_GETPID_IN_UNISTD_H 1
225 #define GPR_ARCH_64 1
227 #define GPR_ARCH_32 1
230 #define GPR_POSIX_CRASH_HANDLER 1
231 #ifdef __GLIBC_PREREQ
232 #if __GLIBC_PREREQ(2, 12)
233 #define GPR_LINUX_PTHREAD_NAME 1
237 #define GPR_LINUX_PTHREAD_NAME 1
239 #include <linux/version.h>
241 #define GPR_MUSL_LIBC_COMPAT 1
243 #elif defined(__ASYLO__)
244 #define GPR_ARCH_64 1
245 #define GPR_CPU_POSIX 1
246 #define GPR_PLATFORM_STRING "asylo"
247 #define GPR_GCC_SYNC 1
248 #define GPR_POSIX_STAT 1
249 #define GPR_POSIX_SYNC 1
250 #define GPR_POSIX_STRING 1
251 #define GPR_POSIX_LOG 1
252 #define GPR_POSIX_TIME 1
253 #define GPR_POSIX_ENV 1
255 #define GRPC_POSIX_SOCKET 1
256 #define GRPC_POSIX_SOCKETADDR
257 #define GRPC_POSIX_SOCKETUTILS 1
258 #define GRPC_TIMER_USE_GENERIC 1
259 #define GRPC_POSIX_NO_SPECIAL_WAKEUP_FD 1
260 #define GRPC_POSIX_WAKEUP_FD 1
261 #define GRPC_HAVE_MSG_NOSIGNAL 1
262 #define GRPC_HAVE_UNIX_SOCKET 1
264 #define GPR_NO_AUTODETECT_PLATFORM 1
265 #elif defined(__APPLE__)
266 #include <Availability.h>
267 #include <TargetConditionals.h>
272 #define GPR_PLATFORM_STRING "ios"
273 #define GPR_CPU_IPHONE 1
274 #define GRPC_CFSTREAM 1
275 #ifndef GRPC_IOS_EVENT_ENGINE_CLIENT
276 #define GRPC_IOS_EVENT_ENGINE_CLIENT 1
281 #define GPR_PLATFORM_STRING "osx"
282 #define GPR_CPU_POSIX 1
283 #define GPR_POSIX_CRASH_HANDLER 1
286 #define GPR_GCC_ATOMIC 1
287 #define GPR_POSIX_LOG 1
288 #define GPR_POSIX_ENV 1
289 #define GPR_POSIX_TMPFILE 1
290 #define GPR_POSIX_STAT 1
291 #define GPR_POSIX_STRING 1
292 #define GPR_POSIX_SUBPROCESS 1
293 #define GPR_POSIX_SYNC 1
294 #define GPR_POSIX_TIME 1
295 #define GPR_HAS_PTHREAD_H 1
296 #define GPR_GETPID_IN_UNISTD_H 1
297 #ifndef GRPC_CFSTREAM
298 #define GPR_SUPPORT_CHANNELS_FROM_FD 1
301 #define GPR_ARCH_64 1
303 #define GPR_ARCH_32 1
305 #elif defined(__FreeBSD__)
306 #define GPR_PLATFORM_STRING "freebsd"
310 #define GPR_FREEBSD 1
311 #define GPR_CPU_POSIX 1
312 #define GPR_GCC_ATOMIC 1
313 #define GPR_POSIX_LOG 1
314 #define GPR_POSIX_ENV 1
315 #define GPR_POSIX_TMPFILE 1
316 #define GPR_POSIX_STAT 1
317 #define GPR_POSIX_STRING 1
318 #define GPR_POSIX_SUBPROCESS 1
319 #define GPR_POSIX_SYNC 1
320 #define GPR_POSIX_TIME 1
321 #define GPR_HAS_PTHREAD_H 1
322 #define GPR_GETPID_IN_UNISTD_H 1
323 #define GPR_SUPPORT_CHANNELS_FROM_FD 1
325 #define GPR_ARCH_64 1
327 #define GPR_ARCH_32 1
329 #elif defined(__OpenBSD__)
330 #define GPR_PLATFORM_STRING "openbsd"
334 #define GPR_OPENBSD 1
335 #define GPR_CPU_POSIX 1
336 #define GPR_GCC_ATOMIC 1
337 #define GPR_POSIX_LOG 1
338 #define GPR_POSIX_ENV 1
339 #define GPR_POSIX_TMPFILE 1
340 #define GPR_POSIX_STAT 1
341 #define GPR_POSIX_STRING 1
342 #define GPR_POSIX_SUBPROCESS 1
343 #define GPR_POSIX_SYNC 1
344 #define GPR_POSIX_TIME 1
345 #define GPR_HAS_PTHREAD_H 1
346 #define GPR_GETPID_IN_UNISTD_H 1
347 #define GPR_SUPPORT_CHANNELS_FROM_FD 1
349 #define GPR_ARCH_64 1
351 #define GPR_ARCH_32 1
353 #elif defined(__sun) && defined(__SVR4)
354 #define GPR_PLATFORM_STRING "solaris"
355 #define GPR_SOLARIS 1
356 #define GPR_CPU_POSIX 1
357 #define GPR_GCC_ATOMIC 1
358 #define GPR_POSIX_LOG 1
359 #define GPR_POSIX_ENV 1
360 #define GPR_POSIX_TMPFILE 1
361 #define GPR_POSIX_STAT 1
362 #define GPR_POSIX_STRING 1
363 #define GPR_POSIX_SUBPROCESS 1
364 #define GPR_POSIX_SYNC 1
365 #define GPR_POSIX_TIME 1
366 #define GPR_HAS_PTHREAD_H 1
367 #define GPR_GETPID_IN_UNISTD_H 1
369 #define GPR_ARCH_64 1
371 #define GPR_ARCH_32 1
374 #define GPR_PLATFORM_STRING "aix"
379 #define GPR_CPU_POSIX 1
380 #define GPR_GCC_ATOMIC 1
381 #define GPR_POSIX_LOG 1
382 #define GPR_POSIX_ENV 1
383 #define GPR_POSIX_TMPFILE 1
384 #define GPR_POSIX_STAT 1
385 #define GPR_POSIX_STRING 1
386 #define GPR_POSIX_SUBPROCESS 1
387 #define GPR_POSIX_SYNC 1
388 #define GPR_POSIX_TIME 1
389 #define GPR_HAS_PTHREAD_H 1
390 #define GPR_GETPID_IN_UNISTD_H 1
392 #define GPR_ARCH_64 1
394 #define GPR_ARCH_32 1
396 #elif defined(__NetBSD__)
399 #define GPR_PLATFORM_STRING "netbsd"
404 #define GPR_CPU_POSIX 1
405 #define GPR_GCC_ATOMIC 1
406 #define GPR_GCC_TLS 1
407 #define GPR_POSIX_LOG 1
408 #define GPR_POSIX_ENV 1
409 #define GPR_POSIX_TMPFILE 1
410 #define GPR_POSIX_STAT 1
411 #define GPR_POSIX_STRING 1
412 #define GPR_POSIX_SUBPROCESS 1
413 #define GPR_POSIX_SYNC 1
414 #define GPR_POSIX_TIME 1
415 #define GPR_GETPID_IN_UNISTD_H 1
416 #define GPR_SUPPORT_CHANNELS_FROM_FD 1
418 #define GPR_ARCH_64 1
420 #define GPR_ARCH_32 1
422 #elif defined(__native_client__)
423 #define GPR_PLATFORM_STRING "nacl"
427 #ifndef _DEFAULT_SOURCE
428 #define _DEFAULT_SOURCE
434 #define GPR_CPU_POSIX 1
435 #define GPR_GCC_ATOMIC 1
436 #define GPR_POSIX_LOG 1
437 #define GPR_POSIX_ENV 1
438 #define GPR_POSIX_TMPFILE 1
439 #define GPR_POSIX_STAT 1
440 #define GPR_POSIX_STRING 1
441 #define GPR_POSIX_SUBPROCESS 1
442 #define GPR_POSIX_SYNC 1
443 #define GPR_POSIX_TIME 1
444 #define GPR_HAS_PTHREAD_H 1
445 #define GPR_GETPID_IN_UNISTD_H 1
447 #define GPR_ARCH_64 1
449 #define GPR_ARCH_32 1
451 #elif defined(__Fuchsia__)
453 #define GPR_FUCHSIA 1
454 #define GPR_ARCH_64 1
455 #define GPR_PLATFORM_STRING "fuchsia"
456 #include <features.h>
459 #define GPR_MUSL_LIBC_COMPAT 1
460 #define GPR_CPU_POSIX 1
461 #define GPR_GCC_ATOMIC 1
462 #define GPR_POSIX_LOG 1
463 #define GPR_POSIX_SYNC 1
464 #define GPR_POSIX_ENV 1
465 #define GPR_POSIX_TMPFILE 1
466 #define GPR_POSIX_STAT 1
467 #define GPR_POSIX_SUBPROCESS 1
468 #define GPR_POSIX_SYNC 1
469 #define GPR_POSIX_STRING 1
470 #define GPR_POSIX_TIME 1
471 #define GPR_HAS_PTHREAD_H 1
472 #define GPR_GETPID_IN_UNISTD_H 1
473 #define GRPC_ROOT_PEM_PATH "/config/ssl/cert.pem"
474 #elif defined(__HAIKU__)
475 #define GPR_PLATFORM_STRING "haiku"
482 #define GPR_CPU_POSIX 1
483 #define GPR_GCC_ATOMIC 1
484 #define GPR_POSIX_LOG 1
485 #define GPR_POSIX_ENV 1
486 #define GPR_POSIX_TMPFILE 1
487 #define GPR_POSIX_STAT 1
488 #define GPR_POSIX_STRING 1
489 #define GPR_POSIX_SUBPROCESS 1
490 #define GPR_POSIX_SYNC 1
491 #define GPR_POSIX_TIME 1
492 #define GPR_HAS_PTHREAD_H 1
493 #define GPR_GETPID_IN_UNISTD_H 1
494 #define GPR_SUPPORT_CHANNELS_FROM_FD 1
496 #define GPR_ARCH_64 1
498 #define GPR_ARCH_32 1
500 #elif defined(__QNX__) || defined(__QNXNTO__)
501 #define GPR_PLATFORM_STRING "qnx"
502 #define GPR_CPU_POSIX 1
503 #define GPR_GCC_ATOMIC 1
504 #define GPR_POSIX_LOG 1
505 #define GPR_POSIX_ENV 1
506 #define GPR_POSIX_TMPFILE 1
507 #define GPR_POSIX_STAT 1
508 #define GPR_POSIX_STRING 1
509 #define GPR_POSIX_SYNC 1
510 #define GPR_POSIX_TIME 1
511 #define GPR_HAS_PTHREAD_H 1
512 #define GPR_GETPID_IN_UNISTD_H 1
514 #define GPR_ARCH_64 1
516 #define GPR_ARCH_32 1
519 #error "Could not auto-detect platform"
523 #if defined(__has_include)
524 #if __has_include(<atomic>)
525 #define GRPC_HAS_CXX11_ATOMIC
529 #ifndef GPR_PLATFORM_STRING
530 #warning "GPR_PLATFORM_STRING not auto-detected"
531 #define GPR_PLATFORM_STRING "unknown"
535 #undef GPR_FORBID_UNREACHABLE_CODE
536 #define GPR_FORBID_UNREACHABLE_CODE 1
541 typedef __int8 int8_t;
542 typedef __int16 int16_t;
543 typedef __int32 int32_t;
544 typedef __int64 int64_t;
545 typedef unsigned __int8 uint8_t;
546 typedef unsigned __int16 uint16_t;
547 typedef unsigned __int32 uint32_t;
548 typedef unsigned __int64 uint64_t;
568 #define GPR_CYCLE_COUNTER_FALLBACK 1
570 #define GPR_CYCLE_COUNTER_FALLBACK 1
574 #ifndef GPR_CACHELINE_SIZE_LOG
575 #if defined(__i386__) || defined(__x86_64__)
576 #define GPR_CACHELINE_SIZE_LOG 6
578 #ifndef GPR_CACHELINE_SIZE_LOG
581 #define GPR_CACHELINE_SIZE_LOG 6
585 #define GPR_CACHELINE_SIZE (1 << GPR_CACHELINE_SIZE_LOG)
588 #if defined(GPR_GCC_ATOMIC) && !defined(__ATOMIC_RELAXED)
589 #undef GPR_GCC_ATOMIC
590 #define GPR_GCC_SYNC 1
594 #if defined(GPR_GCC_ATOMIC) + defined(GPR_GCC_SYNC) + \
595 defined(GPR_WINDOWS_ATOMIC) != \
597 #error Must define exactly one of GPR_GCC_ATOMIC, GPR_GCC_SYNC, GPR_WINDOWS_ATOMIC
600 #if defined(GPR_ARCH_32) + defined(GPR_ARCH_64) != 1
601 #error Must define exactly one of GPR_ARCH_32, GPR_ARCH_64
604 #if defined(GPR_CPU_LINUX) + defined(GPR_CPU_POSIX) + defined(GPR_WINDOWS) + \
605 defined(GPR_CPU_IPHONE) + defined(GPR_CPU_CUSTOM) != \
607 #error Must define exactly one of GPR_CPU_LINUX, GPR_CPU_POSIX, GPR_WINDOWS, GPR_CPU_IPHONE, GPR_CPU_CUSTOM
612 #define GPR_MAX_ALIGNMENT 16
618 #ifndef GRPC_IF_NAMETOINDEX
619 #define GRPC_IF_NAMETOINDEX 1
623 #if defined(__GNUC__) && !defined(__MINGW32__)
624 #define GRPC_UNUSED __attribute__((unused))
630 #ifndef GPR_PRINT_FORMAT_CHECK
632 #define GPR_PRINT_FORMAT_CHECK(FORMAT_STR, ARGS) \
633 __attribute__((format(printf, FORMAT_STR, ARGS)))
635 #define GPR_PRINT_FORMAT_CHECK(FORMAT_STR, ARGS)
639 #ifndef GPR_HAS_CPP_ATTRIBUTE
640 #ifdef __has_cpp_attribute
641 #define GPR_HAS_CPP_ATTRIBUTE(a) __has_cpp_attribute(a)
643 #define GPR_HAS_CPP_ATTRIBUTE(a) 0
647 #if defined(__GNUC__) && !defined(__MINGW32__)
648 #define GPR_ALIGN_STRUCT(n) __attribute__((aligned(n)))
650 #define GPR_ALIGN_STRUCT(n)
653 #ifndef GRPC_MUST_USE_RESULT
654 #if GPR_HAS_CPP_ATTRIBUTE(nodiscard)
655 #define GRPC_MUST_USE_RESULT [[nodiscard]]
656 #elif defined(__GNUC__) && !defined(__MINGW32__)
657 #define GRPC_MUST_USE_RESULT __attribute__((warn_unused_result))
659 #define GRPC_MUST_USE_RESULT
661 #ifdef USE_STRICT_WARNING
670 #define GRPC_MUST_USE_RESULT_WHEN_USE_STRICT_WARNING GRPC_MUST_USE_RESULT
672 #define GRPC_MUST_USE_RESULT_WHEN_USE_STRICT_WARNING
676 #ifndef GRPC_REINITIALIZES
677 #if defined(__clang__)
678 #if GPR_HAS_CPP_ATTRIBUTE(clang::reinitializes)
679 #define GRPC_REINITIALIZES [[clang::reinitializes]]
681 #define GRPC_REINITIALIZES
684 #define GRPC_REINITIALIZES
688 #ifndef GPR_HAS_ATTRIBUTE
689 #ifdef __has_attribute
690 #define GPR_HAS_ATTRIBUTE(a) __has_attribute(a)
692 #define GPR_HAS_ATTRIBUTE(a) 0
696 #if GPR_HAS_ATTRIBUTE(noreturn)
697 #define GPR_ATTRIBUTE_NORETURN __attribute__((noreturn))
699 #define GPR_ATTRIBUTE_NORETURN
702 #if defined(GPR_FORBID_UNREACHABLE_CODE) && GPR_FORBID_UNREACHABLE_CODE
703 #define GPR_UNREACHABLE_CODE(STATEMENT)
713 #define GPR_UNREACHABLE_CODE(STATEMENT) \
715 gpr_unreachable_code(#STATEMENT, __FILE__, __LINE__); \
725 #define GRPCAPI GPRAPI
729 #define CENSUSAPI GRPCAPI
732 #ifndef GPR_HAS_FEATURE
734 #define GPR_HAS_FEATURE(a) __has_feature(a)
736 #define GPR_HAS_FEATURE(a) 0
740 #ifndef GPR_ATTRIBUTE_NOINLINE
741 #if GPR_HAS_ATTRIBUTE(noinline) || (defined(__GNUC__) && !defined(__clang__))
742 #define GPR_ATTRIBUTE_NOINLINE __attribute__((noinline))
743 #define GPR_HAS_ATTRIBUTE_NOINLINE 1
745 #define GPR_ATTRIBUTE_NOINLINE
749 #ifndef GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION
751 #if GPR_HAS_CPP_ATTRIBUTE(clang::always_inline)
752 #define GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION [[clang::always_inline]]
753 #elif GPR_HAS_ATTRIBUTE(always_inline)
754 #define GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION __attribute__((always_inline))
757 #define GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION
761 #define GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION
765 #ifndef GPR_NO_UNIQUE_ADDRESS
766 #if GPR_HAS_CPP_ATTRIBUTE(no_unique_address)
767 #define GPR_NO_UNIQUE_ADDRESS [[no_unique_address]]
769 #define GPR_NO_UNIQUE_ADDRESS
773 #ifndef GRPC_DEPRECATED
774 #if GPR_HAS_CPP_ATTRIBUTE(deprecated)
775 #define GRPC_DEPRECATED(reason) [[deprecated(reason)]]
777 #define GRPC_DEPRECATED(reason)
781 #ifndef GPR_ATTRIBUTE_WEAK
784 #if (GPR_HAS_ATTRIBUTE(weak) || (defined(__GNUC__) && !defined(__clang__))) && \
785 !(defined(__llvm__) && defined(_WIN32))
786 #define GPR_ATTRIBUTE_WEAK __attribute__((weak))
787 #define GPR_HAS_ATTRIBUTE_WEAK 1
789 #define GPR_ATTRIBUTE_WEAK
793 #ifndef GPR_ATTRIBUTE_NO_TSAN
794 #if GPR_HAS_FEATURE(thread_sanitizer)
795 #define GPR_ATTRIBUTE_NO_TSAN __attribute__((no_sanitize("thread")))
797 #ifndef GPR_ATTRIBUTE_NO_TSAN
798 #define GPR_ATTRIBUTE_NO_TSAN
803 #ifndef GRPC_TSAN_SUPPRESSED
804 #if defined(__SANITIZE_THREAD__)
805 #define GRPC_TSAN_ENABLED
806 #elif GPR_HAS_FEATURE(thread_sanitizer)
807 #define GRPC_TSAN_ENABLED
812 #ifndef GRPC_ASAN_SUPPRESSED
813 #if defined(__SANITIZE_ADDRESS__)
814 #define GRPC_ASAN_ENABLED
815 #elif GPR_HAS_FEATURE(address_sanitizer)
816 #define GRPC_ASAN_ENABLED
821 #ifndef GRPC_ALLOW_EXCEPTIONS
823 #if defined(_MSC_VER) && defined(_CPPUNWIND)
824 #define GRPC_ALLOW_EXCEPTIONS 1
825 #elif defined(__EXCEPTIONS)
826 #define GRPC_ALLOW_EXCEPTIONS 1
828 #define GRPC_ALLOW_EXCEPTIONS 0
832 #define GRPC_ALLOW_EXCEPTIONS 1
834 #define GRPC_ALLOW_EXCEPTIONS 0
840 #define GRPC_HAS_BUILTIN(a) __has_builtin(a)
842 #define GRPC_HAS_BUILTIN(a) 0
849 #define GPR_LIKELY(x) __builtin_expect((x), 1)
850 #define GPR_UNLIKELY(x) __builtin_expect((x), 0)
852 #define GPR_LIKELY(x) (x)
853 #define GPR_UNLIKELY(x) (x)
856 #ifndef __STDC_FORMAT_MACROS
857 #define __STDC_FORMAT_MACROS
865 #ifndef GPR_MSVC_EMPTY_BASE_CLASS_WORKAROUND
867 #define GPR_MSVC_EMPTY_BASE_CLASS_WORKAROUND __declspec(empty_bases)
869 #define GPR_MSVC_EMPTY_BASE_CLASS_WORKAROUND
873 #define GRPC_CALLBACK_API_NONEXPERIMENTAL
880 #if __clang__ && __clang_major__ <= 12 && __has_feature(memory_sanitizer)
881 #undef GPR_NO_UNIQUE_ADDRESS
882 #define GPR_NO_UNIQUE_ADDRESS
const char * file
Definition: log.h:68
int line
Definition: log.h:69