[PATCH] use _WIN32 instead of windows.h to check for windows

Adrian Johnson <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
configure.ac enables the win32 surface on cygwin where it is not
wanted[1] as cygwin is a POSIX environment.

[1] https://cygwin.com/faq.html#faq.programming.unix-gui

-- 
cairo mailing list
[email protected]
https://lists.cairographics.org/mailman/listinfo/cairo
0001-build-use-_WIN32-instead-of-windows.h-to-check-for-w.patch (text/x-patch, 1.3 KB)
From 901d0a1db0d2ea7330d08da2c8429458c4ee1e5d Mon Sep 17 00:00:00 2001
From: Adrian Johnson <[email protected]>
Date: Sat, 2 Sep 2017 19:09:49 +0930
Subject: [PATCH 1/2] build: use _WIN32 instead of windows.h to check for
 windows build

ifdef _WIN32 is the recommended way to check for a windows build [1]
and avoids identifying cygwin as windows.

based on the patch at [2]

[1] https://lists.gnu.org/archive/html/autoconf/2012-02/msg00008.html
[2] https://lists.gnu.org/archive/html/autoconf/2012-02/msg00009.html
---
 build/configure.ac.system | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/build/configure.ac.system b/build/configure.ac.system
index b9d71c8d7..915b42b46 100644
--- a/build/configure.ac.system
+++ b/build/configure.ac.system
@@ -110,9 +110,11 @@ dnl check for misc headers and functions
 AC_CHECK_HEADERS([libgen.h byteswap.h signal.h setjmp.h fenv.h sys/wait.h])
 AC_CHECK_FUNCS([ctime_r drand48 flockfile funlockfile getline link strndup])
 
-dnl check for win32 headers (this detects mingw as well)
-AC_CHECK_HEADERS([windows.h], have_windows=yes, have_windows=no)
-
+dnl Check if the runtime platform is a native Win32 host.
+AC_COMPILE_IFELSE([[
+#ifdef _WIN32
+ choke me
+#endif]], [have_windows=no], [have_windows=yes])
 
 dnl Possible headers for mkdir
 AC_CHECK_HEADERS([sys/stat.h io.h])
-- 
2.11.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.