2 ms·
To close this loose end in the HN thread: The above guess turns out to be false. You can link a program in Cygwin that has WinMain. If you don't include <wind
by kazinator 2y ago
To close this loose end in the HN thread:
The above guess turns out to be false. You can link a program in Cygwin that has WinMain.
If you don't include <windows.h>, you can give it whatever argument list you like, such as (void), and it will work. But in 32 bit Cygwin (which I still support), it will complain about _WinMain@16 missing (as a warning only).
If you give it the correct signature declared in <winbase.h> then it links on 32 or 64 bit Cygwin just fine. without warnings.
In this WinMain, you can use the wide-string functions for obtaining the command line and parsing to arguments.
I am going with this fix for TXR.
- kazinator 2y agoLooks like this is unnecessary. Cygwin in fact uses GetCommandLineW and does its own parsing. See reply by Corinna Vinschen: https://cygwin.com/pipermail/cygwin/2025-January/257074.html https://cygwin.com/pipermail/cygwin/2025-January/257074.html