-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Import of non-Windows XP API functions #72
Comments
Please install YY-Thunks, or install VC-LTL by nuget. |
YY-thunks seems like a product of reverse engineering. I'm not complaining, but anti-viruses aren't happy with compiled binaries. Maybe it's possible to fork MSVC STL and remove NT6+ dependencies? |
@void2012 Hi, you can directly delete all the
VC-LTL 3.0 is the implementation of stl, but with the passage of time, the STL version has become more and more with VS iterations. As a result, we need to maintain many versions, which is difficult to maintain continuously. At the same time, the VC-LTL is getting bigger and bigger... |
No, the issue is not those executables. Rather, binaries compiled with VC-LTL and YY-thunks. I think there is a better approach than to reimplement NT calls with a questionable third-party reverse engineered thunk implementation. MSVC STL was made open source in 2019 with the Apache license which allowed to use some code from llvm. Notably, from libc++. libc++ uses three different flavors of threading system: pthreads, c11 threads and win32 threads. The latter two use NT6 WinAPI calls, while pthreads are implemented via winpthreads which has has support down to NT4. I guess at this point we don't really care about the possible ABI change, I think one can simply reimplement MSVC STL threads with winpthreads implementation from libc++, as the license allows to do it. An another point of interest is std::filesystem and parallel algorithms. https://github.com/gulrak/filesystem/tree/master/ implementation is fine, however symlink function is not supported prior to Windows Vista(I guess it's enough to have std::filesystem as whole but just without symlinks) Parallel algorithms on MSVC STL work via Win32 threadpool functions, available since Windows 7. As of now, neither libc++ nor libstdc++ fully implement them but existing implementation work well with tbb library. |
Actually, using Windows API shim instead of forking MSVC STL, will improve the source code maintenance experience and reduce the NuGet package size massively. Kenji Mouri |
In the light of the foregoing, this proposal is not considered. |
I am considering doing my own fork of MSVC STL at this point. Can you add my fork as an optional dependency if I actually manage to implement it? |
@void2012 |
Hi! A simple Hello World program using
<iostream>
imports WinAPI calls which aren't present on Windows XP, such as:LCMapStringEx
,LCIDToLocaleName
,InitializeSListHead
,InitializeCriticalSectionEx
,GetLocaleInfoEx
VC-LTL version:
msvcrt 5.1.2600.0 (support Windows XP/2003 or leater)
Visual Studio 2022
version: 17.12.3
Build tools:
LLVM (clang-cl)
Linker minimum required option:
5.01
C++ standard:
/std:c++latest
Runtime library:
/MT
Code:
#include <iostream> int main() { std::cout << "Hello, World!\n"; }
The text was updated successfully, but these errors were encountered: