Skip to content

Commit 5e92b5b

Browse files
Added MacroUtils.h
Referenced in Parser/Precompiled.h. UrsineLogTools.h simply defines UAssert( ) - which you can replace with your assertion tools.
1 parent cb50123 commit 5e92b5b

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

Source/MacroUtils.h

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/* ----------------------------------------------------------------------------
2+
** Team Bear King
3+
** © 201x DigiPen Institute of Technology, All Rights Reserved.
4+
**
5+
** MacroUtils.h
6+
**
7+
** Author:
8+
** - Austin Brunkhorst - a.brunkhorst@digipen.edu
9+
** --------------------------------------------------------------------------*/
10+
11+
#pragma once
12+
13+
#define __STRINGIFY(x) #x
14+
#define STRINGIFY(x) __STRINGIFY(x)
15+
16+
#define __WIDEN(x) L ## x
17+
#define WIDEN(x) __WIDEN(x)
18+
19+
#define __MESSAGE(text) __pragma( message(__FILE__ "(" STRINGIFY(__LINE__) ")" text) )
20+
21+
// Outputs a warning during compile time
22+
#define URSINE_WARNING(text) __MESSAGE( " : Warning: " ##text )
23+
24+
// Outputs an error during compile time
25+
#define URSINE_ERROR(text) __MESSAGE( " : Error: " ##text )
26+
27+
// Outputs a message during compile time
28+
#define URSINE_MESSAGE(text) __MESSAGE( ": " ##text )
29+
30+
#ifdef URSINE_TODO_AS_WARNINGS
31+
32+
// Outputs a TODO message during compile time
33+
#define URSINE_TODO(text) __MESSAGE( " : Warning: TODO: " ##text )
34+
35+
#else
36+
37+
// Outputs a TODO message during compile time
38+
#define URSINE_TODO(text) __MESSAGE( ": TODO: " ##text )
39+
40+
#endif

0 commit comments

Comments
 (0)