Skip to content

Conversation

@BillyONeal
Copy link
Contributor

Removes SORTPP_PASS which appears to be an internal Windows SDK macro they use when they aren't expecting to be input to a normal C++ compiler. This results in errors like:

C:\Program Files (x86)\Windows Kits\10\include\10.0.26100.0\um\winuser.h(15585): error C2208: 'TOUCHPAD_PARAMETERS_V1': no members defined using this type
[18/35] "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.44.35207/bin/Hostx64/arm64/cl.exe" "-DWIN32" "-D_WINDOWS" "-utf-8" "-GR" "-EHsc" "-MP" "-MDd" "-Z7" "-Ob0" "-Od" "-RTC1" "-Isrc\zim-9.dll.p" "-Isrc" "-I..\src\9.4.0-27eaac216a.clean\src" "-Iinclude" "-I..\src\9.4.0-27eaac216a.clean\include" "-ID:/installed/arm64-windows/debug/../include" "-ID:/installed/arm64-windows/include" "/MDd" "/nologo" "/showIncludes" "/utf-8" "/Zc:__cplusplus" "/W2" "/EHsc" "/std:c++17" "/permissive-" "/Zi" "-DNOMINMAX" "-DLIBZIM_EXPORT_PRIVATE_DLL" "-nologo" "-DWIN32" "-D_WINDOWS" "-utf-8" "-GR" "-EHsc" "-MP" "-MDd" "-Z7" "-Ob0" "-Od" "-RTC1" "-DSORTPP_PASS" "/Fdsrc\zim-9.dll.p\uuid.cpp.pdb" /Fosrc/zim-9.dll.p/uuid.cpp.obj "/c" ../src/9.4.0-27eaac216a.clean/src/uuid.cpp
FAILED: [code=2] src/zim-9.dll.p/uuid.cpp.obj 
"C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.44.35207/bin/Hostx64/arm64/cl.exe" "-DWIN32" "-D_WINDOWS" "-utf-8" "-GR" "-EHsc" "-MP" "-MDd" "-Z7" "-Ob0" "-Od" "-RTC1" "-Isrc\zim-9.dll.p" "-Isrc" "-I..\src\9.4.0-27eaac216a.clean\src" "-Iinclude" "-I..\src\9.4.0-27eaac216a.clean\include" "-ID:/installed/arm64-windows/debug/../include" "-ID:/installed/arm64-windows/include" "/MDd" "/nologo" "/showIncludes" "/utf-8" "/Zc:__cplusplus" "/W2" "/EHsc" "/std:c++17" "/permissive-" "/Zi" "-DNOMINMAX" "-DLIBZIM_EXPORT_PRIVATE_DLL" "-nologo" "-DWIN32" "-D_WINDOWS" "-utf-8" "-GR" "-EHsc" "-MP" "-MDd" "-Z7" "-Ob0" "-Od" "-RTC1" "-DSORTPP_PASS" "/Fdsrc\zim-9.dll.p\uuid.cpp.pdb" /Fosrc/zim-9.dll.p/uuid.cpp.obj "/c" ../src/9.4.0-27eaac216a.clean/src/uuid.cpp
cl : Command line warning D9025 : overriding '/Z7' with '/Zi'
cl : Command line warning D9025 : overriding '/Zi' with '/Z7'
C:\Program Files (x86)\Windows Kits\10\include\10.0.26100.0\um\winuser.h(15585): error C2208: 'TOUCHPAD_PARAMETERS_V1': no members defined using this type
[19/35] "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.44.35207/bin/Hostx64/arm64/cl.exe" "-DWIN32" "-D_WINDOWS" "-utf-8" "-GR" "-EHsc" "-MP" "-MDd" "-Z7" "-Ob0" "-Od" "-RTC1" "-Isrc\zim-9.dll.p" "-Isrc" "-I..\src\9.4.0-27eaac216a.clean\src" "-Iinclude" "-I..\src\9.4.0-27eaac216a.clean\include" "-ID:/installed/arm64-windows/debug/../include" "-ID:/installed/arm64-windows/include" "/MDd" "/nologo" "/showIncludes" "/utf-8" "/Zc:__cplusplus" "/W2" "/EHsc" "/std:c++17" "/permissive-" "/Zi" "-DNOMINMAX" "-DLIBZIM_EXPORT_PRIVATE_DLL" "-nologo" "-DWIN32" "-D_WINDOWS" "-utf-8" "-GR" "-EHsc" "-MP" "-MDd" "-Z7" "-Ob0" "-Od" "-RTC1" "-DSORTPP_PASS" "/Fdsrc\zim-9.dll.p\suggestion_iterator.cpp.pdb" /Fosrc/zim-9.dll.p/suggestion_iterator.cpp.obj "/c" ../src/9.4.0-27eaac216a.clean/src/suggestion_iterator.cpp
cl : Command line warning D9025 : overriding '/Z7' with '/Zi'
cl : Command line warning D9025 : overriding '/Zi' with '/Z7'

due to this block in WinUser.h:

#if defined(__cplusplus) && !defined(SORTPP_PASS)
typedef struct tagTOUCHPAD_PARAMETERS_V2 : public TOUCHPAD_PARAMETERS_V1 {
#else
typedef struct tagTOUCHPAD_PARAMETERS_V2 {
    TOUCHPAD_PARAMETERS_V1;
#endif
    BOOL button1Supported            : 1;
    BOOL button2Supported            : 1;
    BOOL button3Supported            : 1;
    BOOL Reserved3                   : 29;
} TOUCHPAD_PARAMETERS_V2, *PTOUCHPAD_PARAMETERS_V2;

which becomes malformed C++ with that macro.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes compilation errors on Windows by removing the SORTPP_PASS macro which is an internal Windows SDK preprocessor flag that causes malformed C++ syntax when used with modern Windows SDKs (10.0.26100.0).

  • Removes the -DSORTPP_PASS compile argument from the Windows build configuration
  • Retains necessary Windows-specific linker flags (-lRpcrt4, -lWs2_32, -lwinmm, -lshlwapi)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

if build_machine.system() == 'windows'
win_deps = declare_dependency(
compile_args: ['-DSORTPP_PASS'],
link_args: ['-lRpcrt4', '-lWs2_32', '-lwinmm', '-lshlwapi']
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
link_args: ['-lRpcrt4', '-lWs2_32', '-lwinmm', '-lshlwapi']
link_args: ['-lrpcrt4', '-lws2_32', '-lwinmm', '-lshlwapi']

for mingw on case-sensitive non-windows systems.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dg0yt Let the PR serve the purpose formulated in its title/description. But feel free to submit a different PR with this change.

@veloman-yunkan
Copy link
Collaborator

Let's see if our CI is compatible with that change.

@codecov
Copy link

codecov bot commented Nov 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.18%. Comparing base (8ef511b) to head (ab5db7e).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1017      +/-   ##
==========================================
- Coverage   58.13%   56.18%   -1.96%     
==========================================
  Files         101      101              
  Lines        5384     4989     -395     
  Branches     2197     2170      -27     
==========================================
- Hits         3130     2803     -327     
+ Misses        795      739      -56     
+ Partials     1459     1447      -12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Collaborator

@veloman-yunkan veloman-yunkan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CI works with the proposed change. I don't see any reasons to reject it.

@kelson42 kelson42 merged commit 514d446 into openzim:main Nov 25, 2025
50 of 53 checks passed
@BillyONeal BillyONeal deleted the remove-sortpp-pass branch November 25, 2025 22:50
@BillyONeal
Copy link
Contributor Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants