blob: d2d9ac780840d2c96b4cfea23eb6bf469c2e5bbb [file] [log] [blame]
David Garcia Quintas08a0a332016-01-21 01:04:36 -08001/*
2 *
Craig Tiller6169d5f2016-03-31 07:46:18 -07003 * Copyright 2015, Google Inc.
David Garcia Quintas08a0a332016-01-21 01:04:36 -08004 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
8 * met:
9 *
10 * * Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * * Redistributions in binary form must reproduce the above
13 * copyright notice, this list of conditions and the following disclaimer
14 * in the documentation and/or other materials provided with the
15 * distribution.
16 * * Neither the name of Google Inc. nor the names of its
17 * contributors may be used to endorse or promote products derived from
18 * this software without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 *
32 */
33
34#ifndef GRPC_IMPL_CODEGEN_PORT_PLATFORM_H
35#define GRPC_IMPL_CODEGEN_PORT_PLATFORM_H
36
Craig Tiller71ea4a12016-02-04 15:06:41 -080037/*
38 * Define GPR_BACKWARDS_COMPATIBILITY_MODE to try harder to be ABI
39 * compatible with older platforms (currently only on Linux)
40 * Causes:
41 * - some libc calls to be gotten via dlsym
42 * - some syscalls to be made directly
43 */
44
David Garcia Quintas08a0a332016-01-21 01:04:36 -080045/* Get windows.h included everywhere (we need it) */
46#if defined(_WIN64) || defined(WIN64) || defined(_WIN32) || defined(WIN32)
47#ifndef WIN32_LEAN_AND_MEAN
48#define GRPC_WIN32_LEAN_AND_MEAN_WAS_NOT_DEFINED
49#define WIN32_LEAN_AND_MEAN
50#endif /* WIN32_LEAN_AND_MEAN */
51
52#ifndef NOMINMAX
53#define GRPC_NOMINMX_WAS_NOT_DEFINED
54#define NOMINMAX
55#endif /* NOMINMAX */
56
57#ifndef _WIN32_WINNT
58#error \
59 "Please compile grpc with _WIN32_WINNT of at least 0x600 (aka Windows Vista)"
60#else /* !defined(_WIN32_WINNT) */
61#if (_WIN32_WINNT < 0x0600)
62#error \
63 "Please compile grpc with _WIN32_WINNT of at least 0x600 (aka Windows Vista)"
64#endif /* _WIN32_WINNT < 0x0600 */
65#endif /* defined(_WIN32_WINNT) */
66
67#include <windows.h>
68
69#ifdef GRPC_WIN32_LEAN_AND_MEAN_WAS_NOT_DEFINED
70#undef GRPC_WIN32_LEAN_AND_MEAN_WAS_NOT_DEFINED
71#undef WIN32_LEAN_AND_MEAN
72#endif /* GRPC_WIN32_LEAN_AND_MEAN_WAS_NOT_DEFINED */
73
74#ifdef GRPC_NOMINMAX_WAS_NOT_DEFINED
75#undef GRPC_NOMINMAX_WAS_NOT_DEFINED
76#undef NOMINMAX
77#endif /* GRPC_WIN32_LEAN_AND_MEAN_WAS_NOT_DEFINED */
78#endif /* defined(_WIN64) || defined(WIN64) || defined(_WIN32) || \
79 defined(WIN32) */
80
81/* Override this file with one for your platform if you need to redefine
82 things. */
83
84#if !defined(GPR_NO_AUTODETECT_PLATFORM)
Nicolas "Pixel" Noblec4b18a52016-04-15 04:53:54 +020085#if defined(_WIN64) || defined(WIN64) || defined(_WIN32) || defined(WIN32)
David Garcia Quintas08a0a332016-01-21 01:04:36 -080086#if defined(_WIN64) || defined(WIN64)
David Garcia Quintas08a0a332016-01-21 01:04:36 -080087#define GPR_ARCH_64 1
David Garcia Quintas08a0a332016-01-21 01:04:36 -080088#else
David Garcia Quintas08a0a332016-01-21 01:04:36 -080089#define GPR_ARCH_32 1
Nicolas "Pixel" Noblec4b18a52016-04-15 04:53:54 +020090#endif
91#define GPR_PLATFORM_STRING "windows"
David Garcia Quintas08a0a332016-01-21 01:04:36 -080092#define GPR_WIN32 1
David Garcia Quintas08a0a332016-01-21 01:04:36 -080093#define GPR_WINSOCK_SOCKET 1
Nicolas "Pixel" Noble13a8f5b2016-01-31 10:06:02 +010094#define GPR_WINDOWS_SUBPROCESS 1
Nicolas "Pixel" Noblec4b18a52016-04-15 04:53:54 +020095#define GPR_WIN32_ENV
96#ifdef __MSYS__
97#define GPR_GETPID_IN_UNISTD_H 1
98#define GPR_MSYS_TMPFILE
99#define GPR_POSIX_LOG
100#define GPR_POSIX_STRING
101#define GPR_POSIX_TIME
102#else
103#define GPR_GETPID_IN_PROCESS_H 1
104#define GPR_WIN32_TMPFILE
105#define GPR_WIN32_LOG
106#define GPR_WINDOWS_CRASH_HANDLER 1
107#define GPR_WIN32_STRING
108#define GPR_WIN32_TIME
109#endif
David Garcia Quintas08a0a332016-01-21 01:04:36 -0800110#ifdef __GNUC__
111#define GPR_GCC_ATOMIC 1
112#define GPR_GCC_TLS 1
113#else
114#define GPR_WIN32_ATOMIC 1
115#define GPR_MSVC_TLS 1
116#endif
Masood Malekghassemif4c70ca2016-05-05 19:14:05 -0700117#elif defined(GPR_MANYLINUX1)
118// TODO(atash): manylinux1 is just another __linux__ but with ancient
119// libraries; it should be integrated with the `__linux__` definitions below.
120#define GPR_PLATFORM_STRING "manylinux"
121#define GPR_POSIX_CRASH_HANDLER 1
122#define GPR_CPU_LINUX 1
123#define GPR_GCC_ATOMIC 1
124#define GPR_GCC_TLS 1
125#define GPR_LINUX 1
126#define GPR_LINUX_LOG 1
127#define GPR_POSIX_SOCKET 1
128#define GPR_POSIX_WAKEUP_FD 1
129#define GPR_POSIX_SOCKETADDR 1
130#define GPR_POSIX_NO_SPECIAL_WAKEUP_FD 1
131#define GPR_POSIX_SOCKETUTILS 1
132#define GPR_HAVE_UNIX_SOCKET 1
133#define GPR_HAVE_IP_PKTINFO 1
134#define GPR_HAVE_IPV6_RECVPKTINFO 1
135#define GPR_LINUX_ENV 1
136#define GPR_POSIX_FILE 1
137#define GPR_POSIX_TMPFILE 1
138#define GPR_POSIX_STRING 1
139#define GPR_POSIX_SUBPROCESS 1
140#define GPR_POSIX_SYNC 1
141#define GPR_POSIX_TIME 1
142#define GPR_GETPID_IN_UNISTD_H 1
143#define GPR_HAVE_MSG_NOSIGNAL 1
144#ifdef _LP64
145#define GPR_ARCH_64 1
146#else /* _LP64 */
147#define GPR_ARCH_32 1
148#endif /* _LP64 */
David Garcia Quintas08a0a332016-01-21 01:04:36 -0800149#elif defined(ANDROID) || defined(__ANDROID__)
150#define GPR_PLATFORM_STRING "android"
151#define GPR_ANDROID 1
152#define GPR_ARCH_32 1
153#define GPR_CPU_LINUX 1
154#define GPR_GCC_SYNC 1
155#define GPR_GCC_TLS 1
156#define GPR_POSIX_MULTIPOLL_WITH_POLL 1
157#define GPR_POSIX_WAKEUP_FD 1
158#define GPR_LINUX_EVENTFD 1
159#define GPR_POSIX_SOCKET 1
160#define GPR_POSIX_SOCKETADDR 1
161#define GPR_POSIX_SOCKETUTILS 1
162#define GPR_POSIX_ENV 1
Nicolas "Pixel" Noblea0091cb2016-04-15 07:47:50 +0200163#define GPR_POSIX_FILE 1
Nicolas "Pixel" Noblec4b18a52016-04-15 04:53:54 +0200164#define GPR_POSIX_TMPFILE 1
165#define GPR_POSIX_LOG
David Garcia Quintas08a0a332016-01-21 01:04:36 -0800166#define GPR_POSIX_STRING 1
167#define GPR_POSIX_SUBPROCESS 1
168#define GPR_POSIX_SYNC 1
169#define GPR_POSIX_TIME 1
170#define GPR_GETPID_IN_UNISTD_H 1
171#define GPR_HAVE_MSG_NOSIGNAL 1
ahedberg803931d2016-03-11 17:24:12 -0500172#define GPR_HAVE_UNIX_SOCKET 1
ahedberg8d7cff42016-03-24 11:16:44 -0400173#define GPR_HAVE_IP_PKTINFO 1
174#define GPR_HAVE_IPV6_RECVPKTINFO 1
David Garcia Quintas08a0a332016-01-21 01:04:36 -0800175#elif defined(__linux__)
176#define GPR_POSIX_CRASH_HANDLER 1
177#define GPR_PLATFORM_STRING "linux"
178#ifndef _BSD_SOURCE
179#define _BSD_SOURCE
180#endif
181#ifndef _DEFAULT_SOURCE
182#define _DEFAULT_SOURCE
183#endif
184#ifndef _GNU_SOURCE
185#define _GNU_SOURCE
186#endif
187#include <features.h>
188#define GPR_CPU_LINUX 1
189#define GPR_GCC_ATOMIC 1
190#define GPR_GCC_TLS 1
191#define GPR_LINUX 1
Nicolas "Pixel" Noblec4b18a52016-04-15 04:53:54 +0200192#define GPR_LINUX_LOG
David Garcia Quintas08a0a332016-01-21 01:04:36 -0800193#define GPR_LINUX_MULTIPOLL_WITH_EPOLL 1
194#define GPR_POSIX_WAKEUP_FD 1
195#define GPR_POSIX_SOCKET 1
196#define GPR_POSIX_SOCKETADDR 1
ahedberg803931d2016-03-11 17:24:12 -0500197#define GPR_HAVE_UNIX_SOCKET 1
ahedberg8d7cff42016-03-24 11:16:44 -0400198#define GPR_HAVE_IP_PKTINFO 1
199#define GPR_HAVE_IPV6_RECVPKTINFO 1
David Garcia Quintas08a0a332016-01-21 01:04:36 -0800200#ifdef __GLIBC_PREREQ
201#if __GLIBC_PREREQ(2, 9)
202#define GPR_LINUX_EVENTFD 1
203#endif
204#if __GLIBC_PREREQ(2, 10)
205#define GPR_LINUX_SOCKETUTILS 1
206#endif
Craig Tiller9828aad2016-02-01 14:07:34 -0800207#endif
David Garcia Quintas08a0a332016-01-21 01:04:36 -0800208#define GPR_LINUX_ENV 1
David Garcia Quintas08a0a332016-01-21 01:04:36 -0800209#ifndef GPR_LINUX_EVENTFD
210#define GPR_POSIX_NO_SPECIAL_WAKEUP_FD 1
211#endif
212#ifndef GPR_LINUX_SOCKETUTILS
213#define GPR_POSIX_SOCKETUTILS
214#endif
Nicolas "Pixel" Noblea0091cb2016-04-15 07:47:50 +0200215#define GPR_POSIX_FILE 1
Nicolas "Pixel" Noblec4b18a52016-04-15 04:53:54 +0200216#define GPR_POSIX_TMPFILE 1
David Garcia Quintas08a0a332016-01-21 01:04:36 -0800217#define GPR_POSIX_STRING 1
218#define GPR_POSIX_SUBPROCESS 1
219#define GPR_POSIX_SYNC 1
220#define GPR_POSIX_TIME 1
221#define GPR_GETPID_IN_UNISTD_H 1
222#define GPR_HAVE_MSG_NOSIGNAL 1
223#ifdef _LP64
224#define GPR_ARCH_64 1
225#else /* _LP64 */
226#define GPR_ARCH_32 1
227#endif /* _LP64 */
228#elif defined(__APPLE__)
229#include <TargetConditionals.h>
230#ifndef _BSD_SOURCE
231#define _BSD_SOURCE
232#endif
233#define GPR_MSG_IOVLEN_TYPE int
234#if TARGET_OS_IPHONE
235#define GPR_FORBID_UNREACHABLE_CODE 1
236#define GPR_PLATFORM_STRING "ios"
237#define GPR_CPU_IPHONE 1
238#define GPR_PTHREAD_TLS 1
239#else /* TARGET_OS_IPHONE */
240#define GPR_PLATFORM_STRING "osx"
241#define GPR_CPU_POSIX 1
242#define GPR_GCC_TLS 1
243#define GPR_POSIX_CRASH_HANDLER 1
244#endif
245#define GPR_GCC_ATOMIC 1
246#define GPR_POSIX_LOG 1
247#define GPR_POSIX_MULTIPOLL_WITH_POLL 1
248#define GPR_POSIX_WAKEUP_FD 1
249#define GPR_POSIX_NO_SPECIAL_WAKEUP_FD 1
250#define GPR_POSIX_SOCKET 1
251#define GPR_POSIX_SOCKETADDR 1
252#define GPR_POSIX_SOCKETUTILS 1
253#define GPR_POSIX_ENV 1
Nicolas "Pixel" Noblea0091cb2016-04-15 07:47:50 +0200254#define GPR_POSIX_FILE 1
Nicolas "Pixel" Noblec4b18a52016-04-15 04:53:54 +0200255#define GPR_POSIX_TMPFILE 1
David Garcia Quintas08a0a332016-01-21 01:04:36 -0800256#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_GETPID_IN_UNISTD_H 1
261#define GPR_HAVE_SO_NOSIGPIPE 1
ahedberg803931d2016-03-11 17:24:12 -0500262#define GPR_HAVE_UNIX_SOCKET 1
ahedberg8d7cff42016-03-24 11:16:44 -0400263#define GPR_HAVE_IP_PKTINFO 1
David Garcia Quintas08a0a332016-01-21 01:04:36 -0800264#ifdef _LP64
265#define GPR_ARCH_64 1
266#else /* _LP64 */
267#define GPR_ARCH_32 1
268#endif /* _LP64 */
269#elif defined(__FreeBSD__)
270#define GPR_PLATFORM_STRING "freebsd"
271#ifndef _BSD_SOURCE
272#define _BSD_SOURCE
273#endif
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_MULTIPOLL_WITH_POLL 1
279#define GPR_POSIX_WAKEUP_FD 1
280#define GPR_POSIX_NO_SPECIAL_WAKEUP_FD 1
281#define GPR_POSIX_SOCKET 1
282#define GPR_POSIX_SOCKETADDR 1
283#define GPR_POSIX_SOCKETUTILS 1
284#define GPR_POSIX_ENV 1
Nicolas "Pixel" Noblea0091cb2016-04-15 07:47:50 +0200285#define GPR_POSIX_FILE 1
Nicolas "Pixel" Noblec4b18a52016-04-15 04:53:54 +0200286#define GPR_POSIX_TMPFILE 1
David Garcia Quintas08a0a332016-01-21 01:04:36 -0800287#define GPR_POSIX_STRING 1
288#define GPR_POSIX_SUBPROCESS 1
289#define GPR_POSIX_SYNC 1
290#define GPR_POSIX_TIME 1
291#define GPR_GETPID_IN_UNISTD_H 1
292#define GPR_HAVE_SO_NOSIGPIPE 1
ahedberg803931d2016-03-11 17:24:12 -0500293#define GPR_HAVE_UNIX_SOCKET 1
ahedberg8d7cff42016-03-24 11:16:44 -0400294#define GPR_HAVE_IP_PKTINFO 1
295#define GPR_HAVE_IPV6_RECVPKTINFO 1
David Garcia Quintas08a0a332016-01-21 01:04:36 -0800296#ifdef _LP64
297#define GPR_ARCH_64 1
298#else /* _LP64 */
299#define GPR_ARCH_32 1
300#endif /* _LP64 */
Sam Clegg8ec33f02016-02-02 17:44:55 -0800301#elif defined(__native_client__)
302#define GPR_PLATFORM_STRING "nacl"
303#ifndef _BSD_SOURCE
304#define _BSD_SOURCE
305#endif
306#ifndef _DEFAULT_SOURCE
307#define _DEFAULT_SOURCE
308#endif
309#ifndef _GNU_SOURCE
310#define _GNU_SOURCE
311#endif
312#define GPR_CPU_POSIX 1
313#define GPR_GCC_ATOMIC 1
314#define GPR_GCC_TLS 1
315#define GPR_POSIX_LOG 1
316#define GPR_POSIX_MULTIPOLL_WITH_POLL 1
317#define GPR_POSIX_WAKEUP_FD 1
318#define GPR_POSIX_NO_SPECIAL_WAKEUP_FD 1
319#define GPR_POSIX_SOCKET 1
320#define GPR_POSIX_SOCKETADDR 1
321#define GPR_POSIX_SOCKETUTILS 1
322#define GPR_POSIX_ENV 1
Nicolas "Pixel" Noblea0091cb2016-04-15 07:47:50 +0200323#define GPR_POSIX_FILE 1
Nicolas "Pixel" Noblec4b18a52016-04-15 04:53:54 +0200324#define GPR_POSIX_TMPFILE 1
Sam Clegg8ec33f02016-02-02 17:44:55 -0800325#define GPR_POSIX_STRING 1
326#define GPR_POSIX_SUBPROCESS 1
327#define GPR_POSIX_SYNC 1
328#define GPR_POSIX_TIME 1
329#define GPR_GETPID_IN_UNISTD_H 1
330#ifdef _LP64
331#define GPR_ARCH_64 1
332#else /* _LP64 */
333#define GPR_ARCH_32 1
334#endif /* _LP64 */
David Garcia Quintas08a0a332016-01-21 01:04:36 -0800335#else
Sam Clegg8ec33f02016-02-02 17:44:55 -0800336#error "Could not auto-detect platform"
David Garcia Quintas08a0a332016-01-21 01:04:36 -0800337#endif
338#endif /* GPR_NO_AUTODETECT_PLATFORM */
339
340#ifndef GPR_PLATFORM_STRING
341#warning "GPR_PLATFORM_STRING not auto-detected"
342#define GPR_PLATFORM_STRING "unknown"
343#endif
344
345#ifdef GPR_GCOV
346#undef GPR_FORBID_UNREACHABLE_CODE
347#define GPR_FORBID_UNREACHABLE_CODE 1
348#endif
349
Nicolas "Pixel" Noble221c9c72016-02-04 18:05:17 +0100350#ifdef _MSC_VER
351#if _MSC_VER < 1700
352typedef __int8 int8_t;
353typedef __int16 int16_t;
354typedef __int32 int32_t;
355typedef __int64 int64_t;
356typedef unsigned __int8 uint8_t;
357typedef unsigned __int16 uint16_t;
358typedef unsigned __int32 uint32_t;
359typedef unsigned __int64 uint64_t;
360#else
361#include <stdint.h>
362#endif /* _MSC_VER < 1700 */
363#else
364#include <stdint.h>
365#endif /* _MSC_VER */
366
David Garcia Quintas08a0a332016-01-21 01:04:36 -0800367/* Cache line alignment */
368#ifndef GPR_CACHELINE_SIZE_LOG
369#if defined(__i386__) || defined(__x86_64__)
370#define GPR_CACHELINE_SIZE_LOG 6
371#endif
372#ifndef GPR_CACHELINE_SIZE_LOG
373/* A reasonable default guess. Note that overestimates tend to waste more
374 space, while underestimates tend to waste more time. */
375#define GPR_CACHELINE_SIZE_LOG 6
376#endif /* GPR_CACHELINE_SIZE_LOG */
377#endif /* GPR_CACHELINE_SIZE_LOG */
378
379#define GPR_CACHELINE_SIZE (1 << GPR_CACHELINE_SIZE_LOG)
380
381/* scrub GCC_ATOMIC if it's not available on this compiler */
382#if defined(GPR_GCC_ATOMIC) && !defined(__ATOMIC_RELAXED)
383#undef GPR_GCC_ATOMIC
384#define GPR_GCC_SYNC 1
385#endif
386
387/* Validate platform combinations */
388#if defined(GPR_GCC_ATOMIC) + defined(GPR_GCC_SYNC) + \
389 defined(GPR_WIN32_ATOMIC) != \
390 1
391#error Must define exactly one of GPR_GCC_ATOMIC, GPR_GCC_SYNC, GPR_WIN32_ATOMIC
392#endif
393
394#if defined(GPR_ARCH_32) + defined(GPR_ARCH_64) != 1
395#error Must define exactly one of GPR_ARCH_32, GPR_ARCH_64
396#endif
397
398#if defined(GPR_CPU_LINUX) + defined(GPR_CPU_POSIX) + defined(GPR_WIN32) + \
399 defined(GPR_CPU_IPHONE) + defined(GPR_CPU_CUSTOM) != \
400 1
401#error Must define exactly one of GPR_CPU_LINUX, GPR_CPU_POSIX, GPR_WIN32, GPR_CPU_IPHONE, GPR_CPU_CUSTOM
402#endif
403
404#if defined(GPR_POSIX_MULTIPOLL_WITH_POLL) && !defined(GPR_POSIX_SOCKET)
405#error Must define GPR_POSIX_SOCKET to use GPR_POSIX_MULTIPOLL_WITH_POLL
406#endif
407
408#if defined(GPR_POSIX_SOCKET) + defined(GPR_WINSOCK_SOCKET) + \
409 defined(GPR_CUSTOM_SOCKET) != \
410 1
411#error Must define exactly one of GPR_POSIX_SOCKET, GPR_WINSOCK_SOCKET, GPR_CUSTOM_SOCKET
412#endif
413
414#if defined(GPR_MSVC_TLS) + defined(GPR_GCC_TLS) + defined(GPR_PTHREAD_TLS) + \
415 defined(GPR_CUSTOM_TLS) != \
416 1
417#error Must define exactly one of GPR_MSVC_TLS, GPR_GCC_TLS, GPR_PTHREAD_TLS, GPR_CUSTOM_TLS
418#endif
419
420/* maximum alignment needed for any type on this platform, rounded up to a
421 power of two */
422#define GPR_MAX_ALIGNMENT 16
423
424#ifndef GRPC_MUST_USE_RESULT
425#ifdef __GNUC__
426#define GRPC_MUST_USE_RESULT __attribute__((warn_unused_result))
427#else
428#define GRPC_MUST_USE_RESULT
429#endif
430#endif
431
432#if GPR_FORBID_UNREACHABLE_CODE
433#define GPR_UNREACHABLE_CODE(STATEMENT)
434#else
435#define GPR_UNREACHABLE_CODE(STATEMENT) \
436 do { \
437 gpr_log(GPR_ERROR, "Should never reach here."); \
438 abort(); \
439 STATEMENT; \
440 } while (0)
441#endif /* GPR_FORBID_UNREACHABLE_CODE */
442
Nicolas "Pixel" Noblecd41a0b2016-02-08 22:53:14 +0100443#ifndef GPRAPI
444#define GPRAPI
Craig Tiller9b426372016-01-29 07:58:22 -0800445#endif
446
Nicolas "Pixel" Noblecd41a0b2016-02-08 22:53:14 +0100447#ifndef GRPCAPI
448#define GRPCAPI GPRAPI
Craig Tiller9b426372016-01-29 07:58:22 -0800449#endif
450
Nicolas "Pixel" Noblecd41a0b2016-02-08 22:53:14 +0100451#ifndef CENSUSAPI
452#define CENSUSAPI GRPCAPI
Craig Tiller9b426372016-01-29 07:58:22 -0800453#endif
454
David Garcia Quintas08a0a332016-01-21 01:04:36 -0800455#endif /* GRPC_IMPL_CODEGEN_PORT_PLATFORM_H */