GLURaw 2.0.0.2 → 2.0.0.3
raw patch · 4 files changed
+22/−14 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG.md +4/−0
- GLURaw.cabal +1/−1
- README.md +4/−1
- cbits/HsGLURaw.c +13/−12
CHANGELOG.md view
@@ -1,3 +1,7 @@+2.0.0.3+-------+* Fixed dynamic loading of GLU library for recent GHC versions.+ 2.0.0.2 ------- * Relaxed upper version bound for `OpenGLRaw`.
GLURaw.cabal view
@@ -1,5 +1,5 @@ name: GLURaw-version: 2.0.0.2+version: 2.0.0.3 synopsis: A raw binding for the OpenGL graphics system description: GLURaw is a raw Haskell binding for the GLU 1.3 OpenGL utility library. It is
README.md view
@@ -1,1 +1,4 @@-[](https://hackage.haskell.org/package/GLURaw) [](https://travis-ci.org/haskell-opengl/GLURaw)+[](https://hackage.haskell.org/package/GLURaw)+[](https://www.stackage.org/lts/package/GLURaw)+[](https://www.stackage.org/nightly/package/GLURaw)+[](https://travis-ci.org/haskell-opengl/GLURaw)
cbits/HsGLURaw.c view
@@ -69,10 +69,16 @@ #include <stdlib.h> #include <dlfcn.h> -#ifndef __APPLE__-#include <stdio.h>-#include <GL/glu.h>+static const char* libNames[] = {+#ifdef __APPLE__+ /* Try public framework path first. */+ "/Library/Frameworks/OpenGL.framework/OpenGL",+ /* If the public path failed, try the system framework path. */+ "/System/Library/Frameworks/OpenGL.framework/OpenGL"+#else+ "libGLU.so", "libGLU.so.1" #endif+}; void* hs_GLU_getProcAddress(const char *name)@@ -81,17 +87,12 @@ static void *handle = NULL; if (firstTime) {+ int i, numNames = (int)(sizeof(libNames) / sizeof(libNames[0])); firstTime = 0;- /* Get a handle for our executable. */- handle = dlopen(NULL, RTLD_LAZY);+ for (i = 0; (!handle) && (i < numNames); ++i) {+ handle = dlopen(libNames[i], RTLD_LAZY | RTLD_GLOBAL);+ } }--#ifndef __APPLE__- /* Hack to force linking of GLU on Linux */- FILE *bitbucket = fopen("/dev/null", "w");- fprintf(bitbucket, "%p\n", gluBeginCurve);- fclose(bitbucket); -#endif return handle ? dlsym(handle, name) : NULL; }