aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2018-10-04 00:19:00 -0700
committerH. Peter Anvin <hpa@zytor.com>2018-10-04 00:19:00 -0700
commitaa9e0b0ba619560916437ead720dbbfba2ca6433 (patch)
tree6087cfa01249f3dffaf9523e238faf785b9618c2
parentfe20e348237d07b88d89ab7d6cf5c94045a59a57 (diff)
downloadabc80sim-aa9e0b0ba619560916437ead720dbbfba2ca6433.tar.gz
abc80sim-aa9e0b0ba619560916437ead720dbbfba2ca6433.tar.xz
abc80sim-aa9e0b0ba619560916437ead720dbbfba2ca6433.zip
console: don't rely on autoconf to find AttachConsole()
AttachConsole() is totally Win32-specific anyway, so instead of using autoconf to find it, just look for __WIN32__. Apparently autoconf fails to find it on 32-bit MinGW.
-rw-r--r--configure.ac1
-rw-r--r--console.c4
2 files changed, 2 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 0cd465b..7606662 100644
--- a/configure.ac
+++ b/configure.ac
@@ -108,7 +108,6 @@ AC_CHECK_FUNCS(nanosleep)
AC_CHECK_FUNCS(gettimeofday)
dnl Console handling
-AC_CHECK_FUNCS(AttachConsole)
AC_CHECK_FUNCS(setsid)
AC_FUNC_FORK
diff --git a/console.c b/console.c
index a7b66f2..f17fef4 100644
--- a/console.c
+++ b/console.c
@@ -55,7 +55,7 @@ static int redirect_stdio(const char *in, const char *out)
return err;
}
-#ifdef HAVE_ATTACHCONSOLE
+#ifdef __WIN32__
/* A Windows GUI app detaches from the console by default */
void attach_console(void)
@@ -78,7 +78,7 @@ void detach_console(void)
FreeConsole();
}
-#else
+#else /* not __WIN32__ */
void attach_console(void)
{