diff options
author | Chia-I Wu <[email protected]> | 2010-05-31 12:32:30 +0800 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2010-05-31 13:27:48 +0800 |
commit | f6f9d1014b400ac72e463a892c6ae268a31fe26d (patch) | |
tree | 1183f2a3b17beb129418d69aa7df1e820dfcefc4 /src | |
parent | ec0bab3a51026d129fb60b5e6b435c6430e79b5b (diff) |
st/egl: Use OS-specific module suffices.
At least, .dll is used on Windows.
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/state_trackers/egl/common/egl_g3d_st.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/src/gallium/state_trackers/egl/common/egl_g3d_st.c b/src/gallium/state_trackers/egl/common/egl_g3d_st.c index 6bb819336b6..e2217b3b2ba 100644 --- a/src/gallium/state_trackers/egl/common/egl_g3d_st.c +++ b/src/gallium/state_trackers/egl/common/egl_g3d_st.c @@ -64,6 +64,11 @@ egl_g3d_search_path_callback(const char *dir, size_t len, void *callback_data) char path[1024]; int ret; + if (!len) { + stmod->lib = util_dl_open(stmod->filename); + return !(stmod->lib); + } + ret = util_snprintf(path, sizeof(path), "%.*s/%s", len, dir, stmod->filename); if (ret > 0 && ret < sizeof(path)) @@ -105,6 +110,12 @@ egl_g3d_load_st_module(struct egl_g3d_st_module *stmod, } } +#ifdef PIPE_OS_WINDOWS +#define ST_MODULE_SUFFIX ".dll" +#else +#define ST_MODULE_SUFFIX ".so" +#endif + void egl_g3d_init_st_apis(struct st_api *stapis[ST_API_COUNT]) { @@ -123,24 +134,24 @@ egl_g3d_init_st_apis(struct st_api *stapis[ST_API_COUNT]) case ST_API_OPENGL: skip_checks[api] = "glColor4d"; symbols[api] = ST_CREATE_OPENGL_SYMBOL; - filenames[api][count++] = "api_GL.so"; + filenames[api][count++] = "api_GL" ST_MODULE_SUFFIX; break; case ST_API_OPENGL_ES1: skip_checks[api] = "glColor4x"; symbols[api] = ST_CREATE_OPENGL_ES1_SYMBOL; - filenames[api][count++] = "api_GLESv1_CM.so"; - filenames[api][count++] = "api_GL.so"; + filenames[api][count++] = "api_GLESv1_CM" ST_MODULE_SUFFIX; + filenames[api][count++] = "api_GL" ST_MODULE_SUFFIX; break; case ST_API_OPENGL_ES2: skip_checks[api] = "glShaderBinary"; symbols[api] = ST_CREATE_OPENGL_ES2_SYMBOL; - filenames[api][count++] = "api_GLESv2.so"; - filenames[api][count++] = "api_GL.so"; + filenames[api][count++] = "api_GLESv2" ST_MODULE_SUFFIX; + filenames[api][count++] = "api_GL" ST_MODULE_SUFFIX; break; case ST_API_OPENVG: skip_checks[api] = "vgClear"; symbols[api] = ST_CREATE_OPENVG_SYMBOL; - filenames[api][count++]= "api_OpenVG.so"; + filenames[api][count++]= "api_OpenVG" ST_MODULE_SUFFIX; break; default: assert(!"Unknown API Type\n"); |