mirror of
https://github.com/brl/mutter.git
synced 2024-12-23 19:42:05 +00:00
cogl-context-winsys: Avoid zero-length arrays
When compiling for non-glx platforms the winsys feature data array ends up empty. Empty arrays cause problems for MSVC so this patch adds a stub entry so that the array always has at least one entry. Based on a patch by Ole André Vadla Ravnås
This commit is contained in:
parent
371e6bd47c
commit
c381f0cb8b
@ -60,8 +60,14 @@
|
||||
static const CoglFeatureData cogl_winsys_feature_data[] =
|
||||
{
|
||||
#include "cogl-winsys-feature-functions.h"
|
||||
|
||||
/* This stub is just here so that if the header is empty then we
|
||||
won't end up declaring an empty array */
|
||||
{ 0, }
|
||||
};
|
||||
|
||||
#define COGL_WINSYS_N_FEATURES (G_N_ELEMENTS (cogl_winsys_feature_data) - 1)
|
||||
|
||||
static const char *
|
||||
_cogl_get_winsys_extensions (void)
|
||||
{
|
||||
@ -81,7 +87,7 @@ _cogl_winsys_features_init (CoglContext *context)
|
||||
const char *extensions = _cogl_get_winsys_extensions ();
|
||||
int i;
|
||||
|
||||
for (i = 0; i < G_N_ELEMENTS (cogl_winsys_feature_data); i++)
|
||||
for (i = 0; i < COGL_WINSYS_N_FEATURES; i++)
|
||||
if (_cogl_feature_check ("GLX", cogl_winsys_feature_data + i, 0, 0,
|
||||
extensions))
|
||||
flags |= cogl_winsys_feature_data[i].feature_flags;
|
||||
|
Loading…
Reference in New Issue
Block a user