fix stupid gcc warnings
This commit is contained in:
parent
8d2ee76710
commit
9e297aa570
17 changed files with 29 additions and 4 deletions
|
@ -77,8 +77,11 @@ class Janitor:
|
|||
relpath = path.relative_to(self.root)
|
||||
return f'{guard_prefix}{badchar_regex.sub("_", str(relpath))}'
|
||||
|
||||
def get_guard_template(self, guard):
|
||||
if use_pragma_once:
|
||||
def get_guard_template(self, guard, path):
|
||||
# Workaround stupid gcc warning
|
||||
is_pch = str(path).endswith('/src/pch/taisei_pch.h')
|
||||
|
||||
if use_pragma_once and not is_pch:
|
||||
return (
|
||||
r'\n\n'
|
||||
rf'#pragma once\n'
|
||||
|
@ -95,7 +98,7 @@ class Janitor:
|
|||
|
||||
def transform_include_guards(self, text, path):
|
||||
guard = self.get_guard_name(path)
|
||||
template = self.get_guard_template(guard)
|
||||
template = self.get_guard_template(guard, path)
|
||||
|
||||
# replace #pragma once
|
||||
text = pragma_regex.sub(template, text, 1)
|
||||
|
|
|
@ -9,6 +9,8 @@
|
|||
#pragma once
|
||||
#include "taisei.h"
|
||||
|
||||
#define END_OF_ENTITIES
|
||||
|
||||
#define ENTITIES_CORE(X, ...) \
|
||||
X(Boss, __VA_ARGS__) \
|
||||
X(Enemy, __VA_ARGS__) \
|
||||
|
@ -17,6 +19,7 @@
|
|||
X(Player, __VA_ARGS__) \
|
||||
X(PlayerIndicators, __VA_ARGS__) \
|
||||
X(Projectile, __VA_ARGS__) \
|
||||
END_OF_ENTITIES
|
||||
|
||||
#include "plrmodes/entities.h"
|
||||
#include "stages/entities.h"
|
||||
|
@ -25,3 +28,4 @@
|
|||
ENTITIES_CORE(X, __VA_ARGS__) \
|
||||
ENTITIES_PLAYERMODES(X, __VA_ARGS__) \
|
||||
ENTITIES_STAGES(X, __VA_ARGS__) \
|
||||
END_OF_ENTITIES
|
||||
|
|
|
@ -6,7 +6,11 @@
|
|||
* Copyright (c) 2012-2019, Andrei Alexeyev <akari@taisei-project.org>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#ifndef IGUARD_pch_taisei_pch_h
|
||||
#define IGUARD_pch_taisei_pch_h
|
||||
|
||||
#include "taisei.h"
|
||||
|
||||
#include "global.h"
|
||||
|
||||
#endif // IGUARD_pch_taisei_pch_h
|
||||
|
|
|
@ -25,3 +25,4 @@
|
|||
ENTITIES_MarisaB(X, __VA_ARGS__) \
|
||||
ENTITIES_YoumuA(X, __VA_ARGS__) \
|
||||
ENTITIES_YoumuB(X, __VA_ARGS__) \
|
||||
END_OF_ENTITIES
|
||||
|
|
|
@ -13,3 +13,4 @@
|
|||
X(MarisaAController, __VA_ARGS__) \
|
||||
X(MarisaAMasterSpark, __VA_ARGS__) \
|
||||
X(MarisaASlave, __VA_ARGS__) \
|
||||
END_OF_ENTITIES
|
||||
|
|
|
@ -13,3 +13,4 @@
|
|||
X(MarisaBSlave, __VA_ARGS__) \
|
||||
X(MarisaBOrbiter, __VA_ARGS__) \
|
||||
X(MarisaBBeams, __VA_ARGS__) \
|
||||
END_OF_ENTITIES
|
||||
|
|
|
@ -11,3 +11,4 @@
|
|||
|
||||
#define ENTITIES_ReimuA(X, ...) \
|
||||
X(ReimuASlave, __VA_ARGS__) \
|
||||
END_OF_ENTITIES
|
||||
|
|
|
@ -12,3 +12,4 @@
|
|||
#define ENTITIES_ReimuB(X, ...) \
|
||||
X(ReimuBController, __VA_ARGS__) \
|
||||
X(ReimuBSlave, __VA_ARGS__) \
|
||||
END_OF_ENTITIES
|
||||
|
|
|
@ -10,3 +10,4 @@
|
|||
#include "taisei.h"
|
||||
|
||||
#define ENTITIES_YoumuA(X, ...) \
|
||||
END_OF_ENTITIES
|
||||
|
|
|
@ -10,3 +10,4 @@
|
|||
#include "taisei.h"
|
||||
|
||||
#define ENTITIES_YoumuB(X, ...) \
|
||||
END_OF_ENTITIES
|
||||
|
|
|
@ -23,3 +23,4 @@
|
|||
ENTITIES_STAGE4(X, __VA_ARGS__) \
|
||||
ENTITIES_STAGE5(X, __VA_ARGS__) \
|
||||
ENTITIES_STAGE6(X, __VA_ARGS__) \
|
||||
END_OF_ENTITIES
|
||||
|
|
|
@ -10,3 +10,4 @@
|
|||
#include "taisei.h"
|
||||
|
||||
#define ENTITIES_STAGE1(X, ...) \
|
||||
END_OF_ENTITIES
|
||||
|
|
|
@ -10,3 +10,4 @@
|
|||
#include "taisei.h"
|
||||
|
||||
#define ENTITIES_STAGE2(X, ...) \
|
||||
END_OF_ENTITIES
|
||||
|
|
|
@ -10,3 +10,4 @@
|
|||
#include "taisei.h"
|
||||
|
||||
#define ENTITIES_STAGE3(X, ...) \
|
||||
END_OF_ENTITIES
|
||||
|
|
|
@ -10,3 +10,4 @@
|
|||
#include "taisei.h"
|
||||
|
||||
#define ENTITIES_STAGE4(X, ...) \
|
||||
END_OF_ENTITIES
|
||||
|
|
|
@ -10,3 +10,4 @@
|
|||
#include "taisei.h"
|
||||
|
||||
#define ENTITIES_STAGE5(X, ...) \
|
||||
END_OF_ENTITIES
|
||||
|
|
|
@ -10,3 +10,4 @@
|
|||
#include "taisei.h"
|
||||
|
||||
#define ENTITIES_STAGE6(X, ...) \
|
||||
END_OF_ENTITIES
|
||||
|
|
Loading…
Reference in a new issue