diff --git a/aegisub/build/aegisub_vs2008/aegisub_vs2008.vcproj b/aegisub/build/aegisub_vs2008/aegisub_vs2008.vcproj
index d0d4c503b..2d371f1e8 100644
--- a/aegisub/build/aegisub_vs2008/aegisub_vs2008.vcproj
+++ b/aegisub/build/aegisub_vs2008/aegisub_vs2008.vcproj
@@ -46,9 +46,9 @@
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
MinimalRebuild="true"
UsePrecompiledHeader="2"
- PrecompiledHeaderThrough="stdwx.h"
+ PrecompiledHeaderThrough="agi_pre.h"
DisableSpecificWarnings="4267"
- ForcedIncludeFiles="stdwx.h"
+ ForcedIncludeFiles="agi_pre.h"
/>
Advanced -> Force Includes),
// then set this file to generate the precompiled header
//
@@ -48,5 +48,5 @@
#include "config.h"
-#include "stdwx.h"
+#include "agi_pre.h"
diff --git a/aegisub/src/stdwx.h b/aegisub/src/agi_pre.h
similarity index 97%
rename from aegisub/src/stdwx.h
rename to aegisub/src/agi_pre.h
index 1c066a5d8..a7e426d4e 100644
--- a/aegisub/src/stdwx.h
+++ b/aegisub/src/agi_pre.h
@@ -29,7 +29,7 @@
//
// $Id$
-/// @file stdwx.h
+/// @file agi_pre.h
/// @brief Precompiled headers include file, including all headers that should be precompiled
/// @ingroup main
///
@@ -49,13 +49,16 @@
/////////
// Setup
+#define WIN32_LEAN_AND_MEAN
+#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
-#define WIN32_LEAN_AND_MEAN
-#define WX_PRE
///////////////
// STD headers
diff --git a/aegisub/src/ass_attachment.cpp b/aegisub/src/ass_attachment.cpp
index 74d5ba1fa..10d8684ef 100644
--- a/aegisub/src/ass_attachment.cpp
+++ b/aegisub/src/ass_attachment.cpp
@@ -39,7 +39,7 @@
// Includes
#include "config.h"
-#ifndef WX_PRE
+#ifndef AGI_PRE
#include
#include
#endif
diff --git a/aegisub/src/ass_dialogue.cpp b/aegisub/src/ass_dialogue.cpp
index 1f5ef6845..0e9672638 100644
--- a/aegisub/src/ass_dialogue.cpp
+++ b/aegisub/src/ass_dialogue.cpp
@@ -39,12 +39,12 @@
// Includes
#include "config.h"
-#ifndef WX_PRE
+#ifndef AGI_PRE
+#include
#include
#include
#endif
-#include
#include "ass_dialogue.h"
#include "ass_override.h"
#include "vfr.h"
diff --git a/aegisub/src/config.h b/aegisub/src/config.h
index fc9cb1990..d9fccf73c 100644
--- a/aegisub/src/config.h
+++ b/aegisub/src/config.h
@@ -1,4 +1,4 @@
-#ifndef WX_PRE
+#ifndef AGI_PRE
#ifdef _WIN32
@@ -15,4 +15,4 @@
#endif // __WINDOWS__
-#endif // WX_PRE
+#endif // AGI_PRE
diff --git a/aegisub/src/config/config_unix.h b/aegisub/src/config/config_unix.h
index 0b4af24af..228ba20fb 100644
--- a/aegisub/src/config/config_unix.h
+++ b/aegisub/src/config/config_unix.h
@@ -16,8 +16,6 @@
#include
#endif
-#include
-
// These shouldn't be needed any longer, if there are
// any occurrences of __int64 replace them with long long.
//typedef int64_t __int64;
diff --git a/aegisub/src/main.cpp b/aegisub/src/main.cpp
index ba6017ac1..c0445d818 100644
--- a/aegisub/src/main.cpp
+++ b/aegisub/src/main.cpp
@@ -39,7 +39,7 @@
// Includes
#include "config.h"
-#ifndef WX_PRE
+#ifndef AGI_PRE
#include
#include
#include
diff --git a/aegisub/src/main.h b/aegisub/src/main.h
index a29a7db58..76e503c49 100644
--- a/aegisub/src/main.h
+++ b/aegisub/src/main.h
@@ -38,7 +38,7 @@
///////////////////
// Include headers
-#ifndef WX_PRE
+#ifndef AGI_PRE
#include
#include
#include