1
0
mirror of https://github.com/alliedmodders/metamod-source.git synced 2025-02-18 11:54:14 +01:00

fixed incompatibility with gcc-4.2 mods that have -fvisibility=hidden

--HG--
extra : convert_revision : svn%3Ac2935e3e-5518-0410-8daf-afa5dab7d4e3/trunk%40667
This commit is contained in:
David Anderson 2008-02-25 16:43:28 +00:00
parent 4b320fd8be
commit 47ba6866cb

View File

@ -45,6 +45,12 @@
typedef void (*CONPRINTF_FUNC)(const char *, ...);
struct UsrMsgInfo
{
UsrMsgInfo()
{
}
UsrMsgInfo(int s, const char *t) : size(s), name(t)
{
}
int size;
String name;
};
@ -72,6 +78,22 @@ ConCommand meta_local_cmd("meta", LocalCommand_Meta, "Metamod:Source control opt
SH_DECL_HOOK2_void(IServerGameClients, ClientCommand, SH_NOATTRIB, 0, edict_t *, const CCommand &);
bool AssumeUserMessages()
{
int q, size;
char buffer[256];
q = 0;
while (server->GetUserMessageInfo(q, buffer, sizeof(buffer), size))
{
usermsgs_list.push_back(UsrMsgInfo(size, buffer));
q++;
}
return true;
}
void BaseProvider::ConsolePrint(const char *str)
{
ConMsg("%s", str);
@ -110,7 +132,10 @@ void BaseProvider::Notify_DLLInit_Pre(CreateInterfaceFn engineFactory,
RegisterConCommandBase(&meta_local_cmd);
conbases_unreg.push_back(&meta_local_cmd);
usermsgs_extracted = CacheUserMessages();
if ((usermsgs_extracted = CacheUserMessages()) == false)
{
usermsgs_extracted = AssumeUserMessages();
}
if (gameclients)
{
@ -609,6 +634,10 @@ bool CacheUserMessages()
if (handle != NULL)
{
void *addr = dlsym(handle, "usermessages");
if (addr == NULL)
{
return false;
}
dict = (UserMsgDict *)*(void **)addr;
dlclose(handle);
}