/** * ========================================================================= * File : precompiled.h * Project : 0 A.D. * Description : precompiled header. must be the first non-comment part * : of every source file (VC6/7 requirement). * ========================================================================= */ // license: GPL; see lib/license.txt // if the compiler supports PCH (i.e. HAVE_PCH is defined), this // tries to include all headers that may be needed. otherwise, all source // files will still need to include this (for various global fixes and the // memory trackers), but additionally include all required headers. // // this policy yields the best compile performance with or without PCH. // must come before warning disables. #include "lib/config.h" // disable some common and annoying warnings // (done as soon as possible so that headers below are covered) #if MSC_VERSION // .. temporarily disabled W4 (unimportant but ought to be fixed) # pragma warning(disable:4201) // nameless struct (Matrix3D) # pragma warning(disable:4244) // conversion from uintN to uint8 // .. permanently disabled W4 # pragma warning(disable:4127) // conditional expression is constant; rationale: see STMT in lib.h. # pragma warning(disable:4996) // function is deprecated # pragma warning(disable:4786) // identifier truncated to 255 chars # pragma warning(disable:4351) // yes, default init of array entries is desired // .. disabled only for the precompiled headers # pragma warning(disable:4702) // unreachable code (frequent in STL) // .. VS2005 code analysis (very frequent ones) # if MSC_VERSION >= 1400 # pragma warning(disable:6011) // dereferencing NULL pointer # pragma warning(disable:6246) // local declaration hides declaration of the same name in outer scope # endif #endif // // headers made available everywhere for convenience // #include "lib/types.h" #include "lib/lib.h" #include "lib/lib_errors.h" #include "lib/string_s.h" // CRT secure string #include "lib/debug.h" #include "lib/code_annotation.h" #include "lib/sysdep/compiler.h" #include "lib/sysdep/stl.h" #include "lib/posix/posix.h" // // memory headers // // these are all system headers that contain "new", "malloc" etc.; they must // come before the memory tracker headers to avoid conflicts with their // macros. therefore, they are always included, even if !HAVE_PCH. #if OS_WIN # include #endif #include #include #include // free() member function // // headers to be precompiled // // candidates are all system headers we may possibly need or large/rarely // changed project headers; everything placed in here will not need to be // compiled every time. however, if they change, the project will have to be // completely rebuilt. (slow!) // // if the compiler doesn't support precompiled headers (i.e. !HAVE_PCH), // including anything here would actually slow things down, because we might // not otherwise need some of these headers. therefore, do nothing and rely // on all source files (additionally) including everything they need. #if HAVE_PCH // all new-form C library headers #include #include #include #include //#include // defines e.g. "and" to "&". unnecessary and causes trouble with asm. #include #include #include // Including setjmp.h here causes incompatibilities with libpng on Debian/Ubuntu //#include #include #include #include #include #include #include #include #include #include // all C++98 STL headers #include #include #include #include #include #include #include #include #include #include #include #include #include // all other C++98 headers #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include // STL extensions #if GCC_VERSION # include # include #else # include # include #endif // (further headers to be precompiled go here) #endif // #if HAVE_PCH // restore temporarily-disabled warnings #if MSC_VERSION # pragma warning(default:4702) #endif // // memory trackers // // these must be included from every file to make sure all allocations // are hooked. placing in the precompiled header is more convenient than // manually #including from every file, but requires that all system // headers containing "new", "malloc" etc. come before this (see above). // // note: mmgr.h activates mmgr or the VC debug heap or nothing depending // on CONFIG_USE_MMGR and HAVE_VC_DEBUG_ALLOC settings. # include "mmgr.h" // Boost #include // noncopyable