73 lines
2.1 KiB
C++
Executable File
73 lines
2.1 KiB
C++
Executable File
// Basic features
|
|
// Enable or disable memory pooling for specific object types
|
|
//#define M2_USE_POOL
|
|
// Enable or disable heap allocation debugging
|
|
//#define DEBUG_ALLOC
|
|
|
|
#include "debug_allocator.h"
|
|
|
|
#include "../../libthecore/include/stdafx.h"
|
|
|
|
/* ### LINUX-BLOCK-BEGIN (stdafx.h <memory>) #############################
|
|
* libc++ (FreeBSD) drags <memory> in transitively through <string> /
|
|
* <algorithm>; libstdc++ does not. std::unique_ptr - used by
|
|
* char_change_empire.cpp:35 and questlua_building.cpp:100 - is therefore
|
|
* undeclared on Linux:
|
|
* error: 'unique_ptr' is not a member of 'std'
|
|
* Pulled in centrally here rather than per-file, because every game TU goes
|
|
* through this header and the same latent dependency may exist behind
|
|
* #ifdef'd code paths that are not currently compiled.
|
|
*
|
|
* (The other Linux blocker in this area - libthecore's `#define false 0',
|
|
* which broke 162 of 166 TUs under -std=c++23 by making libstdc++'s
|
|
* constraints int-typed - is fixed at source in
|
|
* libthecore/include/stdafx.h:211, so nothing is needed here for it. Its one
|
|
* surviving consequence in this module is the stray cast at arena.cpp:83,
|
|
* which only ever compiled because `false' was an int; see that file.) */
|
|
#if defined(__linux__)
|
|
#include <memory>
|
|
#endif
|
|
/* ### LINUX-BLOCK-END (stdafx.h <memory>) ############################### */
|
|
|
|
#include "../../common/singleton.h"
|
|
#include "../../common/utils.h"
|
|
#include "../../common/service.h"
|
|
|
|
#include <algorithm>
|
|
#include <math.h>
|
|
#include <list>
|
|
#include <map>
|
|
#include <set>
|
|
#include <queue>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#ifdef __GNUC__
|
|
#include <float.h>
|
|
#include <unordered_map>
|
|
#include <unordered_set>
|
|
#define TR1_NS std::tr1
|
|
#else
|
|
#include <unordered_map>
|
|
#include <unordered_set>
|
|
#define TR1_NS std
|
|
#define isdigit iswdigit
|
|
#define isspace iswspace
|
|
#endif
|
|
|
|
#include "typedef.h"
|
|
#include "locale.hpp"
|
|
#include "event.h"
|
|
|
|
#define PASSES_PER_SEC(sec) ((sec) * passes_per_sec)
|
|
|
|
#ifndef M_PI
|
|
#define M_PI 3.14159265358979323846 /* pi */
|
|
#endif
|
|
#ifndef M_PI_2
|
|
#define M_PI_2 1.57079632679489661923 /* pi/2 */
|
|
#endif
|
|
|
|
#define IN
|
|
#define OUT
|