Use GCC's builtin offset_of as the first option
authorJohn Marino <netbsd@marino.st>
Sun, 7 Oct 2012 21:27:36 +0000 (23:27 +0200)
committerFrançois Tigeot <ftigeot@wolfpond.org>
Sun, 7 Oct 2012 21:41:47 +0000 (23:41 +0200)
commit262e0d745238888fc693cd80f79c7ac0c513769f
tree434c46cf9062bffb712cf6886abc0a192535bbd1
parent7b33812f797e7b78003e7b88047255bef86323a2
Use GCC's builtin offset_of as the first option

Other than C++ code, the GCC offsetof builtin was never getting used.
The version that did get expanded could not be used for array
declarations on GCC 4.5 and later because it wasn't considered a
constant expression by those later GCC compilers.

The first symptom was seen when building world with GCC 4.6, but the
the offsetof expansion was finally identified as the cause of the
problem while discussion PostgreSQL 9.1 build failures on DragonFly.
Since DragonFly was the only platform exibiting the behavior, the
problem was narrowed down to the offsetof macro or the compiler itself.
Fixing the macro allowed the unpatched pgsql to compile.

Thanks-to: Tom Lane
sys/cpu/i386/include/stdint.h
sys/cpu/x86_64/include/stdint.h