Skip to content

Commit 2fdf53d

Browse files
committed
fixup: constant generation: better header id
1 parent c430ebd commit 2fdf53d

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/common/math/Constant.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// Generated with tools/math-constant/math-constant.py
22
// Do not modify!
33

4-
#ifndef COMMON_CONSTANT_H_
5-
#define COMMON_CONSTANT_H_
4+
#ifndef COMMON_MATH_CONSTANT_H_
5+
#define COMMON_MATH_CONSTANT_H_
66

77
namespace Math {
88
// Type Name Value Operation GNU std::numbers
@@ -58,4 +58,4 @@ namespace Math {
5858
constexpr double inv_sqrt3_d = .57735026918962576451; // 1÷√3 inv_sqrt3
5959
}
6060

61-
#endif // COMMON_CONSTANT_H_
61+
#endif // COMMON_MATH_CONSTANT_H_

tools/math-constant/math-constant.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
header = "// Generated with {}\n".format(script_path)
1313
header += "// Do not modify!"
1414

15+
header_id = "COMMON_MATH_CONSTANT_H_"
16+
1517
constants = []
1618

1719
class _phi:
@@ -287,8 +289,8 @@ def output(string=""):
287289

288290
output(header)
289291
output()
290-
output("#ifndef COMMON_CONSTANT_H_")
291-
output("#define COMMON_CONSTANT_H_")
292+
output("#ifndef {}".format(header_id))
293+
output("#define {}".format(header_id))
292294
output()
293295
output("namespace Math {")
294296

@@ -365,6 +367,6 @@ def output(string=""):
365367

366368
output("}")
367369
output()
368-
output("#endif // COMMON_CONSTANT_H_")
370+
output("#endif // {}".format(header_id))
369371

370372
file_handle.close()

0 commit comments

Comments
 (0)