summaryrefslogtreecommitdiff
path: root/upbc
diff options
context:
space:
mode:
authorJoshua Haberman <jhaberman@gmail.com>2019-01-14 10:56:58 -0800
committerJoshua Haberman <jhaberman@gmail.com>2019-01-14 10:56:58 -0800
commitcb26d883d1290ed258e5594454c2ffe0526b13f9 (patch)
tree8ca8c172333c159d8bf6c4e315376cdfb2f66882 /upbc
parenta9c375f8ea81e52d832653c963da72033c9a98be (diff)
WIP.
Diffstat (limited to 'upbc')
-rw-r--r--upbc/generator.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/upbc/generator.cc b/upbc/generator.cc
index ddfaa7b..de40eee 100644
--- a/upbc/generator.cc
+++ b/upbc/generator.cc
@@ -502,7 +502,9 @@ void WriteHeader(const protobuf::FileDescriptor* file, Output& output) {
"#include \"upb/decode.h\"\n"
"#include \"upb/encode.h\"\n"
"#include \"upb/port_def.inc\"\n"
- "UPB_BEGIN_EXTERN_C\n\n",
+ "#ifdef __cplusplus\n"
+ "extern \"C\" {\n"
+ "#endif\n\n",
ToPreproc(file->name()));
// Forward-declare types defined in this file.
@@ -548,7 +550,9 @@ void WriteHeader(const protobuf::FileDescriptor* file, Output& output) {
}
output(
- "UPB_END_EXTERN_C\n"
+ "#ifdef __cplusplus\n"
+ "} /* extern \"C\" */\n"
+ "#endif\n"
"\n"
"#include \"upb/port_undef.inc\"\n"
"\n"
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback