Skip to content

EDGEML-14552: Fix _WINDOWS macro usage; replace with standard _WIN32 - #96

Merged
jvillarre merged 1 commit into
Xilinx:masterfrom
jhoyamd:jhoy-pr-ewdk28000.1839
Jul 22, 2026
Merged

EDGEML-14552: Fix _WINDOWS macro usage; replace with standard _WIN32#96
jvillarre merged 1 commit into
Xilinx:masterfrom
jhoyamd:jhoy-pr-ewdk28000.1839

Conversation

@jhoyamd

@jhoyamd jhoyamd commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

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.

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 <noreply@anthropic.com>
Signed-off-by: John Hoy <john.hoy@amd.com>
@jhoyamd

jhoyamd commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

@jvillarre, after this PR is merged please help update xdp submodule in xrt. These changes are required to support VS 2026 with SDK/WDK 28000.1839

@jvillarre
jvillarre self-requested a review July 22, 2026 14:55
@jvillarre
jvillarre merged commit 0da0510 into Xilinx:master Jul 22, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants