progs/perf: offsetof() should be defined in stddef.h, include it
authorBrian Paul <brianp@vmware.com>
Mon, 21 Sep 2009 17:09:00 +0000 (11:09 -0600)
committerBrian Paul <brianp@vmware.com>
Mon, 21 Sep 2009 17:09:47 +0000 (11:09 -0600)
If this breaks mingw, feel free to revert this.

progs/perf/common.h
progs/perf/teximage.c

index fc49bbed32f867c39070a1bedc60345be8bdad0f..6ea17402b521642f7f33932937043f10a0fccacd 100644 (file)
@@ -24,6 +24,9 @@
 #define COMMON_H
 
 
+#include <stddef.h> /* for offsetof() */
+
+
 typedef void (*PerfRateFunc)(unsigned count);
 
 
index 11d781fccc6168a2eedbd3409466bf78f8e6ff9d..634cd835588b1ba7f6cc53274f9a6d510b6110b8 100644 (file)
@@ -50,11 +50,8 @@ static const struct vertex vertices[1] = {
    { 0.0, 0.0, 0.5, 0.5 },
 };
 
-#if 0
 #define VOFFSET(F) ((void *) offsetof(struct vertex, F))
-#else
-#define VOFFSET(F) ((void *) &((struct vertex *)NULL)->F)
-#endif
+
 
 /** Called from test harness/main */
 void