]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - sys_shared.c
host: Move out some client and server code
[xonotic/darkplaces.git] / sys_shared.c
index 39c50682347a206ecec75b00e1a42c1a29b57fa6..2149dff6c71e8c0a3f1f81e1b307f3861c0d6bc4 100644 (file)
@@ -116,6 +116,21 @@ static qbool Sys_LoadLibraryFunctions(dllhandle_t dllhandle, const dllfunction_t
        return false;
 }
 
+qbool Sys_LoadSelf(dllhandle_t *handle)
+{
+       dllhandle_t dllhandle = 0;
+
+       if (handle == NULL)
+               return false;
+#ifdef WIN32
+       dllhandle = LoadLibrary (NULL);
+#else
+       dllhandle = dlopen (NULL, RTLD_NOW | RTLD_GLOBAL);
+#endif
+       *handle = dllhandle;
+       return true;
+}
+
 qbool Sys_LoadLibrary (const char** dllnames, dllhandle_t* handle, const dllfunction_t *fcts)
 {
 #ifdef SUPPORTDLL