From: Brian Paul Date: Mon, 21 Sep 2009 17:09:00 +0000 (-0600) Subject: progs/perf: offsetof() should be defined in stddef.h, include it X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=83fbee6e0be46efab4b60ba50fceb103f8937ac1;p=mesa.git progs/perf: offsetof() should be defined in stddef.h, include it If this breaks mingw, feel free to revert this. --- diff --git a/progs/perf/common.h b/progs/perf/common.h index fc49bbed32f..6ea17402b52 100644 --- a/progs/perf/common.h +++ b/progs/perf/common.h @@ -24,6 +24,9 @@ #define COMMON_H +#include /* for offsetof() */ + + typedef void (*PerfRateFunc)(unsigned count); diff --git a/progs/perf/teximage.c b/progs/perf/teximage.c index 11d781fccc6..634cd835588 100644 --- a/progs/perf/teximage.c +++ b/progs/perf/teximage.c @@ -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