Skip to content

Commit 315e2c5

Browse files
committed
Revise code gen for header include guards
1 parent eacb9bb commit 315e2c5

File tree

11 files changed

+21
-21
lines changed

11 files changed

+21
-21
lines changed

compiler/lib/src/main/scala/codegen/CppWriter/CppWriterState.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ case class CppWriterState(
4848

4949
/** Constructs an include guard from a qualified name and a kind */
5050
def includeGuardFromQualifiedName(s: Symbol, name: String, headerExtension: String = "HPP"): String = {
51-
val guard = a.getEnclosingNames(s) match {
51+
val guard = getNamespaceIdentList(s) match {
5252
case Nil => name
5353
case names =>
5454
val prefix = CppWriterState.identFromQualifiedName(

compiler/tools/fpp-to-cpp/test/alias/C_AArrayAc.ref.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
// \brief hpp file for C_A array
55
// ======================================================================
66

7-
#ifndef C_C_AArrayAc_HPP
8-
#define C_C_AArrayAc_HPP
7+
#ifndef C_AArrayAc_HPP
8+
#define C_AArrayAc_HPP
99

1010
#include <initializer_list>
1111

compiler/tools/fpp-to-cpp/test/alias/C_XAliasAc.ref.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
// \brief hpp file for C_X alias
55
// ======================================================================
66

7-
#ifndef C_C_XAliasAc_HPP
8-
#define C_C_XAliasAc_HPP
7+
#ifndef C_XAliasAc_HPP
8+
#define C_XAliasAc_HPP
99

1010
#include "Fw/Types/BasicTypes.hpp"
1111

compiler/tools/fpp-to-cpp/test/alias/SM_AArrayAc.ref.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
// \brief hpp file for SM_A array
55
// ======================================================================
66

7-
#ifndef SM_SM_AArrayAc_HPP
8-
#define SM_SM_AArrayAc_HPP
7+
#ifndef SM_AArrayAc_HPP
8+
#define SM_AArrayAc_HPP
99

1010
#include <initializer_list>
1111

compiler/tools/fpp-to-cpp/test/alias/SM_XAliasAc.ref.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
// \brief hpp file for SM_X alias
55
// ======================================================================
66

7-
#ifndef SM_SM_XAliasAc_HPP
8-
#define SM_SM_XAliasAc_HPP
7+
#ifndef SM_XAliasAc_HPP
8+
#define SM_XAliasAc_HPP
99

1010
#include "Fw/Types/BasicTypes.hpp"
1111

compiler/tools/fpp-to-cpp/test/array/C_AArrayAc.ref.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
// \brief hpp file for C_A array
55
// ======================================================================
66

7-
#ifndef C_C_AArrayAc_HPP
8-
#define C_C_AArrayAc_HPP
7+
#ifndef C_AArrayAc_HPP
8+
#define C_AArrayAc_HPP
99

1010
#include <initializer_list>
1111

compiler/tools/fpp-to-cpp/test/array/SM_AArrayAc.ref.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
// \brief hpp file for SM_A array
55
// ======================================================================
66

7-
#ifndef SM_SM_AArrayAc_HPP
8-
#define SM_SM_AArrayAc_HPP
7+
#ifndef SM_AArrayAc_HPP
8+
#define SM_AArrayAc_HPP
99

1010
#include <initializer_list>
1111

compiler/tools/fpp-to-cpp/test/enum/C_EEnumAc.ref.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
// \brief hpp file for C_E enum
55
// ======================================================================
66

7-
#ifndef C_C_EEnumAc_HPP
8-
#define C_C_EEnumAc_HPP
7+
#ifndef C_EEnumAc_HPP
8+
#define C_EEnumAc_HPP
99

1010
#include "Fw/FPrimeBasicTypes.hpp"
1111
#include "Fw/Types/Serializable.hpp"

compiler/tools/fpp-to-cpp/test/enum/SM_EEnumAc.ref.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
// \brief hpp file for SM_E enum
55
// ======================================================================
66

7-
#ifndef SM_SM_EEnumAc_HPP
8-
#define SM_SM_EEnumAc_HPP
7+
#ifndef SM_EEnumAc_HPP
8+
#define SM_EEnumAc_HPP
99

1010
#include "Fw/FPrimeBasicTypes.hpp"
1111
#include "Fw/Types/Serializable.hpp"

compiler/tools/fpp-to-cpp/test/struct/C_SSerializableAc.ref.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
// \brief hpp file for C_S struct
55
// ======================================================================
66

7-
#ifndef C_C_SSerializableAc_HPP
8-
#define C_C_SSerializableAc_HPP
7+
#ifndef C_SSerializableAc_HPP
8+
#define C_SSerializableAc_HPP
99

1010
#include "Fw/FPrimeBasicTypes.hpp"
1111
#include "Fw/Types/ExternalString.hpp"

0 commit comments

Comments
 (0)