Skip to content

Commit 278797e

Browse files
committed
Cleanup xrCore.h
- Don't include all the standard headers.. - Reorganize warning suppressions () - Don't use include guards
1 parent 13d2e01 commit 278797e

File tree

3 files changed

+16
-62
lines changed

3 files changed

+16
-62
lines changed

src/xrCore/FTimer.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
//#include "_stl_extensions.h"
88
#include "_math.h"
99
#include "log.h"
10+
#include <chrono>
1011

1112
class CTimer_paused;
1213

src/xrCore/stdafx.h

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,8 @@
1-
// stdafx.h : include file for standard system include files,
2-
// or project specific include files that are used frequently, but
3-
// are changed infrequently
4-
//
5-
#ifndef stdafxH
6-
#define stdafxH
71
#pragma once
82

93
#pragma warning(disable : 4661)
104

115
#include "xrCore.h"
126
#include "Common/Platform.hpp"
137
#include "Common/Util.hpp"
14-
//.#include "Include/xrAPI/xrAPI.h"
15-
#endif
16-
17-
#pragma hdrstop
8+
//#include "Include/xrAPI/xrAPI.h"

src/xrCore/xrCore.h

Lines changed: 14 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
#pragma once
2-
#ifndef xrCoreH
3-
#define xrCoreH
42

53
// XXX: upgrade std hash structures
64
#define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS
@@ -47,68 +45,33 @@
4745
#define XR_NOEXCEPT_OP(x) noexcept(x)
4846
#endif
4947

50-
#include "Common/Platform.hpp"
51-
52-
#include <stdio.h>
53-
#include <stdlib.h>
54-
#include <stdarg.h>
55-
#include <math.h>
56-
#include <string.h>
57-
#include <typeinfo.h>
58-
59-
#ifdef _DEBUG
48+
#if !defined(DEBUG) && (defined(_DEBUG) || defined(MIXED))
6049
#define DEBUG
6150
#endif
62-
#ifdef MIXED
63-
# ifndef DEBUG
64-
# define DEBUG
65-
# endif
66-
#endif
6751

6852
#ifndef DEBUG
6953
#pragma inline_depth(254)
7054
#pragma inline_recursion(on)
7155
#pragma intrinsic(abs, fabs, fmod, sin, cos, tan, asin, acos, atan, sqrt, exp, log, log10, strcat)
7256
#endif
7357

74-
#include <time.h>
75-
7658
// Warnings
77-
#pragma warning(disable : 4251) // object needs DLL interface
78-
#pragma warning(disable : 4201) // nonstandard extension used : nameless struct/union
7959
#pragma warning(disable : 4100) // unreferenced formal parameter
8060
#pragma warning(disable : 4127) // conditional expression is constant
81-
//#pragma warning (disable : 4530 ) // C++ exception handler used, but unwind semantics are not enabled
61+
#pragma warning(disable : 4201) // nonstandard extension used : nameless struct/union
62+
#pragma warning(disable : 4251) // object needs DLL interface
8263
#pragma warning(disable : 4345)
83-
#pragma warning(disable : 4714) // __forceinline not inlined
84-
#ifndef DEBUG
85-
#pragma warning(disable : 4189) // local variable is initialized but not refenced
86-
#endif // frequently in release code due to large amount of VERIFY
64+
//#pragma warning (disable : 4530 ) // C++ exception handler used, but unwind semantics are not enabled
8765

88-
#ifdef _M_AMD64
66+
#ifdef XR_X64
8967
#pragma warning(disable : 4512)
9068
#endif
9169

92-
// stl
93-
#pragma warning(push)
94-
#pragma warning(disable : 4702)
95-
#include <algorithm>
96-
#include <limits>
97-
#include <vector>
98-
#include <stack>
99-
#include <list>
100-
#include <set>
101-
#include <map>
102-
103-
#include <hash_map>
104-
#include <hash_set>
105-
106-
#include <cinttypes>
107-
#include <chrono>
108-
109-
#include <string>
110-
#pragma warning(pop)
111-
#pragma warning(disable : 4100) // unreferenced formal parameter
70+
#pragma warning(disable : 4714) // __forceinline not inlined
71+
72+
#ifndef DEBUG
73+
#pragma warning(disable : 4189) // local variable is initialized but not referenced
74+
#endif // frequently in release code due to large amount of VERIFY
11275

11376
// Our headers
11477
#include "xrCore_impexp.h"
@@ -217,11 +180,11 @@ class destructor
217180
T& operator()() { return *ptr; }
218181
};
219182

220-
// ********************************************** The Core definition
183+
// ***** The Core definition *****
221184
class XRCORE_API xrCore
222185
{
223-
const char* buildDate;
224-
u32 buildId;
186+
const char* buildDate = "";
187+
u32 buildId = 0;
225188

226189
public:
227190
string64 ApplicationName;
@@ -238,10 +201,9 @@ class XRCORE_API xrCore
238201
void _destroy();
239202
const char* GetBuildDate() const { return buildDate; }
240203
u32 GetBuildId() const { return buildId; }
204+
241205
private:
242206
void CalculateBuildId();
243207
};
244208

245209
extern XRCORE_API xrCore Core;
246-
247-
#endif

0 commit comments

Comments
 (0)