Prepping for singleplayer style client and server.
This commit is contained in:
@@ -7,6 +7,12 @@
|
||||
|
||||
#include "assert.h"
|
||||
|
||||
pthread_t assertMainThread = 0;
|
||||
|
||||
void assertInit() {
|
||||
assertMainThread = pthread_self();
|
||||
}
|
||||
|
||||
void assertTrueImpl(
|
||||
const char *file,
|
||||
const int32_t line,
|
||||
|
@@ -8,6 +8,13 @@
|
||||
#pragma once
|
||||
#include "dusk.h"
|
||||
|
||||
extern pthread_t assertMainThread;
|
||||
|
||||
/**
|
||||
* Initialises the assert system.
|
||||
*/
|
||||
void assertInit();
|
||||
|
||||
/**
|
||||
* Assert a given value to be true.
|
||||
*
|
||||
@@ -128,4 +135,10 @@ void assertMemoryRangeMatchesImpl(
|
||||
#define assertStrLenMin(str, len, message) \
|
||||
assertTrue(strlen(str) >= len, message)
|
||||
|
||||
#define assertIsMainThread(message) \
|
||||
assertTrue(pthread_self() == assertMainThread, message)
|
||||
|
||||
#define assertNotMainThread(message) \
|
||||
assertFalse(pthread_self() == assertMainThread, message)
|
||||
|
||||
// EOF
|
Reference in New Issue
Block a user