Skip to content

master fails to build glx output plugin on darwin due to undefined VOUT_WINDOW_TYPE_NATIVE

I am updating our development-tracking port of VLC in MacPorts, and I hit a build failure.

Worked: ac2ccb3a (9/12/2012) Failed: 99236d7b (10/28/2012)

gl.c:104:20: error: use of undeclared identifier 'VOUT_WINDOW_TYPE_NATIVE' wnd_cfg.type = VOUT_WINDOW_TYPE_NATIVE; ^ 1 error generated. make[4]: *** [libgl_plugin_la-gl.lo] Error 1


Looking at the source, I can't imagine how this ever built, and indeed it looks like previous versions just didn't attempt to build this code.


It looks like this failure was introduced by:

commit 32f28560 Author: Rémi Denis-Courmont remi@remlab.net Date: Thu Oct 25 21:43:35 2012 +0300

GLX: add OpenGL provider plugin

The issue is that VOUT_WINDOW_TYPE_NATIVE is defined as:

#if defined (WIN32) || defined (OS2)

define VOUT_WINDOW_TYPE_NATIVE VOUT_WINDOW_TYPE_HWND

#elif defined (unix)

define VOUT_WINDOW_TYPE_NATIVE VOUT_WINDOW_TYPE_XID

#endif

The problem is that you're assuming unix is defined if you're building for X11 (here and other places). There are problems with this because:

  1. unix is not a standard macro
  2. You can build output plugins for multiple windowing APIs simultaneously, so in my build, I build output modules for x11 and appkit. Luckily, VOUT_WINDOW_TYPE_NATIVE is not used by anything expecting VOUT_WINDOW_TYPE_NSOBJECT, so you haven't hit this before.

The unix portion of this issue seems to exist elsewhere in the code as well:

$ grep -R unix . ./include/vlc_vout_window.h:#elif defined (unix) ./modules/gui/qt4/components/open_panels.cpp:#ifdef unix ./modules/gui/qt4/qt4.cpp:#if defined (Q_WS_X11) || (defined (Q_WS_QPA) && defined (unix)) ./modules/video_output/egl.c:#ifdef unix ./modules/video_output/egl.c:#elif defined(unix) /* X11 */

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information