diff options
author | Vijay Pai <vpai@google.com> | 2017-12-19 09:09:52 -0800 |
---|---|---|
committer | Vijay Pai <vpai@google.com> | 2018-01-08 15:12:55 -0800 |
commit | 9809ce38e9f79b4e9a0b1ec1c076cce0beee1e98 (patch) | |
tree | cc5c3b950d119399570724fa705042a69092257e /include/grpc/impl/codegen/port_platform.h | |
parent | 9427eabf3bf9f1de14a3fabdc72e090dac7601e1 (diff) |
Use appropriate preprocessor guards to allow building without exceptions
Diffstat (limited to 'include/grpc/impl/codegen/port_platform.h')
-rw-r--r-- | include/grpc/impl/codegen/port_platform.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/grpc/impl/codegen/port_platform.h b/include/grpc/impl/codegen/port_platform.h index e6bee73ef1..becb16b5b8 100644 --- a/include/grpc/impl/codegen/port_platform.h +++ b/include/grpc/impl/codegen/port_platform.h @@ -477,6 +477,21 @@ typedef unsigned __int64 uint64_t; #endif /* GPR_ATTRIBUTE_NO_TSAN (2) */ #endif /* GPR_ATTRIBUTE_NO_TSAN (1) */ +/* GRPC_ALLOW_EXCEPTIONS should be 0 or 1 if exceptions are allowed or not */ +#ifndef GRPC_ALLOW_EXCEPTIONS +/* If not already set, set to 1 on Windows (style guide standard) but to + * 0 on non-Windows platforms unless the compiler defines __EXCEPTIONS */ +#ifdef GPR_WINDOWS +#define GRPC_ALLOW_EXCEPTIONS 1 +#else +#ifdef __EXCEPTIONS +#define GRPC_ALLOW_EXCEPTIONS 1 +#else +#define GRPC_ALLOW_EXCEPTIONS 0 +#endif +#endif +#endif + #ifndef __STDC_FORMAT_MACROS #define __STDC_FORMAT_MACROS #endif |