mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
#undef in generated headers moved into the global scope
This commit is contained in:
parent
d1d42e83a7
commit
fe2b49b1ab
@ -155,11 +155,13 @@ def generate_one_type(t):
|
||||
if t.kind == t.KIND_MESSAGE:
|
||||
inject_cpp_types(t.fields)
|
||||
inject_cpp_types(t.constants)
|
||||
t.all_attributes = t.fields + t.constants
|
||||
else:
|
||||
inject_cpp_types(t.request_fields)
|
||||
inject_cpp_types(t.request_constants)
|
||||
inject_cpp_types(t.response_fields)
|
||||
inject_cpp_types(t.response_constants)
|
||||
t.all_attributes = t.request_fields + t.request_constants + t.response_fields + t.response_constants
|
||||
|
||||
# Constant properties
|
||||
def inject_constant_info(constants):
|
||||
|
||||
@ -32,6 +32,10 @@ ${line}
|
||||
% endfor
|
||||
******************************************************************************/
|
||||
|
||||
% for a in t.all_attributes:
|
||||
#undef ${a.name}
|
||||
% endfor
|
||||
|
||||
#ifndef UAVCAN_PACK_STRUCTS
|
||||
# error UAVCAN_PACK_STRUCTS
|
||||
#endif
|
||||
@ -57,9 +61,6 @@ struct UAVCAN_EXPORT ${t.cpp_type_name}
|
||||
<%def name="expand_attr_types(group_name, attrs)">
|
||||
struct ${group_name}
|
||||
{
|
||||
% for a in attrs:
|
||||
#undef ${a.name}
|
||||
% endfor
|
||||
% for a in attrs:
|
||||
typedef ${a.cpp_type} ${a.name};
|
||||
% endfor
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user