[Mesa-dev] [PATCH] mesa/extensions: Define the size of the extension array

Nanley Chery nanleychery at gmail.com
Thu Nov 12 15:03:17 PST 2015


From: Nanley Chery <nanley.g.chery at intel.com>

Hopefully fixes the MSVC build error reported by Roland.

Signed-off-by: Nanley Chery <nanley.g.chery at intel.com>
---

I'm not sure why the array size being unknown is an issue. Please let
me know if this fixes the build issue.

 src/mesa/main/extensions.c |  2 +-
 src/mesa/main/extensions.h | 17 ++++++++---------
 2 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index b81bcc5..83c9bff 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -53,7 +53,7 @@ static char *cant_disable_extensions = NULL;
 /**
  * \brief Table of supported OpenGL extensions for all API's.
  */
-const struct mesa_extension _mesa_extension_table[] = {
+const struct mesa_extension _mesa_extension_table[MESA_EXTENSION_COUNT] = {
 #define EXT(name_str, driver_cap, gll_ver, glc_ver, gles_ver, gles2_ver, yyyy) \
         { .name = "GL_" #name_str, .offset = o(driver_cap), \
           .version = { \
diff --git a/src/mesa/main/extensions.h b/src/mesa/main/extensions.h
index e4671be..ba47b68 100644
--- a/src/mesa/main/extensions.h
+++ b/src/mesa/main/extensions.h
@@ -55,6 +55,13 @@ _mesa_get_extension_count(struct gl_context *ctx);
 extern const GLubyte *
 _mesa_get_enabled_extension(struct gl_context *ctx, GLuint index);
 
+/* Generate enums for the generated functions below */
+enum {
+#define EXT(name_str, ...) MESA_EXTENSION_##name_str,
+#include "extensions_table.h"
+#undef EXT
+   MESA_EXTENSION_COUNT
+};
 
 /**
  * \brief An element of the \c extension_table.
@@ -75,15 +82,7 @@ struct mesa_extension {
    /** Year the extension was proposed or approved.  Used to sort the 
     * extension string chronologically. */
    uint16_t year;
-} extern const _mesa_extension_table[];
-
-
-/* Generate enums for the functions below */
-enum {
-#define EXT(name_str, ...) MESA_EXTENSION_##name_str,
-#include "extensions_table.h"
-#undef EXT
-};
+} extern const _mesa_extension_table[MESA_EXTENSION_COUNT];
 
 
 /** Checks if the context suports a user-facing extension */
-- 
2.6.2



More information about the mesa-dev mailing list