make windows-compliant

- fix BS_thread_pool include error (pulls in windows.h, symbols were
redefined)
- remove all std::println uses :(, seems like mingw doesn't like those
- allow to disable backward from cmake
This commit is contained in:
2026-02-27 12:31:08 +01:00
parent 16df3b7d51
commit 85ed3a758a
11 changed files with 110 additions and 60 deletions

View File

@ -8,7 +8,6 @@
#include <condition_variable>
#include <cstddef>
#include <mutex>
#include <print>
#include <queue>
#include <raylib.h>
#include <raymath.h>
@ -17,8 +16,16 @@
#include <vector>
#ifdef THREADPOOL
#if defined(_WIN32)
#define NOGDI // All GDI defines and routines
#define NOUSER // All USER defines and routines
#endif
#define BS_THREAD_POOL_NATIVE_EXTENSIONS
#include <BS_thread_pool.hpp>
#if defined(_WIN32) // raylib uses these names as function parameters
#undef near
#undef far
#endif
#endif
#ifdef TRACY
@ -78,10 +85,16 @@ public:
: threads(std::thread::hardware_concurrency() - 1, SetThreadName)
#endif
{
std::println("Using Barnes-Hut + Octree repulsion force calculation.");
std::cout << std::format(
"Using Barnes-Hut + Octree repulsion force calculation.")
<< std::endl;
#ifdef THREADPOOL
std::println("Thread-pool: {} threads.", threads.get_thread_count());
std::cout << std::format("Thread-pool: {} threads.",
threads.get_thread_count())
<< std::endl;
#else
std::cout << std::format("Thread-pool: Disabled.") << std::endl;
#endif
};