aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar Sam Clegg <sbc@google.com>2016-02-02 17:44:55 -0800
committerGravatar ahedberg <ahedberg@google.com>2016-03-14 17:18:18 -0400
commit8ec33f0b65f1ea3a2ad177e4b00542e9c92c3e1b (patch)
tree7f7e153d0d54e6a43dcec0376288b818bd786fd8 /include
parentdb3bccade402f651f5eb770aa49dc09735ece260 (diff)
Add intial plaform support for Native Client (NaCl)
The initial port to NaCl was done in the webports repository: https://chromium.googlesource.com/webports.git/+/master/ports/grpc/ In order to be buildable under NaCl outside the webports repo there are several further changes that will be needed: 1. Make AF_UNIX sockets optional 2. Make IP_PKTINFO optional 3. Make vector I/O (readv/writev) optional
Diffstat (limited to 'include')
-rw-r--r--include/grpc/impl/codegen/port_platform.h35
1 files changed, 34 insertions, 1 deletions
diff --git a/include/grpc/impl/codegen/port_platform.h b/include/grpc/impl/codegen/port_platform.h
index 92569043fc..fd55cb4582 100644
--- a/include/grpc/impl/codegen/port_platform.h
+++ b/include/grpc/impl/codegen/port_platform.h
@@ -247,8 +247,41 @@
#else /* _LP64 */
#define GPR_ARCH_32 1
#endif /* _LP64 */
+#elif defined(__native_client__)
+#define GPR_PLATFORM_STRING "nacl"
+#ifndef _BSD_SOURCE
+#define _BSD_SOURCE
+#endif
+#ifndef _DEFAULT_SOURCE
+#define _DEFAULT_SOURCE
+#endif
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
+#define GPR_CPU_POSIX 1
+#define GPR_GCC_ATOMIC 1
+#define GPR_GCC_TLS 1
+#define GPR_POSIX_LOG 1
+#define GPR_POSIX_MULTIPOLL_WITH_POLL 1
+#define GPR_POSIX_WAKEUP_FD 1
+#define GPR_POSIX_NO_SPECIAL_WAKEUP_FD 1
+#define GPR_POSIX_SOCKET 1
+#define GPR_POSIX_SOCKETADDR 1
+#define GPR_POSIX_SOCKETUTILS 1
+#define GPR_POSIX_ENV 1
+#define GPR_POSIX_FILE 1
+#define GPR_POSIX_STRING 1
+#define GPR_POSIX_SUBPROCESS 1
+#define GPR_POSIX_SYNC 1
+#define GPR_POSIX_TIME 1
+#define GPR_GETPID_IN_UNISTD_H 1
+#ifdef _LP64
+#define GPR_ARCH_64 1
+#else /* _LP64 */
+#define GPR_ARCH_32 1
+#endif /* _LP64 */
#else
-#error Could not auto-detect platform
+#error "Could not auto-detect platform"
#endif
#endif /* GPR_NO_AUTODETECT_PLATFORM */