00001 /* safewindows.h: #include <windows.h> without all the bloat and damage. 00002 * 00003 * Copyright (C) 2005,2007 Olly Betts 00004 * 00005 * This program is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU General Public License as 00007 * published by the Free Software Foundation; either version 2 of the 00008 * License, or (at your option) any later version. 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License 00016 * along with this program; if not, write to the Free Software 00017 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 00018 * MA 02110-1301, USA 00019 */ 00020 00021 #ifndef XAPIAN_INCLUDED_SAFEWINDOWS_H 00022 #define XAPIAN_INCLUDED_SAFEWINDOWS_H 00023 00024 #if !defined __CYGWIN__ && !defined __WIN32__ 00025 # error Including safewindows.h, but neither __CYGWIN__ nor __WIN32__ defined! 00026 #endif 00027 00028 // Prevent windows.h from defining min and max macros. 00029 #ifndef NOMINMAX 00030 # define NOMINMAX 00031 #endif 00032 00033 // Prevent windows.h from including lots of obscure win32 api headers 00034 // which we don't care about and will just slow down compilation and 00035 // increase the risk of symbol collisions. 00036 #define WIN32_LEAN_AND_MEAN 00037 #define NOGDI 00038 #include <windows.h> 00039 00040 // FOF_NOERRORUI isn't defined by older versions of the mingw headers. 00041 #ifndef FOF_NOERRORUI 00042 # define FOF_NOERRORUI 1024 00043 #endif 00044 00045 #endif // XAPIAN_INCLUDED_SAFEWINDOWS_H