aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/codegen/core/gen_stats_data.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/codegen/core/gen_stats_data.py')
-rwxr-xr-xtools/codegen/core/gen_stats_data.py17
1 files changed, 7 insertions, 10 deletions
diff --git a/tools/codegen/core/gen_stats_data.py b/tools/codegen/core/gen_stats_data.py
index 5c9d9e5ea5..3ebd00d049 100755
--- a/tools/codegen/core/gen_stats_data.py
+++ b/tools/codegen/core/gen_stats_data.py
@@ -230,13 +230,11 @@ with open('src/core/lib/debug/stats_data.h', 'w') as H:
print >> H, "#ifndef GRPC_CORE_LIB_DEBUG_STATS_DATA_H"
print >> H, "#define GRPC_CORE_LIB_DEBUG_STATS_DATA_H"
print >> H
+ print >> H, "#include <grpc/support/port_platform.h>"
+ print >> H
print >> H, "#include <inttypes.h>"
print >> H, "#include \"src/core/lib/iomgr/exec_ctx.h\""
print >> H
- print >> H, "#ifdef __cplusplus"
- print >> H, "extern \"C\" {"
- print >> H, "#endif"
- print >> H
for typename, instances in sorted(inst_map.items()):
print >> H, "typedef enum {"
@@ -290,10 +288,6 @@ with open('src/core/lib/debug/stats_data.h', 'w') as H:
inst_map['Histogram'])
print >> H
- print >> H, "#ifdef __cplusplus"
- print >> H, "}"
- print >> H, "#endif"
- print >> H
print >> H, "#endif /* GRPC_CORE_LIB_DEBUG_STATS_DATA_H */"
with open('src/core/lib/debug/stats_data.cc', 'w') as C:
@@ -316,10 +310,13 @@ with open('src/core/lib/debug/stats_data.cc', 'w') as C:
[C],
["Automatically generated by tools/codegen/core/gen_stats_data.py"])
- print >> C, "#include \"src/core/lib/debug/stats_data.h\""
+ print >> C, "#include <grpc/support/port_platform.h>"
+ print >> C
print >> C, "#include \"src/core/lib/debug/stats.h\""
+ print >> C, "#include \"src/core/lib/debug/stats_data.h\""
+ print >> C, "#include \"src/core/lib/gpr/useful.h\""
print >> C, "#include \"src/core/lib/iomgr/exec_ctx.h\""
- print >> C, "#include <grpc/support/useful.h>"
+ print >> C
histo_code = []
for histogram in inst_map['Histogram']: