Skip to content

Commit

Permalink
Merge pull request #2033 from meganz/hotfix/no_thread_local_until_we_…
Browse files Browse the repository at this point in the history
…abandon_winXP

With thread_local in use, the text appearing in MEGAsync on windows X…
  • Loading branch information
mattw-mega authored Jun 3, 2020
2 parents 29cc212 + fcbfd0e commit 610f41b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 4 additions & 1 deletion include/mega/logging.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,11 @@ class SimpleLogger
static OutputStreams getOutput(enum LogLevel ll);
#else

#ifdef WIN32
#ifdef WIN64
static thread_local std::array<char, LOGGER_CHUNKS_SIZE> mBuffer;
#elif WIN32
// Keep this as a normal class member on WIN32 until we abandon XP (Qt fonts appear with strikethrough on XP otherwise)
/*static thread_local*/ std::array<char, LOGGER_CHUNKS_SIZE> mBuffer;
#else
static __thread std::array<char, LOGGER_CHUNKS_SIZE> mBuffer;
#endif
Expand Down
6 changes: 4 additions & 2 deletions src/logging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ long long SimpleLogger::maxPayloadLogSize = 10240;

#ifdef ENABLE_LOG_PERFORMANCE

#ifdef WIN32
thread_local std::array<char, LOGGER_CHUNKS_SIZE> SimpleLogger::mBuffer;
#ifdef WIN64
thread_local std::array<char, LOGGER_CHUNKS_SIZE> SimpleLogger::mBuffer;
#elif WIN32
//thread_local std::array<char, LOGGER_CHUNKS_SIZE> SimpleLogger::mBuffer;
#else
__thread std::array<char, LOGGER_CHUNKS_SIZE> SimpleLogger::mBuffer;
#endif
Expand Down

0 comments on commit 610f41b

Please sign in to comment.