Skip to content

Commit ed9fff6

Browse files
committed
Win32: Accept a symbolic name for --with-ntver option
1 parent 4745338 commit ed9fff6

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

win32/configure.bat

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,16 @@ goto :loop ;
178178
shift
179179
goto :loop ;
180180
:ntver
181-
echo>> %config_make% NTVER = %~2
181+
::- For version constants, see
182+
::- https://learn.microsoft.com/en-us/cpp/porting/modifying-winver-and-win32-winnt#remarks
183+
set NTVER=%~2
184+
if /i not "%NTVER:~0,2%" == "0x" if /i not "%NTVER:~0,13%" == "_WIN32_WINNT_" (
185+
for %%i in (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z) do (
186+
call set NTVER=%%NTVER:%%i=%%i%%
187+
)
188+
call set NTVER=_WIN32_WINNT_%%NTVER%%
189+
)
190+
echo>> %config_make% NTVER = %NTVER%
182191
echo>>%confargs% %1=%2 \
183192
shift
184193
shift
@@ -266,6 +275,8 @@ goto :loop ;
266275
echo --with-opt-dir="DIR-LIST" add optional headers and libraries directories separated by `;'
267276
echo --disable-install-doc do not install rdoc indexes during install
268277
echo --with-ntver=0xXXXX target NT version (shouldn't use with old SDK)
278+
echo --with-ntver=_WIN32_WINNT_XXXX
279+
echo --with-ntver=XXXX same as --with-ntver=_WIN32_WINNT_XXXX
269280
echo Note that `,' and `;' need to be enclosed within double quotes in batch file command line.
270281
del %confargs% %config_make%
271282
goto :exit

0 commit comments

Comments
 (0)