[PATCH/cygwin]: Explicitely undefine _WIN32

Corinna Vinschen vinschen at redhat.com
Sat Mar 17 21:10:21 EST 2012


On Mar 17 03:47, Peter Stuge wrote:
> Corinna Vinschen wrote:
> > +++ openbsd-compat/bsd-cygwin_util.h	16 Mar 2012 21:51:21 -0000
> > @@ -37,6 +37,7 @@
> >  #undef ERROR
> >  
> >  #include <windows.h>
> > +#undef _WIN32
> >  #include <sys/cygwin.h>
> >  #include <io.h>
> 
> Maybe it needs to be guarded:

Oh, right.  New patch attached.  I also added a comment so everyone
knows what that's good for.

Index: openbsd-compat/bsd-cygwin_util.h
===================================================================
RCS file: /cvs/openssh/openbsd-compat/bsd-cygwin_util.h,v
retrieving revision 1.13
diff -u -p -r1.13 bsd-cygwin_util.h
--- openbsd-compat/bsd-cygwin_util.h	17 Aug 2011 01:31:09 -0000	1.13
+++ openbsd-compat/bsd-cygwin_util.h	17 Mar 2012 10:10:04 -0000
@@ -40,6 +40,12 @@
 #include <sys/cygwin.h>
 #include <io.h>
 
+/* Make sure _WIN32 isn't defined later in the code, otherwise headers from
+   other packages might get the wrong idea about the target system. */
+#ifdef _WIN32
+#undef _WIN32
+#endif
+
 int binary_open(const char *, int , ...);
 int check_ntsec(const char *);
 char **fetch_windows_environment(void);


Thanks,
Corinna

-- 
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat


More information about the openssh-unix-dev mailing list