GLUT 2.7.0.9 → 2.7.0.10
raw patch · 3 files changed
+17/−8 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG.md +4/−0
- GLUT.cabal +1/−1
- cbits/HsGLUT.c +12/−7
CHANGELOG.md view
@@ -1,3 +1,7 @@+2.7.0.10+--------+* Mac OS X: Search public frameworks first, then system frameworks.+ 2.7.0.9 -------- * The GLUT package compiles without any additional library/framework now.
GLUT.cabal view
@@ -1,5 +1,5 @@ name: GLUT-version: 2.7.0.9+version: 2.7.0.10 synopsis: A binding for the OpenGL Utility Toolkit description: A Haskell binding for the OpenGL Utility Toolkit, a window system independent
cbits/HsGLUT.c view
@@ -48,12 +48,6 @@ #include <stdlib.h> #include <dlfcn.h> -#ifdef __APPLE__-#define FILENAME "/System/Library/Frameworks/GLUT.framework/GLUT"-#else-#define FILENAME "libglut.so"-#endif- void* hs_GLUT_getProcAddress(const char *name) {@@ -62,7 +56,18 @@ if (firstTime) { firstTime = 0;- handle = dlopen(FILENAME, RTLD_LAZY | RTLD_GLOBAL);++#ifdef __APPLE__+ /* Try public framework path first. */+ handle = dlopen("/Library/Frameworks/GLUT.framework/GLUT", RTLD_LAZY | RTLD_GLOBAL);++ /* If the public path failed, try the system framework path. */+ if (!handle) {+ handle = dlopen("/System/Library/Frameworks/GLUT.framework/GLUT", RTLD_LAZY | RTLD_GLOBAL);+ }+#else+ handle = dlopen("libglut.so", RTLD_LAZY | RTLD_GLOBAL);+#endif } return handle ? dlsym(handle, name) : NULL;