Browse Source

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 <vincents.995@gmail.com>
Dominik Nussbaumer 2 years ago
parent
commit
e2ee5cbefb
3 changed files with 4 additions and 1 deletions
  1. 2 1
      src/map/status.hpp
  2. 1 0
      src/tool/yaml.hpp
  3. 1 0
      src/tool/yaml2sql.cpp

+ 2 - 1
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 */

+ 1 - 0
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"

+ 1 - 0
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"