From 560cd80a5d9b03803906b4773a51711539292257 Mon Sep 17 00:00:00 2001 From: Dan Gudmundsson Date: Mon, 11 Oct 2010 12:20:23 +0200 Subject: [PATCH] Windows fixes --- c_src/esdl_driver.c | 1 + c_src/esdl_gl.c | 19 ++++++++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/c_src/esdl_driver.c b/c_src/esdl_driver.c index cd3183b..b92ca25 100755 --- a/c_src/esdl_driver.c +++ b/c_src/esdl_driver.c @@ -201,6 +201,7 @@ sdl_driver_debug_control(ErlDrvData handle, unsigned op, gl_dispatch(sd, op, buf); sdl_free_binaries(sd); fprintf(stderr, "\r\n"); + return 0; } } diff --git a/c_src/esdl_gl.c b/c_src/esdl_gl.c index 7d2fe46..cfa9edb 100644 --- a/c_src/esdl_gl.c +++ b/c_src/esdl_gl.c @@ -8,7 +8,9 @@ #include #include +#ifndef _WIN32 #include +#endif #include "esdl.h" int esdl_gl_initiated = 0; @@ -20,14 +22,25 @@ ESDL_GL_DISPATCH esdl_gl_dispatch; typedef int (*ESDL_GL_INIT) (); #ifdef _WIN32 +#define RTLD_LAZY 0 +typedef HMODULE DL_LIB_P; + void * dlsym(HMODULE Lib, const char *func) { - funcp = (void *) GetProcAddress(Lib, func); - return funcp; + void * funcp; + funcp = (void *) GetProcAddress(Lib, func); + return funcp; +} + +HMODULE dlopen(const char *DLL, int unused) { + return LoadLibrary(DLL); } + +#else +typedef void * DL_LIB_P; #endif void es_init_opengl(sdl_data *sd, int len, char *bp) { - void * LIBhandle; + DL_LIB_P LIBhandle; ESDL_GL_INIT init_opengl; char *start;