Skip to content

Commit db0423c

Browse files
committed
Rename CHECK and FAIL macros to avoid conflict with internal macros when syncing back
1 parent ad6c26e commit db0423c

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

compiler/src/java_plugin/cpp/java_generator.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ static void PrintStub(
188188
interface_name += "BlockingServer";
189189
break;
190190
default:
191-
FAIL << "Cannot determine class name for StubType: " << type;
191+
GRPC_CODEGEN_FAIL << "Cannot determine class name for StubType: " << type;
192192
}
193193
bool impl;
194194
CallType call_type;
@@ -219,7 +219,7 @@ static void PrintStub(
219219
impl = true;
220220
break;
221221
default:
222-
FAIL << "Cannot determine call type for StubType: " << type;
222+
GRPC_CODEGEN_FAIL << "Cannot determine call type for StubType: " << type;
223223
}
224224
(*vars)["interface_name"] = interface_name;
225225
(*vars)["impl_name"] = impl_name;
@@ -300,9 +300,9 @@ static void PrintStub(
300300
switch (call_type) {
301301
case BLOCKING_CALL:
302302
// TODO(zhangkun83): decide the blocking server interface
303-
CHECK(type != BLOCKING_SERVER_INTERFACE)
303+
GRPC_CODEGEN_CHECK(type != BLOCKING_SERVER_INTERFACE)
304304
<< "Blocking server interface is not available";
305-
CHECK(!client_streaming)
305+
GRPC_CODEGEN_CHECK(!client_streaming)
306306
<< "Blocking client interface with client streaming is unavailable";
307307
if (server_streaming) {
308308
// Server streaming
@@ -333,7 +333,7 @@ static void PrintStub(
333333
}
334334
break;
335335
case FUTURE_CALL:
336-
CHECK(!client_streaming && !server_streaming)
336+
GRPC_CODEGEN_CHECK(!client_streaming && !server_streaming)
337337
<< "Future interface doesn't support streaming. "
338338
<< "client_streaming=" << client_streaming << ", "
339339
<< "server_streaming=" << server_streaming;
@@ -349,7 +349,7 @@ static void PrintStub(
349349
p->Indent();
350350
switch (call_type) {
351351
case BLOCKING_CALL:
352-
CHECK(!client_streaming)
352+
GRPC_CODEGEN_CHECK(!client_streaming)
353353
<< "Blocking client streaming interface is not available";
354354
if (server_streaming) {
355355
(*vars)["calls_method"] = "blockingServerStreamingCall";
@@ -388,7 +388,7 @@ static void PrintStub(
388388
" channel.newCall($method_field_name$, callOptions), $params$);\n");
389389
break;
390390
case FUTURE_CALL:
391-
CHECK(!client_streaming && !server_streaming)
391+
GRPC_CODEGEN_CHECK(!client_streaming && !server_streaming)
392392
<< "Future interface doesn't support streaming. "
393393
<< "client_streaming=" << client_streaming << ", "
394394
<< "server_streaming=" << server_streaming;

compiler/src/java_plugin/cpp/java_generator.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ class LogHelper {
2727

2828
// Abort the program after logging the mesage if the given condition is not
2929
// true. Otherwise, do nothing.
30-
#define CHECK(x) !(x) && LogHelper(&std::cerr, true).get_os() \
30+
#define GRPC_CODEGEN_CHECK(x) !(x) && LogHelper(&std::cerr, true).get_os() \
3131
<< "CHECK FAILED: " << __FILE__ << ":" \
3232
<< __LINE__ << ": "
3333

3434
// Abort the program after logging the mesage.
35-
#define FAIL CHECK(false)
35+
#define GRPC_CODEGEN_FAIL GRPC_CODEGEN_CHECK(false)
3636

3737
using namespace std;
3838

0 commit comments

Comments
 (0)