2010-02-08 17:23:39 +01:00
|
|
|
/* Copyright (c) 2010 Wildfire Games
|
2009-04-18 19:00:33 +02:00
|
|
|
*
|
2010-02-08 17:23:39 +01:00
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining
|
|
|
|
* a copy of this software and associated documentation files (the
|
|
|
|
* "Software"), to deal in the Software without restriction, including
|
|
|
|
* without limitation the rights to use, copy, modify, merge, publish,
|
|
|
|
* distribute, sublicense, and/or sell copies of the Software, and to
|
|
|
|
* permit persons to whom the Software is furnished to do so, subject to
|
|
|
|
* the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice shall be included
|
|
|
|
* in all copies or substantial portions of the Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
|
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
|
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
|
|
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
|
|
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
|
|
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
|
|
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
2009-04-18 19:00:33 +02:00
|
|
|
*/
|
|
|
|
|
2009-04-18 19:51:05 +02:00
|
|
|
/*
|
|
|
|
* precompiled header. must be the first non-comment part of every
|
2010-12-09 12:16:21 +01:00
|
|
|
* source file (VC++ requirement).
|
2006-04-12 01:59:08 +02:00
|
|
|
*/
|
|
|
|
|
2010-01-09 20:20:14 +01:00
|
|
|
// some libraries have only a small number of source files, and the
|
|
|
|
// overhead of including loads of headers here outweighs the improvements to
|
|
|
|
// incremental rebuild performance.
|
|
|
|
// they can set MINIMAL_PCH to 1 so we include far fewer headers (but
|
|
|
|
// still do the global disabling of warnings and include config headers etc),
|
|
|
|
// or set it to 2 to remove STL headers too (precompiling STL helps performance
|
|
|
|
// in most non-tiny cases)
|
|
|
|
#ifndef MINIMAL_PCH
|
|
|
|
# define MINIMAL_PCH 0
|
|
|
|
#endif
|
|
|
|
|
2011-03-21 18:53:13 +01:00
|
|
|
#include "lib/config.h" // CONFIG_ENABLE_BOOST, CONFIG_ENABLE_PCH
|
|
|
|
#include "lib/sysdep/compiler.h" // MSC_VERSION, HAVE_PCH
|
2005-08-09 18:23:19 +02:00
|
|
|
|
2010-12-09 12:16:21 +01:00
|
|
|
// must come before any STL headers are included
|
|
|
|
#if MSC_VERSION && defined(NDEBUG)
|
|
|
|
# define _SECURE_SCL 0
|
2004-06-04 14:41:53 +02:00
|
|
|
#endif
|
|
|
|
|
2010-12-09 12:16:21 +01:00
|
|
|
// disable some common and annoying warnings
|
2011-03-21 18:53:13 +01:00
|
|
|
// (as soon as possible so that headers below are covered)
|
2010-12-09 12:16:21 +01:00
|
|
|
#include "lib/pch/pch_warnings.h"
|
|
|
|
|
2010-05-03 14:27:39 +02:00
|
|
|
#if ICC_VERSION
|
|
|
|
#include <mathimf.h> // (must come before <cmath> or <math.h> (replaces them))
|
|
|
|
double __cdecl abs(double x); // not declared by mathimf
|
|
|
|
#endif
|
|
|
|
|
2007-12-20 21:09:19 +01:00
|
|
|
|
2005-08-09 18:23:19 +02:00
|
|
|
//
|
|
|
|
// headers made available everywhere for convenience
|
|
|
|
//
|
|
|
|
|
2010-05-03 14:27:39 +02:00
|
|
|
#include "lib/posix/posix_types.h" // (must come before any system headers because it fixes off_t)
|
2010-01-09 20:20:14 +01:00
|
|
|
#include "lib/code_annotation.h"
|
2007-12-20 21:09:19 +01:00
|
|
|
#include "lib/sysdep/arch.h"
|
2011-03-21 18:53:13 +01:00
|
|
|
#include "lib/sysdep/os.h"
|
2010-05-03 14:27:39 +02:00
|
|
|
#include "lib/sysdep/stl.h"
|
2007-12-20 21:09:19 +01:00
|
|
|
#include "lib/lib_api.h"
|
2005-06-22 05:23:22 +02:00
|
|
|
#include "lib/types.h"
|
2010-07-25 19:10:57 +02:00
|
|
|
#include "lib/debug.h"
|
2007-05-09 23:01:11 +02:00
|
|
|
#include "lib/lib.h"
|
2007-05-10 22:47:17 +02:00
|
|
|
#include "lib/secure_crt.h"
|
2005-02-28 16:50:35 +01:00
|
|
|
|
2011-01-04 20:53:38 +01:00
|
|
|
#if CONFIG_ENABLE_BOOST
|
|
|
|
# include "lib/pch/pch_boost.h"
|
2011-03-21 18:53:13 +01:00
|
|
|
using boost::shared_ptr;
|
2011-01-04 20:53:38 +01:00
|
|
|
#elif HAVE_CPP0X
|
2011-03-24 10:05:06 +01:00
|
|
|
# include <array>
|
2011-03-21 18:53:13 +01:00
|
|
|
# include <memory>
|
2011-01-04 20:53:38 +01:00
|
|
|
using std::shared_ptr;
|
|
|
|
#else
|
2011-03-21 18:53:13 +01:00
|
|
|
# include <memory>
|
2011-01-04 20:53:38 +01:00
|
|
|
using std::tr1::shared_ptr;
|
|
|
|
#endif
|
2005-01-31 00:09:51 +01:00
|
|
|
|
2010-10-28 14:22:11 +02:00
|
|
|
// (must come after boost and common lib headers, but before re-enabling
|
|
|
|
// warnings to avoid boost spew)
|
|
|
|
#include "lib/posix/posix.h"
|
2005-01-31 00:09:51 +01:00
|
|
|
|
2005-02-28 16:50:35 +01:00
|
|
|
|
2005-01-31 00:09:51 +01:00
|
|
|
//
|
2007-12-20 21:09:19 +01:00
|
|
|
// precompiled headers
|
2005-01-31 00:09:51 +01:00
|
|
|
//
|
|
|
|
|
2008-01-19 12:33:11 +01:00
|
|
|
// if PCHs are supported and enabled, we make an effort to include all
|
|
|
|
// system headers. otherwise, only a few central headers (e.g. types)
|
|
|
|
// are pulled in and source files must include all the system headers
|
|
|
|
// they use. this policy ensures good compile performance whether or not
|
|
|
|
// PCHs are being used.
|
|
|
|
|
2007-12-20 21:09:19 +01:00
|
|
|
#if CONFIG_ENABLE_PCH && HAVE_PCH
|
2005-01-31 00:09:51 +01:00
|
|
|
|
2007-12-20 21:09:19 +01:00
|
|
|
// anything placed here won't need to be compiled in each translation unit,
|
|
|
|
// but will cause a complete rebuild if they change.
|
2005-01-31 00:09:51 +01:00
|
|
|
|
2010-12-09 12:16:21 +01:00
|
|
|
#include "lib/pch/pch_stdlib.h"
|
2005-06-01 22:12:45 +02:00
|
|
|
|
2010-10-28 14:22:11 +02:00
|
|
|
#endif // #if CONFIG_ENABLE_PCH && HAVE_PCH
|