mirror of
https://github.com/wolfpld/tracy.git
synced 2026-09-18 16:24:23 +00:00
Merge pull request #1353 from siliceum/fix/winsdk-compat
Fix #1243 compatibility with WinSDK < 10.0.26100
This commit is contained in:
@@ -59,9 +59,7 @@ static int SamplingFrequencyToPeriodNs( int samplingHz )
|
||||
# include "../common/TracySystem.hpp"
|
||||
# include "TracyProfiler.hpp"
|
||||
# include "TracyThread.hpp"
|
||||
# ifdef __MINGW32__
|
||||
# include "windows/TracyETW_compat.h"
|
||||
# endif
|
||||
# include "windows/TracyETW_compat.h"
|
||||
# include "windows/TracyETW.cpp"
|
||||
|
||||
namespace tracy
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
#ifndef __TRACY_ETW_COMPAT_H__
|
||||
#define __TRACY_ETW_COMPAT_H__
|
||||
|
||||
// Compatibility definitions for MinGW-w64 which lacks some ETW types
|
||||
// Compatibility definitions for older Windows SDKs and MinGW-w64 which lacks some ETW types
|
||||
// present in Microsoft's Windows SDK
|
||||
|
||||
#ifdef __MINGW32__
|
||||
|
||||
// CONTROLTRACE_ID - ETW trace session handle type
|
||||
typedef ULONGLONG CONTROLTRACE_ID;
|
||||
typedef ULONG64 CONTROLTRACE_ID;
|
||||
|
||||
// PROCESSTRACE_HANDLE - ETW process trace handle type
|
||||
// MinGW defines INVALID_PROCESSTRACE_HANDLE but not the type itself
|
||||
@@ -41,6 +41,17 @@ static const GUID SystemSchedulerProviderGuid = { 0x599a2a76, 0x4d91, 0x4910, {
|
||||
#define SYSTEM_SCHEDULER_KW_DISPATCHER (0x0000000000000002)
|
||||
#define SYSTEM_SCHEDULER_KW_CONTEXT_SWITCH (0x0000000000000200)
|
||||
|
||||
#else // __MINGW32__
|
||||
|
||||
// Backcompat with older sdk versions
|
||||
// SDK 10.0.26100 introduced those two and marked TRACEHANDLE obsolete
|
||||
// SDK 10.0.26100 is the first one to define NTDDI_VERSION and WDK_NTDDI_VERSION to NTDDI_WIN11_GE, while older ones will have lower versions and NTDDI_WIN11_GE undefined.
|
||||
// Just in case we check both definition and value.
|
||||
#if !(defined NTDDI_WIN11_GE && WDK_NTDDI_VERSION >= NTDDI_WIN11_GE)
|
||||
typedef ULONG64 PROCESSTRACE_HANDLE;
|
||||
typedef ULONG64 CONTROLTRACE_ID;
|
||||
#endif
|
||||
|
||||
#endif // __MINGW32__
|
||||
|
||||
#endif // __TRACY_ETW_COMPAT_H__
|
||||
|
||||
Reference in New Issue
Block a user