CommonLib
Loading...
Searching...
No Matches
Preprocessor.h
Go to the documentation of this file.
1#pragma once
2
3///
4/// Deletes an object and resets its pointer.
5///
6/// \param PTR The pointer to the object to delete.
7///
8#define SAFE_DELETE(PTR)
9 if (PTR) { delete PTR; PTR = nullptr; }
10
11///
12/// Returns a value if the condition is not met.
13///
14/// \param CONDITION The condition to check.
15/// \param RETURN_VALUE The value to return.
16///
17#define ASSERT_RETURN(CONDITION, RETURN_VALUE)
18 if (!(CONDITION)) return RETURN_VALUE;
19
20///
21/// Returns `true` if the condition is not met.
22///
23/// \param CONDITION The condition to check.
24///
25#define ASSERT_RETURN_TRUE(CONDITION)
26 ASSERT_RETURN(CONDITION, true)
27
28///
29/// Returns `false` if the condition is not met.
30///
31/// \param CONDITION The condition to check.
32///
33#define ASSERT_RETURN_FALSE(CONDITION)
34 ASSERT_RETURN(CONDITION, false)
35
36#ifdef WIN32
37#include "Win32/Preprocessor.h"
38#endif
#define ASSERT_RETURN(CONDITION, RETURN_VALUE)
Definition Preprocessor.h:17
bool IsNeighbour(const std::filesystem::path &in_rPath)
Definition ThisProcess.inl:10
std::filesystem::path GetExecutableRoot()
Definition ThisProcess.inl:5
Definition ThisProcess.inl:4