use an obnoxious name for the file handle variable used in the PRINT_DEBUG macro to avoid collisions, in the caller has a variable with same name

This commit is contained in:
otavepto 2023-12-21 05:33:12 +02:00 committed by otavepto
parent 6374c9e7f3
commit c9e653fee7

View File

@ -177,9 +177,9 @@ static inline void reset_LastError()
auto __prnt_dbg_duration = __prnt_dbg_ctr - startup_counter; \ auto __prnt_dbg_duration = __prnt_dbg_ctr - startup_counter; \
auto __prnt_dbg_micro = std::chrono::duration_cast<std::chrono::duration<unsigned long long, std::micro>>(__prnt_dbg_duration); \ auto __prnt_dbg_micro = std::chrono::duration_cast<std::chrono::duration<unsigned long long, std::micro>>(__prnt_dbg_duration); \
auto __prnt_dbg_ms = std::chrono::duration_cast<std::chrono::duration<unsigned long long, std::milli>>(__prnt_dbg_duration); \ auto __prnt_dbg_ms = std::chrono::duration_cast<std::chrono::duration<unsigned long long, std::milli>>(__prnt_dbg_duration); \
FILE *t = fopen(dbg_log_file.c_str(), "a"); \ auto __prnt_dbg_f = fopen(dbg_log_file.c_str(), "a"); \
fprintf(t, "[%llu ms, %llu us] [tid %lu] " a, __prnt_dbg_ms.count(), __prnt_dbg_micro.count(), GetCurrentThreadId(), __VA_ARGS__); \ fprintf(__prnt_dbg_f, "[%llu ms, %llu us] [tid %lu] " a, __prnt_dbg_ms.count(), __prnt_dbg_micro.count(), GetCurrentThreadId(), __VA_ARGS__); \
fclose(t); \ fclose(__prnt_dbg_f); \
WSASetLastError(0); \ WSASetLastError(0); \
} while (0) } while (0)
#elif defined(__LINUX__) #elif defined(__LINUX__)
@ -189,9 +189,9 @@ static inline void reset_LastError()
auto __prnt_dbg_duration = __prnt_dbg_ctr - startup_counter; \ auto __prnt_dbg_duration = __prnt_dbg_ctr - startup_counter; \
auto __prnt_dbg_micro = std::chrono::duration_cast<std::chrono::duration<unsigned long long, std::micro>>(__prnt_dbg_duration); \ auto __prnt_dbg_micro = std::chrono::duration_cast<std::chrono::duration<unsigned long long, std::micro>>(__prnt_dbg_duration); \
auto __prnt_dbg_ms = std::chrono::duration_cast<std::chrono::duration<unsigned long long, std::milli>>(__prnt_dbg_duration); \ auto __prnt_dbg_ms = std::chrono::duration_cast<std::chrono::duration<unsigned long long, std::milli>>(__prnt_dbg_duration); \
FILE *t = fopen(dbg_log_file.c_str(), "a"); \ auto __prnt_dbg_f = fopen(dbg_log_file.c_str(), "a"); \
fprintf(t, "[%llu ms, %llu us] [tid %ld] " a, __prnt_dbg_ms.count(), __prnt_dbg_micro.count(), syscall(SYS_gettid), ##__VA_ARGS__); \ fprintf(__prnt_dbg_f, "[%llu ms, %llu us] [tid %ld] " a, __prnt_dbg_ms.count(), __prnt_dbg_micro.count(), syscall(SYS_gettid), ##__VA_ARGS__); \
fclose(t); \ fclose(__prnt_dbg_f); \
} while (0) } while (0)
#endif #endif
#else // EMU_RELEASE_BUILD #else // EMU_RELEASE_BUILD