From c5d9a94ed9c48122eb5e51c2e84a40c3dc58710c Mon Sep 17 00:00:00 2001 From: Markus Diem Date: Fri, 3 Dec 2021 10:26:10 +0100 Subject: [PATCH 1/3] thread ID for EMSCRIPTEN --- easy_profiler_core/current_thread.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/easy_profiler_core/current_thread.h b/easy_profiler_core/current_thread.h index fc39ea3..ec24e9d 100644 --- a/easy_profiler_core/current_thread.h +++ b/easy_profiler_core/current_thread.h @@ -77,6 +77,9 @@ inline profiler::thread_id_t getCurrentThreadId() #elif defined(__QNX__) EASY_THREAD_LOCAL static const profiler::thread_id_t _id = (profiler::thread_id_t)gettid(); return _id; +#elif defined(__EMSCRIPTEN__) + EASY_THREAD_LOCAL static const profiler::thread_id_t _id = static_cast(pthread_self()); + return _id; #else EASY_THREAD_LOCAL static const profiler::thread_id_t _id = (profiler::thread_id_t)syscall(__NR_gettid); return _id; From 66952fda286ef27ee6a3b71018ddb7056ed70761 Mon Sep 17 00:00:00 2001 From: Markus Diem Date: Fri, 3 Dec 2021 11:01:15 +0100 Subject: [PATCH 2/3] remove default constructor warning --- easy_profiler_core/include/easy/serialized_block.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/easy_profiler_core/include/easy/serialized_block.h b/easy_profiler_core/include/easy/serialized_block.h index 6d1a16b..30f3fb9 100644 --- a/easy_profiler_core/include/easy/serialized_block.h +++ b/easy_profiler_core/include/easy/serialized_block.h @@ -91,7 +91,6 @@ namespace profiler { public: - CSwitchEvent() = default; CSwitchEvent(const CSwitchEvent&) = default; explicit CSwitchEvent(timestamp_t _begin_time, thread_id_t _tid) EASY_NOEXCEPT; @@ -129,7 +128,7 @@ namespace profiler { #pragma pack(push, 1) class PROFILER_API SerializedBlockDescriptor EASY_FINAL : public BaseBlockDescriptor { - uint16_t m_nameLength; ///< Length of the name including trailing '\0' sybmol + uint16_t m_nameLength; ///< Length of the name including trailing '\0' symbol public: From 98fc4c4713c7e1f6e2719edb19f2363bd542f27b Mon Sep 17 00:00:00 2001 From: Markus Diem Date: Mon, 22 Nov 2021 10:24:12 +0100 Subject: [PATCH 3/3] win: fix build --- easy_profiler_core/include/easy/easy_socket.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/easy_profiler_core/include/easy/easy_socket.h b/easy_profiler_core/include/easy/easy_socket.h index c91a6cb..397316e 100644 --- a/easy_profiler_core/include/easy/easy_socket.h +++ b/easy_profiler_core/include/easy/easy_socket.h @@ -59,7 +59,9 @@ The Apache License, Version 2.0 (the "License"); #else // Windows -# define WIN32_LEAN_AND_MEAN +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif # include # include # include