engine: platform: remove Emscripten-specific library loading, it's not needed anymore

This commit is contained in:
Alibek Omarov
2025-06-14 15:32:12 +05:00
parent d7f4b21db7
commit 69e38c963d
3 changed files with 0 additions and 75 deletions

View File

@@ -1,45 +0,0 @@
/*
em_lib.h - dynamic library code for iOS
Copyright (C) 2017-2018 mittorn
This program is free software: you can redistribute it and/sor modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
*/
#ifdef __EMSCRIPTEN__
#include <emscripten.h>
#include "common.h"
#include "library.h"
#include "filesystem.h"
#include "server.h"
void *EMSCRIPTEN_LoadLibrary( const char *dllname )
{
void *pHandle = NULL;
#ifdef EMSCRIPTEN_LIB_FS
char path[MAX_SYSPATH], buf[MAX_VA_STRING];
string prefix;
Q_strcpy(prefix, getenv( "LIBRARY_PREFIX" ) );
Q_snprintf( path, MAX_SYSPATH, "%s%s%s", prefix, dllname, getenv( "LIBRARY_SUFFIX" ) );
pHandle = dlopen( path, RTLD_LAZY );
if( !pHandle )
{
Q_snprintf( buf, sizeof( buf ), "Loading %s:\n", path );
COM_PushLibraryError( buf );
COM_PushLibraryError( dlerror() );
}
return pHandle;
#else
// get handle of preloaded library outside fs
return EM_ASM_INT( return DLFCN.loadedLibNames[Pointer_stringify($0)], (int)dllname );
#endif
}
#endif // __EMSCRIPTEN__

View File

@@ -1,29 +0,0 @@
/*
em_lib.h - dynamic library code for iOS
Copyright (C) 2017-2018 mittorn
This program is free software: you can redistribute it and/sor modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
*/
#pragma once
#include "build.h"
#ifdef XASH_EMSCRIPTEN
#ifndef EM_LIB_H
#define EM_LIB_H
#define Platform_POSIX_LoadLibrary( x ) EMSCRIPTEN_LoadLibrary(( x ))
#ifndef EMSCRIPTEN_LIB_FS
#define Platform_POSIX_FreeLibrary( x ) // nothing
#endif // EMSCRIPTEN_LIB_FS
void *EMSCRIPTEN_LoadLibrary( const char *dllname );
#endif // EM_LIB_H
#endif // __EMSCRIPTEN__

View File

@@ -25,7 +25,6 @@ GNU General Public License for more details.
#include "filesystem.h"
#include "server.h"
#include "platform/android/lib_android.h"
#include "platform/emscripten/lib_em.h"
#include "platform/apple/lib_ios.h"
#ifdef XASH_DLL_LOADER // wine-based dll loader