From 4b37fb0e4c8266912831e42b2cf4055d3c81d00a Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Mon, 12 Mar 2018 11:10:09 -0700 Subject: [PATCH 1/3] Stop including inttypes.h in gRPC core public header in Apple platforms --- include/grpc/support/log.h | 6 ++++++ src/core/lib/gpr/log_linux.cc | 1 + test/core/end2end/cq_verifier.cc | 1 + test/core/end2end/tests/cancel_after_invoke.cc | 1 + test/core/end2end/tests/cancel_before_invoke.cc | 1 + test/core/end2end/tests/cancel_with_status.cc | 1 + test/core/end2end/tests/negative_deadline.cc | 1 + test/core/gpr/mpscq_test.cc | 1 + test/core/gpr/time_test.cc | 1 + test/core/util/test_config.cc | 1 + 10 files changed, 15 insertions(+) diff --git a/include/grpc/support/log.h b/include/grpc/support/log.h index ccb4b304cc2..622beacb982 100644 --- a/include/grpc/support/log.h +++ b/include/grpc/support/log.h @@ -21,7 +21,13 @@ #include +/* On Apple platforms, including inttypes.h in a public header prevents gRPC + * core to be built as framework. We rule out this inclusion on Apple platforms. + */ +#if !defined(__APPLE__) #include +#endif + #include #include /* for abort() */ diff --git a/src/core/lib/gpr/log_linux.cc b/src/core/lib/gpr/log_linux.cc index d743eedf38a..e4417d9d5d4 100644 --- a/src/core/lib/gpr/log_linux.cc +++ b/src/core/lib/gpr/log_linux.cc @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include diff --git a/test/core/end2end/cq_verifier.cc b/test/core/end2end/cq_verifier.cc index c3a3f43fe15..f7e64effcd4 100644 --- a/test/core/end2end/cq_verifier.cc +++ b/test/core/end2end/cq_verifier.cc @@ -18,6 +18,7 @@ #include "test/core/end2end/cq_verifier.h" +#include #include #include #include diff --git a/test/core/end2end/tests/cancel_after_invoke.cc b/test/core/end2end/tests/cancel_after_invoke.cc index a3e36e0e3fc..72f724281e0 100644 --- a/test/core/end2end/tests/cancel_after_invoke.cc +++ b/test/core/end2end/tests/cancel_after_invoke.cc @@ -18,6 +18,7 @@ #include "test/core/end2end/end2end_tests.h" +#include #include #include diff --git a/test/core/end2end/tests/cancel_before_invoke.cc b/test/core/end2end/tests/cancel_before_invoke.cc index e9fa0466fbd..c7d3ed5a4f3 100644 --- a/test/core/end2end/tests/cancel_before_invoke.cc +++ b/test/core/end2end/tests/cancel_before_invoke.cc @@ -18,6 +18,7 @@ #include "test/core/end2end/end2end_tests.h" +#include #include #include diff --git a/test/core/end2end/tests/cancel_with_status.cc b/test/core/end2end/tests/cancel_with_status.cc index 6820ba5a2f3..887da859394 100644 --- a/test/core/end2end/tests/cancel_with_status.cc +++ b/test/core/end2end/tests/cancel_with_status.cc @@ -18,6 +18,7 @@ #include "test/core/end2end/end2end_tests.h" +#include #include #include diff --git a/test/core/end2end/tests/negative_deadline.cc b/test/core/end2end/tests/negative_deadline.cc index b28bee0fb2e..dce3a02d254 100644 --- a/test/core/end2end/tests/negative_deadline.cc +++ b/test/core/end2end/tests/negative_deadline.cc @@ -18,6 +18,7 @@ #include "test/core/end2end/end2end_tests.h" +#include #include #include diff --git a/test/core/gpr/mpscq_test.cc b/test/core/gpr/mpscq_test.cc index 8c0873941f4..f51bdf8c502 100644 --- a/test/core/gpr/mpscq_test.cc +++ b/test/core/gpr/mpscq_test.cc @@ -18,6 +18,7 @@ #include "src/core/lib/gpr/mpscq.h" +#include #include #include diff --git a/test/core/gpr/time_test.cc b/test/core/gpr/time_test.cc index c80aac649d8..6f070f58df1 100644 --- a/test/core/gpr/time_test.cc +++ b/test/core/gpr/time_test.cc @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include diff --git a/test/core/util/test_config.cc b/test/core/util/test_config.cc index 53a6297d6ec..6a0d444a732 100644 --- a/test/core/util/test_config.cc +++ b/test/core/util/test_config.cc @@ -18,6 +18,7 @@ #include "test/core/util/test_config.h" +#include #include #include #include From 60aa27884f16e009502239466eb834cf38b643b4 Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Mon, 12 Mar 2018 11:50:09 -0700 Subject: [PATCH 2/3] Remove include of inttypes.h completely --- include/grpc/support/log.h | 7 ------- 1 file changed, 7 deletions(-) diff --git a/include/grpc/support/log.h b/include/grpc/support/log.h index 622beacb982..2236703db35 100644 --- a/include/grpc/support/log.h +++ b/include/grpc/support/log.h @@ -21,13 +21,6 @@ #include -/* On Apple platforms, including inttypes.h in a public header prevents gRPC - * core to be built as framework. We rule out this inclusion on Apple platforms. - */ -#if !defined(__APPLE__) -#include -#endif - #include #include /* for abort() */ From 2a03c876ec4dc30bf118dd8776c2b8ec3b960deb Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Mon, 12 Mar 2018 14:54:55 -0700 Subject: [PATCH 3/3] Fix one more file --- test/cpp/thread_manager/thread_manager_test.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/test/cpp/thread_manager/thread_manager_test.cc b/test/cpp/thread_manager/thread_manager_test.cc index fad52cf7faa..7a95a9f17da 100644 --- a/test/cpp/thread_manager/thread_manager_test.cc +++ b/test/cpp/thread_manager/thread_manager_test.cc @@ -16,6 +16,7 @@ *is % allowed in string */ +#include #include #include #include