mirror of
https://github.com/clangen/musikcube.git
synced 2024-12-28 15:16:43 +00:00
ASSERT_MAIN_THREAD() cleanups.
This commit is contained in:
parent
47739cb322
commit
2989870580
@ -17,7 +17,8 @@ include(CheckAtomic)
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -Wno-unused-result -Wno-deprecated-declarations")
|
||||
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -frtti -fexceptions")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG -g -frtti -fexceptions")
|
||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DDEBUG")
|
||||
|
||||
# enable for additional memory checking with fsanitize
|
||||
# set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g3 -fsanitize=address,undefined")
|
||||
|
@ -36,12 +36,6 @@
|
||||
|
||||
#include <musikcore/audio/Buffer.h>
|
||||
|
||||
#define DEBUG 0
|
||||
|
||||
#if DEBUG > 0
|
||||
#include <iostream>
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#define CopyFloat(dst, src, num) CopyMemory(dst, src, (num) * sizeof(float))
|
||||
#else
|
||||
|
@ -59,20 +59,16 @@ static Window* focused = nullptr;
|
||||
static MessageQueue messageQueue;
|
||||
static std::shared_ptr<INavigationKeys> keys;
|
||||
|
||||
#ifndef WIN32
|
||||
#if DEBUG
|
||||
static int64_t mainThreadId = reinterpret_cast<int64_t>(pthread_self());
|
||||
#define ASSERT_MAIN_THREAD() assert(reinterpret_cast<int64_t>(pthread_self()) == mainThreadId);
|
||||
#else
|
||||
#define ASSERT_MAIN_THREAD()
|
||||
#endif
|
||||
#else
|
||||
#if DEBUG
|
||||
#define ASSERT_MAIN_THREAD()
|
||||
#else
|
||||
#ifdef DEBUG
|
||||
#ifdef WIN32
|
||||
static DWORD mainThreadId = GetCurrentThreadId();
|
||||
#define ASSERT_MAIN_THREAD() assert(GetCurrentThreadId() == mainThreadId);
|
||||
#else
|
||||
static pthread_t mainThreadId = pthread_self();
|
||||
#define ASSERT_MAIN_THREAD() assert(pthread_self() == mainThreadId);
|
||||
#endif
|
||||
#else
|
||||
#define ASSERT_MAIN_THREAD()
|
||||
#endif
|
||||
|
||||
const int Window::kLastReservedMessageId = INT_MAX;
|
||||
|
Loading…
Reference in New Issue
Block a user