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