3 * Copyright 2015 gRPC authors.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
19 #ifndef GRPC_IMPL_CODEGEN_PORT_PLATFORM_H
20 #define GRPC_IMPL_CODEGEN_PORT_PLATFORM_H
23 * Define GPR_BACKWARDS_COMPATIBILITY_MODE to try harder to be ABI
24 * compatible with older platforms (currently only on Linux)
26 * - some libc calls to be gotten via dlsym
27 * - some syscalls to be made directly
31 * Defines GPR_ABSEIL_SYNC to use synchronization features from Abseil
33 #ifndef GPR_ABSEIL_SYNC
34 #if defined(__APPLE__)
35 // This is disabled on Apple platforms because macos/grpc_basictests_c_cpp
36 // fails with this. https://github.com/grpc/grpc/issues/23661
38 #define GPR_ABSEIL_SYNC 1
40 #endif // GPR_ABSEIL_SYNC
42 /* Get windows.h included everywhere (we need it) */
43 #if defined(_WIN64) || defined(WIN64) || defined(_WIN32) || defined(WIN32)
44 #ifndef WIN32_LEAN_AND_MEAN
45 #define GRPC_WIN32_LEAN_AND_MEAN_WAS_NOT_DEFINED
46 #define WIN32_LEAN_AND_MEAN
47 #endif /* WIN32_LEAN_AND_MEAN */
50 #define GRPC_NOMINMX_WAS_NOT_DEFINED
58 "Please compile grpc with _WIN32_WINNT of at least 0x600 (aka Windows Vista)"
59 #else /* !defined(_WIN32_WINNT) */
60 #if (_WIN32_WINNT < 0x0600)
62 "Please compile grpc with _WIN32_WINNT of at least 0x600 (aka Windows Vista)"
63 #endif /* _WIN32_WINNT < 0x0600 */
64 #endif /* defined(_WIN32_WINNT) */
66 #ifdef GRPC_WIN32_LEAN_AND_MEAN_WAS_NOT_DEFINED
67 #undef GRPC_WIN32_LEAN_AND_MEAN_WAS_NOT_DEFINED
68 #undef WIN32_LEAN_AND_MEAN
69 #endif /* GRPC_WIN32_LEAN_AND_MEAN_WAS_NOT_DEFINED */
71 #ifdef GRPC_NOMINMAX_WAS_NOT_DEFINED
72 #undef GRPC_NOMINMAX_WAS_NOT_DEFINED
74 #endif /* GRPC_WIN32_LEAN_AND_MEAN_WAS_NOT_DEFINED */
75 #endif /* defined(_WIN64) || defined(WIN64) || defined(_WIN32) || \
78 /* Override this file with one for your platform if you need to redefine
81 #if !defined(GPR_NO_AUTODETECT_PLATFORM)
82 #if defined(_WIN64) || defined(WIN64) || defined(_WIN32) || defined(WIN32)
83 #if defined(_WIN64) || defined(WIN64)
88 #define GPR_PLATFORM_STRING "windows"
90 #define GPR_WINDOWS_SUBPROCESS 1
91 #define GPR_WINDOWS_ENV
93 #define GPR_GETPID_IN_UNISTD_H 1
94 #define GPR_MSYS_TMPFILE
96 #define GPR_POSIX_STRING
97 #define GPR_POSIX_TIME
99 #define GPR_GETPID_IN_PROCESS_H 1
100 #define GPR_WINDOWS_TMPFILE
101 #define GPR_WINDOWS_LOG
102 #define GPR_WINDOWS_CRASH_HANDLER 1
103 #define GPR_WINDOWS_STAT
104 #define GPR_WINDOWS_STRING
105 #define GPR_WINDOWS_TIME
108 #define GPR_GCC_ATOMIC 1
110 #define GPR_WINDOWS_ATOMIC 1
112 #define GPR_STDCPP_TLS 1
113 #elif defined(ANDROID) || defined(__ANDROID__)
114 #define GPR_PLATFORM_STRING "android"
115 #define GPR_ANDROID 1
116 // TODO(apolcyn): re-evaluate support for c-ares
117 // on android after upgrading our c-ares dependency.
118 // See https://github.com/grpc/grpc/issues/18038.
121 #define GPR_ARCH_64 1
123 #define GPR_ARCH_32 1
125 #define GPR_CPU_POSIX 1
126 #define GPR_GCC_SYNC 1
127 #define GPR_STDCPP_TLS 1
128 #define GPR_POSIX_ENV 1
129 #define GPR_POSIX_TMPFILE 1
130 #define GPR_POSIX_STAT 1
131 #define GPR_ANDROID_LOG 1
132 #define GPR_POSIX_STRING 1
133 #define GPR_POSIX_SUBPROCESS 1
134 #define GPR_POSIX_SYNC 1
135 #define GPR_POSIX_TIME 1
136 #define GPR_HAS_PTHREAD_H 1
137 #define GPR_GETPID_IN_UNISTD_H 1
138 #define GPR_SUPPORT_CHANNELS_FROM_FD 1
139 #elif defined(__linux__)
140 #define GPR_PLATFORM_STRING "linux"
144 #ifndef _DEFAULT_SOURCE
145 #define _DEFAULT_SOURCE
150 #include <features.h>
151 #define GPR_CPU_LINUX 1
152 #define GPR_GCC_ATOMIC 1
153 #define GPR_STDCPP_TLS 1
155 #define GPR_LINUX_LOG
156 #define GPR_SUPPORT_CHANNELS_FROM_FD 1
157 #define GPR_LINUX_ENV 1
158 #define GPR_POSIX_TMPFILE 1
159 #define GPR_POSIX_STAT 1
160 #define GPR_POSIX_STRING 1
161 #define GPR_POSIX_SUBPROCESS 1
162 #define GPR_POSIX_SYNC 1
163 #define GPR_POSIX_TIME 1
164 #define GPR_HAS_PTHREAD_H 1
165 #define GPR_GETPID_IN_UNISTD_H 1
167 #define GPR_ARCH_64 1
169 #define GPR_ARCH_32 1
172 #define GPR_POSIX_CRASH_HANDLER 1
173 #define GPR_LINUX_PTHREAD_NAME 1
174 #include <linux/version.h>
175 #else /* musl libc */
176 #define GPR_MUSL_LIBC_COMPAT 1
178 #elif defined(__ASYLO__)
179 #define GPR_ARCH_64 1
180 #define GPR_CPU_POSIX 1
181 #define GPR_GCC_TLS 1
182 #define GPR_PLATFORM_STRING "asylo"
183 #define GPR_GCC_SYNC 1
184 #define GPR_POSIX_SYNC 1
185 #define GPR_POSIX_STRING 1
186 #define GPR_POSIX_LOG 1
187 #define GPR_POSIX_TIME 1
188 #define GPR_POSIX_ENV 1
190 #define GRPC_POSIX_SOCKET 1
191 #define GRPC_POSIX_SOCKETADDR
192 #define GRPC_POSIX_SOCKETUTILS 1
193 #define GRPC_TIMER_USE_GENERIC 1
194 #define GRPC_POSIX_NO_SPECIAL_WAKEUP_FD 1
195 #define GRPC_POSIX_WAKEUP_FD 1
197 #define GPR_NO_AUTODETECT_PLATFORM 1
198 #elif defined(__APPLE__)
199 #include <Availability.h>
200 #include <TargetConditionals.h>
205 #define GPR_PLATFORM_STRING "ios"
206 #define GPR_CPU_IPHONE 1
207 #define GRPC_CFSTREAM 1
208 /* the c-ares resolver isn't safe to enable on iOS */
210 #else /* TARGET_OS_IPHONE */
211 #define GPR_PLATFORM_STRING "osx"
212 #define GPR_CPU_POSIX 1
213 #define GPR_POSIX_CRASH_HANDLER 1
216 #if __has_feature(cxx_thread_local)
217 #define GPR_STDCPP_TLS 1
220 #ifndef GPR_STDCPP_TLS
221 #define GPR_PTHREAD_TLS 1
224 #define GPR_GCC_ATOMIC 1
225 #define GPR_POSIX_LOG 1
226 #define GPR_POSIX_ENV 1
227 #define GPR_POSIX_TMPFILE 1
228 #define GPR_POSIX_STAT 1
229 #define GPR_POSIX_STRING 1
230 #define GPR_POSIX_SUBPROCESS 1
231 #define GPR_POSIX_SYNC 1
232 #define GPR_POSIX_TIME 1
233 #define GPR_HAS_PTHREAD_H 1
234 #define GPR_GETPID_IN_UNISTD_H 1
235 #ifndef GRPC_CFSTREAM
236 #define GPR_SUPPORT_CHANNELS_FROM_FD 1
239 #define GPR_ARCH_64 1
241 #define GPR_ARCH_32 1
243 #elif defined(__FreeBSD__)
244 #define GPR_PLATFORM_STRING "freebsd"
248 #define GPR_FREEBSD 1
249 #define GPR_CPU_POSIX 1
250 #define GPR_GCC_ATOMIC 1
251 #define GPR_GCC_TLS 1
252 #define GPR_POSIX_LOG 1
253 #define GPR_POSIX_ENV 1
254 #define GPR_POSIX_TMPFILE 1
255 #define GPR_POSIX_STAT 1
256 #define GPR_POSIX_STRING 1
257 #define GPR_POSIX_SUBPROCESS 1
258 #define GPR_POSIX_SYNC 1
259 #define GPR_POSIX_TIME 1
260 #define GPR_HAS_PTHREAD_H 1
261 #define GPR_GETPID_IN_UNISTD_H 1
262 #define GPR_SUPPORT_CHANNELS_FROM_FD 1
264 #define GPR_ARCH_64 1
266 #define GPR_ARCH_32 1
268 #elif defined(__OpenBSD__)
269 #define GPR_PLATFORM_STRING "openbsd"
273 #define GPR_OPENBSD 1
274 #define GPR_CPU_POSIX 1
275 #define GPR_GCC_ATOMIC 1
276 #define GPR_GCC_TLS 1
277 #define GPR_POSIX_LOG 1
278 #define GPR_POSIX_ENV 1
279 #define GPR_POSIX_TMPFILE 1
280 #define GPR_POSIX_STAT 1
281 #define GPR_POSIX_STRING 1
282 #define GPR_POSIX_SUBPROCESS 1
283 #define GPR_POSIX_SYNC 1
284 #define GPR_POSIX_TIME 1
285 #define GPR_HAS_PTHREAD_H 1
286 #define GPR_GETPID_IN_UNISTD_H 1
287 #define GPR_SUPPORT_CHANNELS_FROM_FD 1
289 #define GPR_ARCH_64 1
291 #define GPR_ARCH_32 1
293 #elif defined(__sun) && defined(__SVR4)
294 #define GPR_PLATFORM_STRING "solaris"
295 #define GPR_SOLARIS 1
296 #define GPR_CPU_POSIX 1
297 #define GPR_GCC_ATOMIC 1
298 #define GPR_GCC_TLS 1
299 #define GPR_POSIX_LOG 1
300 #define GPR_POSIX_ENV 1
301 #define GPR_POSIX_TMPFILE 1
302 #define GPR_POSIX_STAT 1
303 #define GPR_POSIX_STRING 1
304 #define GPR_POSIX_SUBPROCESS 1
305 #define GPR_POSIX_SYNC 1
306 #define GPR_POSIX_TIME 1
307 #define GPR_HAS_PTHREAD_H 1
308 #define GPR_GETPID_IN_UNISTD_H 1
310 #define GPR_ARCH_64 1
312 #define GPR_ARCH_32 1
315 #define GPR_PLATFORM_STRING "aix"
320 #define GPR_CPU_POSIX 1
321 #define GPR_GCC_ATOMIC 1
322 #define GPR_GCC_TLS 1
323 #define GPR_POSIX_LOG 1
324 #define GPR_POSIX_ENV 1
325 #define GPR_POSIX_TMPFILE 1
326 #define GPR_POSIX_STAT 1
327 #define GPR_POSIX_STRING 1
328 #define GPR_POSIX_SUBPROCESS 1
329 #define GPR_POSIX_SYNC 1
330 #define GPR_POSIX_TIME 1
331 #define GPR_HAS_PTHREAD_H 1
332 #define GPR_GETPID_IN_UNISTD_H 1
334 #define GPR_ARCH_64 1
336 #define GPR_ARCH_32 1
338 #elif defined(__native_client__)
339 #define GPR_PLATFORM_STRING "nacl"
343 #ifndef _DEFAULT_SOURCE
344 #define _DEFAULT_SOURCE
350 #define GPR_CPU_POSIX 1
351 #define GPR_GCC_ATOMIC 1
352 #define GPR_GCC_TLS 1
353 #define GPR_POSIX_LOG 1
354 #define GPR_POSIX_ENV 1
355 #define GPR_POSIX_TMPFILE 1
356 #define GPR_POSIX_STAT 1
357 #define GPR_POSIX_STRING 1
358 #define GPR_POSIX_SUBPROCESS 1
359 #define GPR_POSIX_SYNC 1
360 #define GPR_POSIX_TIME 1
361 #define GPR_HAS_PTHREAD_H 1
362 #define GPR_GETPID_IN_UNISTD_H 1
364 #define GPR_ARCH_64 1
366 #define GPR_ARCH_32 1
368 #elif defined(__Fuchsia__)
369 #define GPR_FUCHSIA 1
370 #define GPR_ARCH_64 1
371 #define GPR_PLATFORM_STRING "fuchsia"
372 #include <features.h>
373 // Specifying musl libc affects wrap_memcpy.c. It causes memmove() to be
375 #define GPR_MUSL_LIBC_COMPAT 1
376 #define GPR_CPU_POSIX 1
377 #define GPR_GCC_ATOMIC 1
378 #define GPR_PTHREAD_TLS 1
379 #define GPR_POSIX_LOG 1
380 #define GPR_POSIX_SYNC 1
381 #define GPR_POSIX_ENV 1
382 #define GPR_POSIX_TMPFILE 1
383 #define GPR_POSIX_STAT 1
384 #define GPR_POSIX_SUBPROCESS 1
385 #define GPR_POSIX_SYNC 1
386 #define GPR_POSIX_STRING 1
387 #define GPR_POSIX_TIME 1
388 #define GPR_HAS_PTHREAD_H 1
389 #define GPR_GETPID_IN_UNISTD_H 1
391 #error "Could not auto-detect platform"
393 #endif /* GPR_NO_AUTODETECT_PLATFORM */
395 #if defined(GPR_BACKWARDS_COMPATIBILITY_MODE)
397 * For backward compatibility mode, reset _FORTIFY_SOURCE to prevent
398 * a library from having non-standard symbols such as __asprintf_chk.
399 * This helps non-glibc systems such as alpine using musl to find symbols.
401 #if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0
402 #undef _FORTIFY_SOURCE
403 #define _FORTIFY_SOURCE 0
407 #if defined(__has_include)
408 #if __has_include(<atomic>)
409 #define GRPC_HAS_CXX11_ATOMIC
410 #endif /* __has_include(<atomic>) */
411 #endif /* defined(__has_include) */
413 #ifndef GPR_PLATFORM_STRING
414 #warning "GPR_PLATFORM_STRING not auto-detected"
415 #define GPR_PLATFORM_STRING "unknown"
419 #undef GPR_FORBID_UNREACHABLE_CODE
420 #define GPR_FORBID_UNREACHABLE_CODE 1
425 typedef __int8 int8_t;
426 typedef __int16 int16_t;
427 typedef __int32 int32_t;
428 typedef __int64 int64_t;
429 typedef unsigned __int8 uint8_t;
430 typedef unsigned __int16 uint16_t;
431 typedef unsigned __int32 uint32_t;
432 typedef unsigned __int64 uint64_t;
435 #endif /* _MSC_VER < 1700 */
438 #endif /* _MSC_VER */
440 /* Type of cycle clock implementation */
442 /* Disable cycle clock by default.
443 TODO(soheil): enable when we support fallback for unstable cycle clocks.
444 #if defined(__i386__)
445 #define GPR_CYCLE_COUNTER_RDTSC_32 1
446 #elif defined(__x86_64__) || defined(__amd64__)
447 #define GPR_CYCLE_COUNTER_RDTSC_64 1
449 #define GPR_CYCLE_COUNTER_FALLBACK 1
452 #define GPR_CYCLE_COUNTER_FALLBACK 1
454 #define GPR_CYCLE_COUNTER_FALLBACK 1
455 #endif /* GPR_LINUX */
457 /* Cache line alignment */
458 #ifndef GPR_CACHELINE_SIZE_LOG
459 #if defined(__i386__) || defined(__x86_64__)
460 #define GPR_CACHELINE_SIZE_LOG 6
462 #ifndef GPR_CACHELINE_SIZE_LOG
463 /* A reasonable default guess. Note that overestimates tend to waste more
464 space, while underestimates tend to waste more time. */
465 #define GPR_CACHELINE_SIZE_LOG 6
466 #endif /* GPR_CACHELINE_SIZE_LOG */
467 #endif /* GPR_CACHELINE_SIZE_LOG */
469 #define GPR_CACHELINE_SIZE (1 << GPR_CACHELINE_SIZE_LOG)
471 /* scrub GCC_ATOMIC if it's not available on this compiler */
472 #if defined(GPR_GCC_ATOMIC) && !defined(__ATOMIC_RELAXED)
473 #undef GPR_GCC_ATOMIC
474 #define GPR_GCC_SYNC 1
477 /* Validate platform combinations */
478 #if defined(GPR_GCC_ATOMIC) + defined(GPR_GCC_SYNC) + \
479 defined(GPR_WINDOWS_ATOMIC) != \
481 #error Must define exactly one of GPR_GCC_ATOMIC, GPR_GCC_SYNC, GPR_WINDOWS_ATOMIC
484 #if defined(GPR_ARCH_32) + defined(GPR_ARCH_64) != 1
485 #error Must define exactly one of GPR_ARCH_32, GPR_ARCH_64
488 #if defined(GPR_CPU_LINUX) + defined(GPR_CPU_POSIX) + defined(GPR_WINDOWS) + \
489 defined(GPR_CPU_IPHONE) + defined(GPR_CPU_CUSTOM) != \
491 #error Must define exactly one of GPR_CPU_LINUX, GPR_CPU_POSIX, GPR_WINDOWS, GPR_CPU_IPHONE, GPR_CPU_CUSTOM
494 #if defined(GPR_MSVC_TLS) + defined(GPR_GCC_TLS) + defined(GPR_PTHREAD_TLS) + \
495 defined(GPR_STDCPP_TLS) + defined(GPR_CUSTOM_TLS) != \
497 #error Must define exactly one of GPR_MSVC_TLS, GPR_GCC_TLS, GPR_PTHREAD_TLS, GPR_STDCPP_TLS, GPR_CUSTOM_TLS
500 /* maximum alignment needed for any type on this platform, rounded up to a
502 #define GPR_MAX_ALIGNMENT 16
508 #ifndef GRPC_IF_NAMETOINDEX
509 #define GRPC_IF_NAMETOINDEX 1
512 #ifndef GRPC_MUST_USE_RESULT
513 #if defined(__GNUC__) && !defined(__MINGW32__)
514 #define GRPC_MUST_USE_RESULT __attribute__((warn_unused_result))
515 #define GPR_ALIGN_STRUCT(n) __attribute__((aligned(n)))
517 #define GRPC_MUST_USE_RESULT
518 #define GPR_ALIGN_STRUCT(n)
523 #if defined(__GNUC__) && !defined(__MINGW32__)
524 #define GRPC_UNUSED __attribute__((unused))
530 #ifndef GPR_PRINT_FORMAT_CHECK
532 #define GPR_PRINT_FORMAT_CHECK(FORMAT_STR, ARGS) \
533 __attribute__((format(printf, FORMAT_STR, ARGS)))
535 #define GPR_PRINT_FORMAT_CHECK(FORMAT_STR, ARGS)
537 #endif /* GPR_PRINT_FORMAT_CHECK */
539 #if GPR_FORBID_UNREACHABLE_CODE
540 #define GPR_UNREACHABLE_CODE(STATEMENT)
542 #define GPR_UNREACHABLE_CODE(STATEMENT) \
544 gpr_log(GPR_ERROR, "Should never reach here."); \
548 #endif /* GPR_FORBID_UNREACHABLE_CODE */
555 #define GRPCAPI GPRAPI
559 #define CENSUSAPI GRPCAPI
562 #ifndef GPR_HAS_ATTRIBUTE
563 #ifdef __has_attribute
564 #define GPR_HAS_ATTRIBUTE(a) __has_attribute(a)
566 #define GPR_HAS_ATTRIBUTE(a) 0
568 #endif /* GPR_HAS_ATTRIBUTE */
570 #ifndef GPR_HAS_FEATURE
572 #define GPR_HAS_FEATURE(a) __has_feature(a)
574 #define GPR_HAS_FEATURE(a) 0
576 #endif /* GPR_HAS_FEATURE */
578 #ifndef GPR_ATTRIBUTE_NOINLINE
579 #if GPR_HAS_ATTRIBUTE(noinline) || (defined(__GNUC__) && !defined(__clang__))
580 #define GPR_ATTRIBUTE_NOINLINE __attribute__((noinline))
581 #define GPR_HAS_ATTRIBUTE_NOINLINE 1
583 #define GPR_ATTRIBUTE_NOINLINE
585 #endif /* GPR_ATTRIBUTE_NOINLINE */
587 #ifndef GPR_ATTRIBUTE_WEAK
588 /* Attribute weak is broken on LLVM/windows:
589 * https://bugs.llvm.org/show_bug.cgi?id=37598 */
590 #if (GPR_HAS_ATTRIBUTE(weak) || (defined(__GNUC__) && !defined(__clang__))) && \
591 !(defined(__llvm__) && defined(_WIN32))
592 #define GPR_ATTRIBUTE_WEAK __attribute__((weak))
593 #define GPR_HAS_ATTRIBUTE_WEAK 1
595 #define GPR_ATTRIBUTE_WEAK
597 #endif /* GPR_ATTRIBUTE_WEAK */
599 #ifndef GPR_ATTRIBUTE_NO_TSAN /* (1) */
600 #if GPR_HAS_FEATURE(thread_sanitizer)
601 #define GPR_ATTRIBUTE_NO_TSAN __attribute__((no_sanitize("thread")))
602 #endif /* GPR_HAS_FEATURE */
603 #ifndef GPR_ATTRIBUTE_NO_TSAN /* (2) */
604 #define GPR_ATTRIBUTE_NO_TSAN
605 #endif /* GPR_ATTRIBUTE_NO_TSAN (2) */
606 #endif /* GPR_ATTRIBUTE_NO_TSAN (1) */
608 /* GRPC_TSAN_ENABLED will be defined, when compiled with thread sanitizer. */
609 #ifndef GRPC_TSAN_SUPPRESSED
610 #if defined(__SANITIZE_THREAD__)
611 #define GRPC_TSAN_ENABLED
612 #elif GPR_HAS_FEATURE(thread_sanitizer)
613 #define GRPC_TSAN_ENABLED
617 /* GRPC_ASAN_ENABLED will be defined, when compiled with address sanitizer. */
618 #ifndef GRPC_ASAN_SUPPRESSED
619 #if defined(__SANITIZE_ADDRESS__)
620 #define GRPC_ASAN_ENABLED
621 #elif GPR_HAS_FEATURE(address_sanitizer)
622 #define GRPC_ASAN_ENABLED
626 /* GRPC_ALLOW_EXCEPTIONS should be 0 or 1 if exceptions are allowed or not */
627 #ifndef GRPC_ALLOW_EXCEPTIONS
629 #if defined(_MSC_VER) && defined(_CPPUNWIND)
630 #define GRPC_ALLOW_EXCEPTIONS 1
631 #elif defined(__EXCEPTIONS)
632 #define GRPC_ALLOW_EXCEPTIONS 1
634 #define GRPC_ALLOW_EXCEPTIONS 0
636 #else /* GPR_WINDOWS */
638 #define GRPC_ALLOW_EXCEPTIONS 1
639 #else /* __EXCEPTIONS */
640 #define GRPC_ALLOW_EXCEPTIONS 0
641 #endif /* __EXCEPTIONS */
642 #endif /* __GPR_WINDOWS */
643 #endif /* GRPC_ALLOW_EXCEPTIONS */
645 /* Use GPR_LIKELY only in cases where you are sure that a certain outcome is the
646 * most likely. Ideally, also collect performance numbers to justify the claim.
649 #define GPR_LIKELY(x) __builtin_expect((x), 1)
650 #define GPR_UNLIKELY(x) __builtin_expect((x), 0)
652 #define GPR_LIKELY(x) (x)
653 #define GPR_UNLIKELY(x) (x)
654 #endif /* __GNUC__ */
656 #ifndef __STDC_FORMAT_MACROS
657 #define __STDC_FORMAT_MACROS
660 #endif /* GRPC_IMPL_CODEGEN_PORT_PLATFORM_H */