Skip to content

Commit 8dc6fdb

Browse files
tamlin-mikeXottab-DUTY
authored andcommitted
Misc header fixes.
Add #pragma once, make headers more self-contained, a few ISO/POSIX fixes (adding leading underscore to function names).
1 parent 581908b commit 8dc6fdb

24 files changed

+65
-18
lines changed

src/Common/inlining_macros.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
#ifdef _MSC_VER
21
#pragma once
3-
#endif
42
#ifndef INLINING_MACROS_H
53
#define INLINING_MACROS_H
64

src/Common/xr_impexp_macros.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
#ifdef _MSC_VER
21
#pragma once
3-
#endif
42
#ifndef XR_IMPEXP_MACROS_H
53
#define XR_IMPEXP_MACROS_H
64

src/Layers/xrRender/VertexCache.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
#pragma once
12
#ifndef VERTEX_CACHE_H
23
#define VERTEX_CACHE_H
4+
#include"Common/inlining_macros.h"
5+
#include"xrCore/_types.h"
6+
#include"xrCore/_stl_extensions.h"
37

48
class VertexCache
59
{

src/utils/Shader_xrLC.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,15 @@ class Shader_xrLC_LIB
9191
u32 GetID(LPCSTR name) const
9292
{
9393
for (auto it = library.begin(); it != library.end(); it++)
94-
if (0 == stricmp(name, it->Name))
94+
if (0 == _stricmp(name, it->Name))
9595
return u32(it - library.begin());
9696
return u32(-1);
9797
}
9898

9999
Shader_xrLC* Get(LPCSTR name)
100100
{
101101
for (auto& shader : library)
102-
if (0 == stricmp(name, shader.Name))
102+
if (0 == _stricmp(name, shader.Name))
103103
return &shader;
104104
return nullptr;
105105
}
@@ -117,7 +117,7 @@ class Shader_xrLC_LIB
117117
void Remove(LPCSTR name)
118118
{
119119
for (auto it = library.begin(); it != library.end(); it++)
120-
if (0 == stricmp(name, it->Name))
120+
if (0 == _stricmp(name, it->Name))
121121
{
122122
library.erase(it);
123123
break;

src/xrCore/FS.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
#pragma once
12
// FS.h: interface for the CFS class.
23
//
34
//////////////////////////////////////////////////////////////////////
45

56
#ifndef fsH
67
#define fsH
8+
#include "_stl_extensions.h"
79

810
#define CFS_CompressMark (1ul << 31ul)
911
#define CFS_HeaderChunkID (666)

src/xrCore/FTimer.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
#pragma once
22
#ifndef FTimerH
33
#define FTimerH
4+
#include "xrCore_impexp.h"
5+
#include "_stl_extensions.h"
6+
#include "_math.h"
7+
#include "log.h"
48

59
class CTimer_paused;
610

src/xrCore/Threading/Lock.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#pragma once
2-
#include "xrCore/xrCore.h"
2+
#include "xrCore/xrCore_impexp.h"
33

44
#include <mutex>
55
#include <atomic>

src/xrCore/_color.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
#ifndef __C__
2-
#define __C__
1+
#pragma once
2+
#ifndef XRCORE_COLOR_H
3+
#define XRCORE_COLOR_H
4+
#include "vector.h" // clampr
35

46
// maps unsigned 8 bits/channel to D3DCOLOR
57
ICF u32 color_argb(u32 a, u32 r, u32 g, u32 b)
@@ -256,4 +258,4 @@ BOOL _valid(const _color<T>& c)
256258
return _valid(c.r) && _valid(c.g) && _valid(c.b) && _valid(c.a);
257259
}
258260

259-
#endif
261+
#endif // XRCORE_COLOR_H

src/xrCore/_plane.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
#pragma once
12
#ifndef _PLANE
23
#define _PLANE
4+
#include "_vector3d.h"
5+
#include "_matrix.h"
36

47
template <class T>
58
class _plane

src/xrCore/_rect.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
#pragma once
12
#ifndef __FRECT
23
#define __FRECT
4+
#include "_vector2.h"
35

46
template <class T>
57
struct _rect

0 commit comments

Comments
 (0)