Skip to content

Commit

Permalink
Cleanup xrCore.h
Browse files Browse the repository at this point in the history
- Don't include all the standard headers..
- Reorganize warning suppressions ()
- Don't use include guards
  • Loading branch information
Xottab-DUTY committed Nov 4, 2017
1 parent 13d2e01 commit 278797e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 62 deletions.
1 change: 1 addition & 0 deletions src/xrCore/FTimer.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//#include "_stl_extensions.h"
#include "_math.h"
#include "log.h"
#include <chrono>

class CTimer_paused;

Expand Down
11 changes: 1 addition & 10 deletions src/xrCore/stdafx.h
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#ifndef stdafxH
#define stdafxH
#pragma once

#pragma warning(disable : 4661)

#include "xrCore.h"
#include "Common/Platform.hpp"
#include "Common/Util.hpp"
//.#include "Include/xrAPI/xrAPI.h"
#endif

#pragma hdrstop
//#include "Include/xrAPI/xrAPI.h"
66 changes: 14 additions & 52 deletions src/xrCore/xrCore.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#pragma once
#ifndef xrCoreH
#define xrCoreH

// XXX: upgrade std hash structures
#define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS
Expand Down Expand Up @@ -47,68 +45,33 @@
#define XR_NOEXCEPT_OP(x) noexcept(x)
#endif

#include "Common/Platform.hpp"

#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <math.h>
#include <string.h>
#include <typeinfo.h>

#ifdef _DEBUG
#if !defined(DEBUG) && (defined(_DEBUG) || defined(MIXED))
#define DEBUG
#endif
#ifdef MIXED
# ifndef DEBUG
# define DEBUG
# endif
#endif

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

#include <time.h>

// Warnings
#pragma warning(disable : 4251) // object needs DLL interface
#pragma warning(disable : 4201) // nonstandard extension used : nameless struct/union
#pragma warning(disable : 4100) // unreferenced formal parameter
#pragma warning(disable : 4127) // conditional expression is constant
//#pragma warning (disable : 4530 ) // C++ exception handler used, but unwind semantics are not enabled
#pragma warning(disable : 4201) // nonstandard extension used : nameless struct/union
#pragma warning(disable : 4251) // object needs DLL interface
#pragma warning(disable : 4345)
#pragma warning(disable : 4714) // __forceinline not inlined
#ifndef DEBUG
#pragma warning(disable : 4189) // local variable is initialized but not refenced
#endif // frequently in release code due to large amount of VERIFY
//#pragma warning (disable : 4530 ) // C++ exception handler used, but unwind semantics are not enabled

#ifdef _M_AMD64
#ifdef XR_X64
#pragma warning(disable : 4512)
#endif

// stl
#pragma warning(push)
#pragma warning(disable : 4702)
#include <algorithm>
#include <limits>
#include <vector>
#include <stack>
#include <list>
#include <set>
#include <map>

#include <hash_map>
#include <hash_set>

#include <cinttypes>
#include <chrono>

#include <string>
#pragma warning(pop)
#pragma warning(disable : 4100) // unreferenced formal parameter
#pragma warning(disable : 4714) // __forceinline not inlined

#ifndef DEBUG
#pragma warning(disable : 4189) // local variable is initialized but not referenced
#endif // frequently in release code due to large amount of VERIFY

// Our headers
#include "xrCore_impexp.h"
Expand Down Expand Up @@ -217,11 +180,11 @@ class destructor
T& operator()() { return *ptr; }
};

// ********************************************** The Core definition
// ***** The Core definition *****
class XRCORE_API xrCore
{
const char* buildDate;
u32 buildId;
const char* buildDate = "";
u32 buildId = 0;

public:
string64 ApplicationName;
Expand All @@ -238,10 +201,9 @@ class XRCORE_API xrCore
void _destroy();
const char* GetBuildDate() const { return buildDate; }
u32 GetBuildId() const { return buildId; }

private:
void CalculateBuildId();
};

extern XRCORE_API xrCore Core;

#endif

0 comments on commit 278797e

Please sign in to comment.