0
0
mirror of https://github.com/yse/easy_profiler.git synced 2024-12-26 08:01:51 +08:00

Merge pull request #198 from mdiem-sc/markus/fix-emscripten-build

Fix EMSCRIPTEN build
This commit is contained in:
Sergey Yagovtsev 2024-09-20 19:25:08 +03:00 committed by GitHub
commit 6d2589b0f6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 3 deletions

View File

@ -77,6 +77,9 @@ inline profiler::thread_id_t getCurrentThreadId()
#elif defined(__QNX__) #elif defined(__QNX__)
EASY_THREAD_LOCAL static const profiler::thread_id_t _id = (profiler::thread_id_t)gettid(); EASY_THREAD_LOCAL static const profiler::thread_id_t _id = (profiler::thread_id_t)gettid();
return _id; return _id;
#elif defined(__EMSCRIPTEN__)
EASY_THREAD_LOCAL static const profiler::thread_id_t _id = static_cast<profiler::thread_id_t>(pthread_self());
return _id;
#else #else
EASY_THREAD_LOCAL static const profiler::thread_id_t _id = (profiler::thread_id_t)syscall(__NR_gettid); EASY_THREAD_LOCAL static const profiler::thread_id_t _id = (profiler::thread_id_t)syscall(__NR_gettid);
return _id; return _id;

View File

@ -59,7 +59,9 @@ The Apache License, Version 2.0 (the "License");
#else #else
// Windows // Windows
# define WIN32_LEAN_AND_MEAN #ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
# include <winsock2.h> # include <winsock2.h>
# include <windows.h> # include <windows.h>
# include <ws2tcpip.h> # include <ws2tcpip.h>

View File

@ -91,7 +91,6 @@ namespace profiler {
public: public:
CSwitchEvent() = default;
CSwitchEvent(const CSwitchEvent&) = default; CSwitchEvent(const CSwitchEvent&) = default;
explicit CSwitchEvent(timestamp_t _begin_time, thread_id_t _tid) EASY_NOEXCEPT; explicit CSwitchEvent(timestamp_t _begin_time, thread_id_t _tid) EASY_NOEXCEPT;
@ -129,7 +128,7 @@ namespace profiler {
#pragma pack(push, 1) #pragma pack(push, 1)
class PROFILER_API SerializedBlockDescriptor EASY_FINAL : public BaseBlockDescriptor 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: public: