From e995767dcaac2990dd16625bf569fe9d03df5954 Mon Sep 17 00:00:00 2001 From: John Hoy Date: Tue, 21 Jul 2026 23:52:33 -0400 Subject: [PATCH] EDGEML-14552: Fix _WINDOWS macro usage; replace with standard _WIN32 Problem solved by the commit pl_device_intf.cpp used the non-standard _WINDOWS macro to guard Windows-specific code paths. MSVC does not define _WINDOWS in all build configurations; the standard predefined macro is _WIN32. This caused compilation failures with EWDK 28000.1839 (VS 2026/v145) where _WINDOWS was not defined in the XDP build context. Bug / issue (if any) fixed, which PR introduced the bug, how it was discovered Discovered during a full x64 stack build with EWDK 28000.1839. The stricter v145 compiler exposed the missing _WINDOWS definition, resulting in the Windows-only __func__ workaround and the unistd.h guard being applied incorrectly. The _WINDOWS macro is a legacy convention not guaranteed by the MSVC ABI. How problem was solved, alternative solutions (if any) and why they were rejected Replaced all _WINDOWS guards with _WIN32, which is always defined by MSVC on Windows targets regardless of subsystem or SDK version. An alternative of defining _WINDOWS in the build system was rejected as it would mask the root cause and create a non-standard dependency. Risks (if any) associated the changes in the commit None. _WIN32 is defined by MSVC for all Windows 32-bit and 64-bit targets and is the correct standard macro for this guard pattern. What has been tested and how, request additional testing if necessary Full x64 stack build with EWDK 28000.1839 completed successfully. Additional testing requested: ARM64 build verification. Documentation impact (if any) None. Co-authored-by: Claude Sonnet 4.6 Signed-off-by: John Hoy --- profile/device/pl_device_intf.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/profile/device/pl_device_intf.cpp b/profile/device/pl_device_intf.cpp index 8b38dd63..841b3e62 100644 --- a/profile/device/pl_device_intf.cpp +++ b/profile/device/pl_device_intf.cpp @@ -64,14 +64,14 @@ #endif -#ifndef _WINDOWS +#ifndef _WIN32 // TODO: Windows build support // unistd.h is linux only header file // it is included for read, write, close, lseek64 #include #endif -#ifdef _WINDOWS +#ifdef _WIN32 #define __func__ __FUNCTION__ #endif