Include lagi_pre.h in agi_pre.h and remove all duplicates

This eliminates some duplicated logic and potential tr1/non-tr1 header
mismatches, and removes the need for the #if defined(AGI_PRE) ||
defined(LAGI_PRE) guard that was used in a few of the libaegisub headers.

Originally committed to SVN as r5515.
This commit is contained in:
Thomas Goyne 2011-07-26 22:25:10 +00:00
parent 665cddf235
commit ead31761db
2 changed files with 13 additions and 40 deletions

View file

@ -15,11 +15,14 @@
#ifdef HAVE_SYS_TIME_H #ifdef HAVE_SYS_TIME_H
# include <sys/time.h> # include <sys/time.h>
#else #else
# include <time.h> # include <ctime>
#endif #endif
// Windows C // Windows C
#ifdef _WIN32 #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 #define WIN32_LEAN_AND_MEAN
#include <windows.h> #include <windows.h>
#include <io.h> #include <io.h>

View file

@ -40,12 +40,6 @@
/// @note Make sure that you disable use of precompiled headers on md5.c and /// @note Make sure that you disable use of precompiled headers on md5.c and
/// MatroskaParser.c, as well as any possible future .c files. /// MatroskaParser.c, as well as any possible future .c files.
#include "config.h"
/////////
// Setup
#define AGI_PRE
// Block msvc from complaining about not using msvc-specific versions for // Block msvc from complaining about not using msvc-specific versions for
// insecure C functions. // insecure C functions.
#ifdef _CRT_SECURE_NO_WARNINGS #ifdef _CRT_SECURE_NO_WARNINGS
@ -54,55 +48,31 @@
#define _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS
#endif #endif
/////////////// #include "config.h"
// STD headers
#include <algorithm>
#include <deque>
#include <fstream>
#include <iterator>
#include <iostream>
#include <list>
#include <map>
#include <set>
#include <sstream>
#include <string>
#include <utility>
#include <vector>
#ifdef _WIN32 #include "../libaegisub/lagi_pre.h"
#include <functional>
#include <memory> /////////
#else // Setup
#include <tr1/functional> #define AGI_PRE
#include <tr1/memory>
#endif // Common C++
#include <set>
// General headers // General headers
#include <assert.h>
#include <ctype.h> #include <ctype.h>
#include <errno.h>
#include <fcntl.h> #include <fcntl.h>
#include <iconv.h> #include <iconv.h>
#include <inttypes.h> #include <inttypes.h>
#include <locale.h> #include <locale.h>
#include <math.h>
#ifdef _OPENMP #ifdef _OPENMP
// Not all compilers have <omp.h> (example: MSVC Express) // Not all compilers have <omp.h> (example: MSVC Express)
#include <omp.h> #include <omp.h>
#endif #endif
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h>
#include <time.h>
#include <wchar.h> #include <wchar.h>
#ifdef _WIN32 #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 <windows.h> #include <windows.h>
#include <objbase.h> #include <objbase.h>
#include <mmsystem.h> #include <mmsystem.h>