[vlc-commits] configure: include glew.h before wglew.h

Steve Lhomme git at videolan.org
Mon Jan 28 10:22:05 CET 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Jan 25 12:17:32 2019 +0100| [1f86df44e3b6e86f3af35fbb388793f09d0d7553] | committer: Steve Lhomme

configure: include glew.h before wglew.h

In recent wglew.h it relies on the DLL export mode defined in glew.h

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1f86df44e3b6e86f3af35fbb388793f09d0d7553
---

 configure.ac                            | 15 +++++++++------
 modules/video_output/opengl/converter.h |  2 +-
 modules/video_output/win32/direct3d9.c  |  3 ++-
 modules/video_output/win32/wgl.c        |  1 +
 4 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/configure.ac b/configure.ac
index a2b8ade789..7a35abd06f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3436,12 +3436,15 @@ AS_IF([test "${enable_directx}" != "no"], [
   ])
 
   dnl OpenGL
-  AC_CHECK_HEADERS([GL/wglew.h], [
-    VLC_ADD_PLUGIN([glwin32 wgl])
-  ],, [
-    #include <windows.h>
-    #include <GL/gl.h>
-  ])
+  AC_CHECK_HEADERS([GL/glew.h], [
+    AC_CHECK_HEADERS([GL/wglew.h], [
+        VLC_ADD_PLUGIN([glwin32 wgl])
+      ],, [
+        #include <windows.h>
+        #include <GL/glew.h>
+      ])],, [
+      #include <windows.h>
+   ])
 
   dnl Direct3D11
   AC_CHECK_HEADERS([d3d11.h], [
diff --git a/modules/video_output/opengl/converter.h b/modules/video_output/opengl/converter.h
index e75a733c67..a1dd68c767 100644
--- a/modules/video_output/opengl/converter.h
+++ b/modules/video_output/opengl/converter.h
@@ -45,7 +45,7 @@
 #  include <GLES2/gl2.h>
 #  include <GLES2/gl2ext.h>
 # else
-#  ifdef _WIN32
+#  ifdef HAVE_GL_WGLEW_H
 #   include <GL/glew.h>
 #  endif
 #  include <GL/gl.h>
diff --git a/modules/video_output/win32/direct3d9.c b/modules/video_output/win32/direct3d9.c
index 6e3bcb799e..da99916668 100644
--- a/modules/video_output/win32/direct3d9.c
+++ b/modules/video_output/win32/direct3d9.c
@@ -1747,8 +1747,9 @@ static void Close(vout_display_t *vd)
     free(vd->sys);
 }
 
-#ifdef HAVE_GL
+#if defined(HAVE_GL) && defined(HAVE_GL_WGLEW_H)
 #include "../opengl/converter.h"
+#include <GL/glew.h>
 #include <GL/wglew.h>
 
 struct wgl_vt {
diff --git a/modules/video_output/win32/wgl.c b/modules/video_output/win32/wgl.c
index 51ec9b8176..a4325ea32d 100644
--- a/modules/video_output/win32/wgl.c
+++ b/modules/video_output/win32/wgl.c
@@ -29,6 +29,7 @@
 #include <vlc_opengl.h>
 
 #include "../opengl/vout_helper.h"
+#include <GL/glew.h>
 #include <GL/wglew.h>
 
 #include "common.h"



More information about the vlc-commits mailing list