Skip to content

Commit

Permalink
Defines and header cleanup (#489)
Browse files Browse the repository at this point in the history
  • Loading branch information
Foereaper authored Jul 20, 2024
1 parent ff14dc1 commit 216e804
Show file tree
Hide file tree
Showing 40 changed files with 268 additions and 870 deletions.
4 changes: 2 additions & 2 deletions ElunaCompat.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2010 - 2022 Eluna Lua Engine <https://elunaluaengine.github.io/>
* Copyright (C) 2010 - 2024 Eluna Lua Engine <https://elunaluaengine.github.io/>
* This program is free software licensed under GPL version 3
* Please see the included DOCS/LICENSE.md for more information
*/
Expand Down Expand Up @@ -62,7 +62,7 @@ int lua_absindex(lua_State* L, int i) {
return i;
}

#ifndef LUAJIT_VERSION
#if !defined LUAJIT_VERSION
void* luaL_testudata(lua_State* L, int index, const char* tname) {
void* ud = lua_touserdata(L, index);
if (ud)
Expand Down
4 changes: 2 additions & 2 deletions ElunaCompat.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2010 - 2022 Eluna Lua Engine <https://elunaluaengine.github.io/>
* Copyright (C) 2010 - 2024 Eluna Lua Engine <https://elunaluaengine.github.io/>
* This program is free software licensed under GPL version 3
* Please see the included DOCS/LICENSE.md for more information
*/
Expand Down Expand Up @@ -27,7 +27,7 @@ extern "C"
#define lua_load(L, buf_read, dec_buf, str, NULL) \
lua_load(L, buf_read, dec_buf, str)

#ifndef LUAJIT_VERSION
#if !defined LUAJIT_VERSION
void* luaL_testudata(lua_State* L, int index, const char* tname);
void luaL_setmetatable(lua_State* L, const char* tname);
#define luaL_setfuncs(L, l, n) luaL_register(L, NULL, l)
Expand Down
10 changes: 5 additions & 5 deletions ElunaConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,20 @@ void ElunaConfig::Initialize()

void ElunaConfig::SetConfig(ElunaConfigBoolValues index, char const* fieldname, bool defvalue)
{
#ifdef TRINITY
#if defined TRINITY
SetConfig(index, sConfigMgr->GetBoolDefault(fieldname, defvalue));
#elif defined CMANGOS || defined VMANGOS || defined MANGOS
#else
SetConfig(index, sConfig.GetBoolDefault(fieldname, defvalue));
#endif
}

void ElunaConfig::SetConfig(ElunaConfigStringValues index, char const* fieldname, std::string defvalue)
{
#ifdef TRINITY
#if defined TRINITY
SetConfig(index, sConfigMgr->GetStringDefault(fieldname, defvalue));
#elif CMANGOS
#elif defined CMANGOS
SetConfig(index, sConfig.GetStringDefault(fieldname, defvalue));
#elif defined VMANGOS || defined MANGOS
#else
SetConfig(index, sConfig.GetStringDefault(fieldname, defvalue.c_str()));
#endif
}
Expand Down
Loading

0 comments on commit 216e804

Please sign in to comment.