From cb8840000077d0f3144847fa798bb0572537ccba Mon Sep 17 00:00:00 2001 From: david parsons Date: Wed, 20 Mar 2013 22:34:43 -0700 Subject: [PATCH] When defining WORD & DWORD, check first for the MS Windows WinDef.h file; if found, include it instead of defining WORD & DWORD ourselves. --- configure.inc | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/configure.inc b/configure.inc index 091497f..7b4ac48 100755 --- a/configure.inc +++ b/configure.inc @@ -868,6 +868,18 @@ AC_C_INLINE() { # AC_SCALAR_TYPES checks to see if the compiler can generate 2 and 4 byte ints. # AC_SCALAR_TYPES () { + + rc=1 + LOGN "defining WORD & DWORD scalar types" + + if AC_QUIET AC_CHECK_HEADERS WinDef.h; then + # windows machine; BYTE, WORD, DWORD already + # defined + echo "#include " >> $__cwd/config.h + TLOG " (defined in WinDef.h)" + return 0 + fi + cat > ngc$$.c << EOF #include #include @@ -908,8 +920,6 @@ char **argv; exit(0); } EOF - rc=1 - LOGN "defining WORD & DWORD scalar types" if $AC_CC ngc$$.c -o ngc$$; then while [ "$1" ]; do case "$1" in @@ -933,6 +943,7 @@ EOF 0) TLOG "" ;; *) AC_FAIL " ** FAILED **" ;; esac + return $rc }