mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-06 15:58:52 +08:00
Abandoning pragma once
This commit is contained in:
@@ -165,6 +165,7 @@ def generate_one_type(template_expander, t):
|
||||
t.short_name = t.full_name.split('.')[-1]
|
||||
t.cpp_type_name = t.short_name + '_'
|
||||
t.cpp_full_type_name = '::' + t.full_name.replace('.', '::')
|
||||
t.include_guard = t.full_name.replace('.', '_').upper() + '_HPP_INCLUDED'
|
||||
|
||||
# Dependencies (no duplicates)
|
||||
def fields_includes(fields):
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
* Source file: ${t.source_file}
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#ifndef ${t.include_guard}
|
||||
#define ${t.include_guard}
|
||||
|
||||
#include <uavcan/build_config.hpp>
|
||||
#include <uavcan/node/global_data_type_registry.hpp>
|
||||
@@ -385,3 +386,5 @@ ${define_streaming_operator(type_name=t.cpp_full_type_name)}
|
||||
% for nsc in t.cpp_namespace_components:
|
||||
}
|
||||
% endfor
|
||||
|
||||
#endif // ${t.include_guard}
|
||||
|
||||
Reference in New Issue
Block a user