]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - sys_shared.c
Added the cvar sbar_alpha.
[xonotic/darkplaces.git] / sys_shared.c
index 3d666e922ae258c5772a61b29e5e665689abd179..881c560e9fdb7829156d1630f2d96625c7ae7f2d 100644 (file)
@@ -103,6 +103,10 @@ void Sys_Shared_EarlyInit(void)
        os = "Linux";
 #elif defined(WIN32)
        os = "Windows";
+#elif defined(__NetBSD__)
+       os = "NetBSD";
+#elif defined(__OpenBSD__)
+       os = "OpenBSD";
 #else
        os = "Unknown";
 #endif
@@ -118,3 +122,42 @@ void Sys_Shared_LateInit(void)
 {
 }
 
+/*
+===============================================================================
+
+DLL MANAGEMENT
+
+===============================================================================
+*/
+
+#ifndef WIN32
+#include <dlfcn.h>
+#endif
+
+dllhandle_t Sys_LoadLibrary (const char* name)
+{
+#ifdef WIN32
+       return LoadLibrary (name);
+#else
+       return dlopen (name, RTLD_LAZY);
+#endif
+}
+
+void Sys_UnloadLibrary (dllhandle_t handle)
+{
+#ifdef WIN32
+       FreeLibrary (handle);
+#else
+       dlclose (handle);
+#endif
+}
+
+void* Sys_GetProcAddress (dllhandle_t handle, const char* name)
+{
+#ifdef WIN32
+       return (void *)GetProcAddress (handle, name);
+#else
+       return (void *)dlsym (handle, name);
+#endif
+}
+