2 * @brief #include <windows.h> without all the bloat and damage.
4 /* Copyright (C) 2005,2007,2013,2020 Olly Betts
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; either version 2 of the
9 * License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
22 #ifndef XAPIAN_INCLUDED_SAFEWINDOWS_H
23 #define XAPIAN_INCLUDED_SAFEWINDOWS_H
25 #if !defined __CYGWIN__ && !defined __WIN32__
26 # error Including safewindows.h, but neither __CYGWIN__ nor __WIN32__ defined!
29 // Prevent windows.h from defining min and max macros.
34 // Prevent windows.h from including lots of obscure win32 api headers
35 // which we don't care about and will just slow down compilation and
36 // increase the risk of symbol collisions.
37 #define WIN32_LEAN_AND_MEAN
41 // The mingw headers don't reach <winerror.h> from <windows.h> (verified
42 // with w32api 5.4.1). MSVC does, so we treat this as a flaw to workaround and
43 // include <winerror.h> if we detect it hasn't been implicitly included.
44 #ifndef ERROR_PIPE_CONNECTED
45 # include <winerror.h>
48 #endif // XAPIAN_INCLUDED_SAFEWINDOWS_H