Permalink
Browse files

Windows fixes

  • Loading branch information...
1 parent d6851ea commit 560cd80a5d9b03803906b4773a51711539292257 @dgud committed with Oct 11, 2010
Showing with 17 additions and 3 deletions.
  1. +1 −0 c_src/esdl_driver.c
  2. +16 −3 c_src/esdl_gl.c
View
@@ -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;
}
}
View
@@ -8,7 +8,9 @@
#include <stdio.h>
#include <string.h>
+#ifndef _WIN32
#include <dlfcn.h>
+#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;

0 comments on commit 560cd80

Please sign in to comment.