diff options
author | Yash Tibrewal <yashkt@google.com> | 2017-11-21 16:52:06 -0800 |
---|---|---|
committer | Yash Tibrewal <yashkt@google.com> | 2017-11-21 16:52:06 -0800 |
commit | 7486144de0577e3e9453feec328741180d1f1bfa (patch) | |
tree | 23eb0c5490c5a0a6057407a05f62efac1181389b /include | |
parent | d48981221542a5bd760b64e5af379adb0e846bba (diff) | |
parent | d88421a995bf473202ecf0650eb8339a3cea3e93 (diff) |
Merge master
Diffstat (limited to 'include')
-rw-r--r-- | include/grpc++/impl/codegen/call.h | 1 | ||||
-rw-r--r-- | include/grpc/impl/codegen/grpc_types.h | 4 | ||||
-rw-r--r-- | include/grpc/impl/codegen/port_platform.h | 21 |
3 files changed, 26 insertions, 0 deletions
diff --git a/include/grpc++/impl/codegen/call.h b/include/grpc++/impl/codegen/call.h index 1a988297dc..41e95866cf 100644 --- a/include/grpc++/impl/codegen/call.h +++ b/include/grpc++/impl/codegen/call.h @@ -579,6 +579,7 @@ class CallOpClientRecvStatus { op->data.recv_status_on_client.trailing_metadata = metadata_map_->arr(); op->data.recv_status_on_client.status = &status_code_; op->data.recv_status_on_client.status_details = &error_message_; + op->data.recv_status_on_client.error_string = nullptr; op->flags = 0; op->reserved = NULL; } diff --git a/include/grpc/impl/codegen/grpc_types.h b/include/grpc/impl/codegen/grpc_types.h index 326529e638..957286d27f 100644 --- a/include/grpc/impl/codegen/grpc_types.h +++ b/include/grpc/impl/codegen/grpc_types.h @@ -558,6 +558,10 @@ typedef struct grpc_op { grpc_metadata_array* trailing_metadata; grpc_status_code* status; grpc_slice* status_details; + /** If this is not nullptr, it will be populated with the full fidelity + * error string for debugging purposes. The application is responsible + * for freeing the data. */ + const char** error_string; } recv_status_on_client; struct grpc_op_recv_close_on_server { /** out argument, set to 1 if the call failed in any way (seen as a diff --git a/include/grpc/impl/codegen/port_platform.h b/include/grpc/impl/codegen/port_platform.h index fb4bfc3162..1906886d5e 100644 --- a/include/grpc/impl/codegen/port_platform.h +++ b/include/grpc/impl/codegen/port_platform.h @@ -297,6 +297,27 @@ #endif #endif /* GPR_NO_AUTODETECT_PLATFORM */ +/* + * There are platforms for which TLS should not be used even though the + * compiler makes it seem like it's supported (Android NDK < r12b for example). + * This is primarily because of linker problems and toolchain misconfiguration: + * TLS isn't supported until NDK r12b per + * https://developer.android.com/ndk/downloads/revision_history.html + * Since NDK r16, `__NDK_MAJOR__` and `__NDK_MINOR__` are defined in + * <android/ndk-version.h>. For NDK < r16, users should define these macros, + * e.g. `-D__NDK_MAJOR__=11 -D__NKD_MINOR__=0` for NDK r11. */ +#if defined(__ANDROID__) && defined(__clang__) && defined(GPR_GCC_TLS) +#if __has_include(<android/ndk-version.h>) +#include <android/ndk-version.h> +#endif /* __has_include(<android/ndk-version.h>) */ +#if defined(__ANDROID__) && defined(__clang__) && defined(__NDK_MAJOR__) && \ + defined(__NDK_MINOR__) && \ + ((__NDK_MAJOR__ < 12) || ((__NDK_MAJOR__ == 12) && (__NDK_MINOR__ < 1))) +#undef GPR_GCC_TLS +#define GPR_PTHREAD_TLS 1 +#endif +#endif /*defined(__ANDROID__) && defined(__clang__) && defined(GPR_GCC_TLS) */ + #if defined(__has_include) #if __has_include(<atomic>) #define GRPC_HAS_CXX11_ATOMIC |