From 853713190ddb43c32b197ec119ed354a8f382051 Mon Sep 17 00:00:00 2001 From: Kp Date: Sat, 22 Jun 2013 21:36:28 +0000 Subject: [PATCH] Make ogl_init_load_library static --- common/include/loadgl.h | 7 ++----- common/include/ogl_init.h | 1 - similar/arch/ogl/gr.c | 8 ++++---- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/common/include/loadgl.h b/common/include/loadgl.h index ffe53fd02..278d1d21b 100644 --- a/common/include/loadgl.h +++ b/common/include/loadgl.h @@ -1306,16 +1306,13 @@ void *dll_GetSymbol(void *dllhandle,const char *symname) void OpenGL_SetFuncsToNull(void); -extern char *OglLibPath; - #ifndef DECLARE_VARS // pass true to load the library // pass false to unload it -bool OpenGL_LoadLibrary(bool load);//load=true removed because not c++ +bool OpenGL_LoadLibrary(bool load, const char *OglLibPath);//load=true removed because not c++ #else void *OpenGLModuleHandle=NULL; -//char *OglLibPath="opengl32.dll"; -bool OpenGL_LoadLibrary(bool load) +bool OpenGL_LoadLibrary(bool load, const char *OglLibPath) { if(load && OpenGLModuleHandle) return true; diff --git a/common/include/ogl_init.h b/common/include/ogl_init.h index f489d4aa7..39df14233 100644 --- a/common/include/ogl_init.h +++ b/common/include/ogl_init.h @@ -13,7 +13,6 @@ #ifdef _WIN32 #include "loadgl.h" -int ogl_init_load_library(void); #else # define GL_GLEXT_LEGACY # if defined(__APPLE__) && defined(__MACH__) diff --git a/similar/arch/ogl/gr.c b/similar/arch/ogl/gr.c index aa59ed5f0..0fc3e3ecb 100644 --- a/similar/arch/ogl/gr.c +++ b/similar/arch/ogl/gr.c @@ -675,15 +675,15 @@ int ogl_atotexfilti(char *a,int min) } #ifdef _WIN32 -char *OglLibPath="opengl32.dll"; +static const char OglLibPath[]="opengl32.dll"; -int ogl_rt_loaded=0; -int ogl_init_load_library(void) +static int ogl_rt_loaded=0; +static int ogl_init_load_library(void) { int retcode=0; if (!ogl_rt_loaded) { - retcode = OpenGL_LoadLibrary(true); + retcode = OpenGL_LoadLibrary(true, OglLibPath); if(retcode) { if(!glEnd)