From e2ee5cbefb9686672bd6a1e017fccec90b97b120 Mon Sep 17 00:00:00 2001 From: Dominik Nussbaumer <4436784+tnixeu@users.noreply.github.com> Date: Fri, 3 Feb 2023 08:51:46 +0100 Subject: [PATCH] hide functions for yaml2sql (#7390) yaml2sql uses some headers for constants from map-server. In order to avoid linker errros, no functions from those headers must be used. However, some static functions are the status.hpp which cause linker errors when creating a debug build. The define `ONLY_CONSTANTS` hides those funcitons for yaml2sql. refs #7389 Co-authored-by: Vincent Stumpf --- src/map/status.hpp | 3 ++- src/tool/yaml.hpp | 1 + src/tool/yaml2sql.cpp | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/map/status.hpp b/src/map/status.hpp index 950a2b75b6..8d303d051a 100644 --- a/src/map/status.hpp +++ b/src/map/status.hpp @@ -3246,7 +3246,7 @@ public: void deleteSCE(enum sc_type type); void clearSCE(enum sc_type type); }; - +#ifndef ONLY_CONSTANTS int status_damage( struct block_list *src, struct block_list *target, int64 dhp, int64 dsp, int64 dap, t_tick walkdelay, int flag, uint16 skill_id ); static int status_damage( struct block_list *src, struct block_list *target, int64 dhp, int64 dsp, t_tick walkdelay, int flag, uint16 skill_id ){ return status_damage( src, target, dhp, dsp, 0, walkdelay, flag, skill_id ); @@ -3462,5 +3462,6 @@ uint16 status_efst_get_bl_type(enum efst_type efst); void status_readdb( bool reload = false ); void do_init_status(void); void do_final_status(void); +#endif /* ONLY_CONSTANTS */ #endif /* STATUS_HPP */ diff --git a/src/tool/yaml.hpp b/src/tool/yaml.hpp index 2531f12e86..936bc29778 100644 --- a/src/tool/yaml.hpp +++ b/src/tool/yaml.hpp @@ -37,6 +37,7 @@ #endif // Only for constants - do not use functions of it or linking will fail +#define ONLY_CONSTANTS #include "../map/achievement.hpp" #include "../map/battle.hpp" #include "../map/battleground.hpp" diff --git a/src/tool/yaml2sql.cpp b/src/tool/yaml2sql.cpp index b5cbd4eb5c..03ecaea85d 100644 --- a/src/tool/yaml2sql.cpp +++ b/src/tool/yaml2sql.cpp @@ -34,6 +34,7 @@ #endif // Only for constants - do not use functions of it or linking will fail +#define ONLY_CONSTANTS #include "../map/achievement.hpp" #include "../map/battle.hpp" #include "../map/battleground.hpp"