Merge pull request #19364 from rongjiecomputer/exceptions

Properly detect C++ exception for MSVC
pull/20266/head
Juanli Shen 6 years ago committed by GitHub
commit ad8cc2d84c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      include/grpc/impl/codegen/port_platform.h

@ -655,10 +655,14 @@ typedef unsigned __int64 uint64_t;
/* 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
#if defined(_MSC_VER) && defined(_CPPUNWIND)
#define GRPC_ALLOW_EXCEPTIONS 1
#elif defined(__EXCEPTIONS)
#define GRPC_ALLOW_EXCEPTIONS 1
#else
#define GRPC_ALLOW_EXCEPTIONS 0
#endif
#else /* GPR_WINDOWS */
#ifdef __EXCEPTIONS
#define GRPC_ALLOW_EXCEPTIONS 1

Loading…
Cancel
Save