diff options
author | Blue Swirl <blauwirbel@gmail.com> | 2009-09-12 09:58:46 +0000 |
---|---|---|
committer | Blue Swirl <blauwirbel@gmail.com> | 2009-09-12 09:58:46 +0000 |
commit | 4085885616ac2613abac5c2316c488d5a12c3d0d (patch) | |
tree | 473f3526679357d55f0034fa8ebe3f9dea1a534d /configure | |
parent | ec58ce9f410d6a8c59612b6cfcdd153b13a65431 (diff) | |
download | qemu-4085885616ac2613abac5c2316c488d5a12c3d0d.tar.gz qemu-4085885616ac2613abac5c2316c488d5a12c3d0d.tar.bz2 qemu-4085885616ac2613abac5c2316c488d5a12c3d0d.zip |
Fix a Sparse warning about redefinition of offsetof()
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -1602,6 +1602,18 @@ if test "$darwin" != "yes" -a "$mingw32" != "yes" -a "$solaries" != yes -a \ libs_softmmu="-lutil $libs_softmmu" fi +########################################## +# check if the compiler defines offsetof + +need_offsetof=yes +cat > $TMPC << EOF +#include <stddef.h> +int main(void) { struct s { int f; }; return offsetof(struct s, f); } +EOF +if compile_prog "" "" ; then + need_offsetof=no +fi + # End of CC checks # After here, no more $cc or $ld runs @@ -1901,6 +1913,9 @@ fi if test "$fdt" = "yes" ; then echo "CONFIG_FDT=y" >> $config_host_mak fi +if test "$need_offsetof" = "yes" ; then + echo "CONFIG_NEED_OFFSETOF=y" >> $config_host_mak +fi # XXX: suppress that if [ "$bsd" = "yes" ] ; then |