[Mesa-dev] [PATCH 2/7] mapi: remove unneeded ARRAY_SIZE #define

Brian Paul brianp at vmware.com
Tue Mar 3 20:07:09 PST 2015


include util/macros.h instead.
---
 src/mapi/Makefile.am             | 1 +
 src/mapi/shared-glapi/SConscript | 1 +
 src/mapi/stub.c                  | 2 +-
 src/mapi/vgapi/SConscript        | 1 +
 4 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/mapi/Makefile.am b/src/mapi/Makefile.am
index b0a6c8c..81bb966 100644
--- a/src/mapi/Makefile.am
+++ b/src/mapi/Makefile.am
@@ -46,6 +46,7 @@ AM_CPPFLAGS =							\
 	$(DEFINES)						\
 	$(SELINUX_CFLAGS)					\
 	-I$(top_srcdir)/include					\
+	-I$(top_srcdir)/src					\
 	-I$(top_srcdir)/src/mapi				\
 	-I$(top_builddir)/src/mapi
 
diff --git a/src/mapi/shared-glapi/SConscript b/src/mapi/shared-glapi/SConscript
index 07b3eff..26bfe7e 100644
--- a/src/mapi/shared-glapi/SConscript
+++ b/src/mapi/shared-glapi/SConscript
@@ -37,6 +37,7 @@ def mapi_objects(env, printer, mode):
     cpppath = [
         header[0].dir,
         '#/include',
+        '#/src',
         '#/src/mapi',
     ]
     
diff --git a/src/mapi/stub.c b/src/mapi/stub.c
index dfadbe1..953b6c7 100644
--- a/src/mapi/stub.c
+++ b/src/mapi/stub.c
@@ -29,13 +29,13 @@
 #include <string.h>
 #include <assert.h>
 
+#include "util/macros.h"
 #include "u_current.h"
 #include "u_thread.h"
 #include "entry.h"
 #include "stub.h"
 #include "table.h"
 
-#define ARRAY_SIZE(x) (sizeof(x)/sizeof((x)[0]))
 
 struct mapi_stub {
    const void *name;
diff --git a/src/mapi/vgapi/SConscript b/src/mapi/vgapi/SConscript
index 63102c1..85e90b3 100644
--- a/src/mapi/vgapi/SConscript
+++ b/src/mapi/vgapi/SConscript
@@ -22,6 +22,7 @@ env.Append(CPPDEFINES = [
 
 env.Append(CPPPATH = [
     '#/include',
+    '#/src',
     '#/src/mapi',
     Dir('..'), # vgapi/vgapi_tmp.h build path
 ])
-- 
1.9.1



More information about the mesa-dev mailing list