Skip to content

Commit

Permalink
Merge branch 'master' of github.com:jhasse/jngl
Browse files Browse the repository at this point in the history
  • Loading branch information
jhasse committed Oct 31, 2024
2 parents f975818 + c15801a commit 4495f40
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
7 changes: 7 additions & 0 deletions include/public/atomic_queue/defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ static inline void spin_loop_pause() noexcept {
asm volatile (".insn i 0x0F, 0, x0, x0, 0x010");
}
} // namespace atomic_queue
#elif defined(__wasm__)
namespace atomic_queue {
constexpr int CACHE_LINE_SIZE = 64;
static inline void spin_loop_pause() noexcept {
// no instruction yet, see https://github.com/WebAssembly/threads/issues/15
}
} // namespace atomic_queue
#else
#warning "Unknown CPU architecture. Using L1 cache line size of 64 bytes and no spinloop pause instruction."
namespace atomic_queue {
Expand Down
8 changes: 8 additions & 0 deletions src/log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,17 @@ std::string stripAnsiEscapeCodes(const std::string& in) {
void log(const std::string& appName, const std::string& level, const std::string& message) {
std::ostringstream tmp;
if (!appName.empty()) {
#ifdef __EMSCRIPTEN__
tmp << '[' << stripAnsiEscapeCodes(appName) << ']';
#else
tmp << '[' << appName << ']';
#endif
}
#ifdef __EMSCRIPTEN__
tmp << '[' << stripAnsiEscapeCodes(level) << "] ";
#else
tmp << '[' << level << "] ";
#endif
bool first = true;
std::stringstream lines(message);
std::string line;
Expand Down
4 changes: 1 addition & 3 deletions src/unittest/ColorTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@

namespace {
boost::ut::suite _ = [] {
using boost::ut::expect;
using boost::ut::eq;
using boost::ut::operator""_test;
using namespace boost::ut; // NOLINT
"Color"_test = [] {
const auto a = 0x68da4f_rgb;
const auto b = jngl::Color(0x68, 0xda, 0x4f);
Expand Down

0 comments on commit 4495f40

Please sign in to comment.