From 1b2efdc51ef0b5a06945562f56554c3ec6a7b259 Mon Sep 17 00:00:00 2001 From: Amar Takhar Date: Sat, 31 Oct 2009 02:23:30 +0000 Subject: [PATCH] Do a verbatium commit of agi_pre.h from trunk to stdwx.h. This should give us the same speed increase we've seen in trunk. Originally committed to SVN as r3752. --- aegisub/src/stdwx.h | 240 +++++++++++++++++++++++++++++++++++--------- 1 file changed, 191 insertions(+), 49 deletions(-) diff --git a/aegisub/src/stdwx.h b/aegisub/src/stdwx.h index 629bb4925..443b519b6 100644 --- a/aegisub/src/stdwx.h +++ b/aegisub/src/stdwx.h @@ -25,62 +25,209 @@ // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // -// ----------------------------------------------------------------------------- -// -// AEGISUB -// -// Website: http://aegisub.cellosoft.com -// Contact: mailto:zeratul@cellosoft.com +// Aegisub Project http://www.aegisub.org/ // +// $Id: agi_pre.h 3722 2009-10-18 18:57:01Z verm $ +/// @file agi_pre.h +/// @brief Precompiled headers include file, including all headers that should be precompiled +/// @ingroup main +/// +/// In order to use it, set the project to use this header as precompiled and +/// insert it in every source file (under C/C++ -> Advanced -> Force Includes), +/// then set stdwx.cpp to generate the precompiled header +/// +/// @note Make sure that you disable use of precompiled headers on md5.c and +/// MatroskaParser.c, as well as any possible future .c files. -// -// Precompiled Header File -// -// In order to use it, set the project to use this header as precompiled and -// insert it in every source file (under C/C++ -> Advanced -> Force Includes), -// then set stdwx.cpp to generate the precompiled header -// -// Note: make sure that you disable use of precompiled headers on md5.c and -// MatroskaParser.c, as well as any possible future .c files. -// +#ifndef AGI_PRE_H +/// @brief Inclusion guard. +/// @todo Why is this even nessicary? GCC seems to include agi_pre.h twice for no reason. +#define AGI_PRE_H -//////////// // C++ only #ifdef __cplusplus -///////// -// Setup -#define WIN32_LEAN_AND_MEAN - - #include "config.h" +///////// +// Setup +#define AGI_PRE + +// Block msvc from complaining about not using msvc-specific versions for +// insecure C functions. +#ifdef _CRT_SECURE_NO_WARNINGS +#define _CRT_SECURE_NO_WARNINGS_DEFINED +#else +#define _CRT_SECURE_NO_WARNINGS +#endif + +/////////////// +// STD headers +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// General headers +#include +#include +#include +#include +#include +#include +#include +#ifdef _OPENMP +// Not all compilers have (example: MSVC Express) +#include +#endif +#include +#include +#include +#include +#include +#include + +#ifdef _WIN32 +// "Lean and mean" causes windows.h to include less stuff, mostly rarely-used things. +// We can't build without being "lean and mean", some of the things included by it has +// macros that clash with variable names around Aegisub causing strange build errors. +#define WIN32_LEAN_AND_MEAN +// Windows.h must always be the first one, it defines a load of important things +#include +#include +#include +//#include // Currently only used in audio_player_dsound2.cpp + +#else + +#include +#include +#include +#include +#include +#include +#endif ///////////////////// // wxWidgets headers -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include // Leave this first. + +// Windows +#ifdef __WXMSW__ +#include +#endif + +// All platforms. +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + #ifdef HAVE_APPLE_OPENGL_FRAMEWORK #include #include @@ -88,16 +235,11 @@ #include #include #endif -#include - - - -/////////////// -// STD headers -#include -#include -#include - +#ifndef _CRT_SECURE_NO_WARNINGS +#undef _CRT_SECURE_NO_WARNINGS +#endif #endif // C++ + +#endif // AGI_PRE_H