Abandoning pragma once

This commit is contained in:
Pavel Kirienko
2015-03-12 00:36:25 +03:00
parent d4986598b1
commit 79623033c1
2 changed files with 5 additions and 1 deletions
@@ -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}