summaryrefslogtreecommitdiffstats
path: root/src/vpp-api/vapi
diff options
context:
space:
mode:
authorRenato Botelho do Couto <renato@netgate.com>2022-04-27 17:51:20 -0300
committerRenato Botelho do Couto <renato@netgate.com>2022-04-27 17:54:50 -0300
commited1f9adad793d327bc0245e14088ea8e50e54f26 (patch)
tree01109f793a3740492799887d809fe48136af55e5 /src/vpp-api/vapi
parent3bad8b62d87513c5f4004c3172551c8785c78e65 (diff)
vapi: Fix build when directory contains @
During build some header guards are created based on full path where build is happening. If one directory contains @ character build breaks because compiler believes it's a macro declaration. Jenkins adds `@${EXECUTOR_NUMBER}` suffix to workspace directory when it uses more than one executor for that job, breaking the build. Replace any @ character on guard name by _ to get it fixed. Type: fix Change-Id: Id0f4cfc33fda95e168541aa4e353a0d08aa3b664 Signed-off-by: Renato Botelho do Couto <renato@netgate.com>
Diffstat (limited to 'src/vpp-api/vapi')
-rwxr-xr-xsrc/vpp-api/vapi/vapi_c_gen.py2
-rwxr-xr-xsrc/vpp-api/vapi/vapi_cpp_gen.py3
2 files changed, 3 insertions, 2 deletions
diff --git a/src/vpp-api/vapi/vapi_c_gen.py b/src/vpp-api/vapi/vapi_c_gen.py
index b86115893f9..debd7345f60 100755
--- a/src/vpp-api/vapi/vapi_c_gen.py
+++ b/src/vpp-api/vapi/vapi_c_gen.py
@@ -712,7 +712,7 @@ def gen_json_unified_header(parser, logger, j, io, name):
sys.stdout = io
include_guard = "__included_%s" % (
j.replace(".", "_").replace("/", "_").replace("-", "_").replace(
- "+", "_"))
+ "+", "_").replace("@", "_"))
print("#ifndef %s" % include_guard)
print("#define %s" % include_guard)
print("")
diff --git a/src/vpp-api/vapi/vapi_cpp_gen.py b/src/vpp-api/vapi/vapi_cpp_gen.py
index c6aa009cbb9..7bc2e7fecf0 100755
--- a/src/vpp-api/vapi/vapi_cpp_gen.py
+++ b/src/vpp-api/vapi/vapi_cpp_gen.py
@@ -139,7 +139,8 @@ def gen_json_header(parser, logger, j, io, gen_h_prefix, add_debug_comments):
sys.stdout = io
d, f = os.path.split(j)
include_guard = "__included_hpp_%s" % (
- f.replace(".", "_").replace("/", "_").replace("-", "_"))
+ f.replace(".", "_").replace("/", "_").replace("-", "_").replace(
+ "@", "_"))
print("#ifndef %s" % include_guard)
print("#define %s" % include_guard)
print("")