[Xapian-discuss] Building Xapian/Omega using Cygwin

Olly Betts olly at survex.com
Wed Aug 17 15:40:24 BST 2005


On Wed, Aug 10, 2005 at 10:29:02AM +0100, James Aylett wrote:
> This is the actual error, so it's the only thing we need to look
> at. It looks like the cygwin build system isn't making it clear that
> it's building under Windows, or possibly something somewhere is
> clearing the __WIN32__ define.

This is my fault.  I recently created "safewindows.h" which includes
the standard windows.h header, but tries to minimise problems this can
cause - previously we did this in files including windows.h, but not
consistently.

I included the check for __WIN32__ to make sure we never try to include
this header except on windows, but cygwin doesn't define __WIN32__.  The
attached patch should fix this.

Cheers,
    Olly
-------------- next part --------------
Index: common/safewindows.h
===================================================================
--- common/safewindows.h	(revision 6355)
+++ common/safewindows.h	(working copy)
@@ -21,8 +21,8 @@
 #ifndef XAPIAN_INCLUDED_SAFEWINDOWS_H
 #define XAPIAN_INCLUDED_SAFEWINDOWS_H
 
-#ifndef __WIN32__
-# error Including safewindows.h, but __WIN32__ not defined!
+#if !defined __CYGWIN__ && !defined __WIN32__
+# error Including safewindows.h, but neither __CYGWIN__ nor __WIN32__ defined!
 #endif
 
 // Prevent windows.h from defining min and max macros.


More information about the Xapian-discuss mailing list