headers: Unified declaration of __argc, __argv, __wargv, _environ, _wenviron, _pgmptr, _wpgmptr, _osplatform, _osver, _winver, _winmajor, _winminor
Declare __argc, __argv, __wargv, _pgmptr, _wpgmptr via corresponding
__p_func() function as now it is provided by every CRT import library
(either directly or manually by mingw-w64 code) which also provides that
symbol.
Declare _environ and _wenviron based on architecture. On i386 and x64 in
msvcr*, and in UCRT on all architectures, it is always defined via
__p__environ() and __p__wenviron() functions which are provided by every
CRT import library (wide variant since VC20+). On arm32 and arm64 in
msvcrt, they are via _get_environ() and _get_wenviron() functions.
_osplatform, _osver, _winver, _winmajor, _winminor are declared as global
variables directly. They are available since the first crtdll.dll library
up to the msvcr80.dll (both i386 and x64). All these variables were removed
in Visual Studio 2008, together with corresponding __p_func fuctions. So
there is no reason to define them via functions.
Signed-off-by: Martin Storsjö <martin@martin.st>
1 file changed