diff --git a/urjtag/ChangeLog b/urjtag/ChangeLog index 3e185870..fc50d874 100644 --- a/urjtag/ChangeLog +++ b/urjtag/ChangeLog @@ -6,6 +6,11 @@ * configure.ac (AC_CHECK_FUNCS): Check for geteuid and getuid functions. * sysdep.h: Key off of HAVE_xxx defines for geteuid/getuid stubs. + * configure.ac (AC_CHECK_HEADERS): Move windows.h check here, as well as + IN/OUT namespace pollution checks. + * sysdep.h: Key off of HAVE_WINDOWS_H for windows.h include. Drop the + NO_W32_PSEUDO_MODIFIERS defines since they're in configure.ac now. + 2010-06-15 Mike Frysinger * src/bus/s3c4510x.c: Punt dead/useless cvs log info. diff --git a/urjtag/configure.ac b/urjtag/configure.ac index 8764fc29..ca9a8c9e 100644 --- a/urjtag/configure.ac +++ b/urjtag/configure.ac @@ -140,9 +140,26 @@ AC_CHECK_HEADERS([linux/ppdev.h], [HAVE_LINUX_PPDEV_H="yes"]) AC_CHECK_HEADERS([dev/ppbus/ppi.h], [HAVE_DEV_PPBUS_PPI_H="yes"]) AC_CHECK_HEADERS(m4_flatten([ wchar.h + windows.h sys/wait.h ])) +dnl See if the windows target is polluting the namespace on us which +dnl will break some of the lex/yacc (e.g. bsdl) builds. We need both +dnl defines as some versions of mingw have changed names over time. +AS_IF([test "x$ac_cv_header_windows_h" = "xyes"],[ + AC_MSG_CHECKING([for IN/OUT defines in windows.h]) + AC_TRY_COMPILE([#include ], [ +#if defined(IN) || defined(OUT) +# error "IN/OUT defined" +#endif +], + [AC_MSG_RESULT([no])],[ + AS_VAR_APPEND([CPPFLAGS], " -DNO_W32_PSEUDO_MODIFIERS -D_NO_W32_PSEUDO_MODIFIERS") + AC_MSG_RESULT([yes]) + ]) +]) + VL_LIB_READLINE diff --git a/urjtag/sysdep.h b/urjtag/sysdep.h index 65966745..bf3429c9 100644 --- a/urjtag/sysdep.h +++ b/urjtag/sysdep.h @@ -43,15 +43,11 @@ #define ngettext(s,p,n) s #endif -#if __CYGWIN__ +#ifdef HAVE_WINDOWS_H #include #endif #ifdef __MINGW32__ -/* Diff versions of mingw used slightly different names */ -#define NO_W32_PSEUDO_MODIFIERS -#define _NO_W32_PSEUDO_MODIFIERS -#include /* Microsoft uses a different swprintf() than ISO C requires */ #include #define swprintf _snwprintf