Skip to content

Commit

Permalink
Add enum value from newest Windows SDK
Browse files Browse the repository at this point in the history
Windows SDK version 10.0.26100.0 adds a cache type value, `CacheUnknown`. This adds a case for that type to `sysinfo.cc`, which will otherwise complain about the switch statement being non-exhaustive when building with the new SDK.

Since the value doesn't exist in prior SDK versions, we only add the case conditionally. The condition can be removed if we ever decide to bump up the required SDK version.
  • Loading branch information
DKLoehr committed Sep 27, 2024
1 parent 23d8c1e commit 941ec69
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/sysinfo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,10 @@ std::vector<CPUInfo::CacheInfo> GetCacheSizesWindows() {
C.size = static_cast<int>(cache.Size);
C.type = "Unknown";
switch (cache.Type) {
#ifdef NTDDI_WIN10_NI // Windows SDK version >= 10.0.26100.0
case CacheUnknown:
break;
#endif
case CacheUnified:
C.type = "Unified";
break;
Expand Down

0 comments on commit 941ec69

Please sign in to comment.