winegcc: Default to ucrtbase.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2020-05-18 16:58:53 +02:00 committed by Alexandre Julliard
parent 058f86958c
commit 14d97456a9
3 changed files with 12 additions and 1 deletions

View File

@ -33,6 +33,14 @@
#define _WIN64
#endif
#ifndef _MSVCR_VER
# define _MSVCR_VER 140
#endif
#if !defined(_UCRT) && _MSVCR_VER >= 140
# define _UCRT
#endif
#if !defined(_MSC_VER) && !defined(__int64)
# if defined(_WIN64) && !defined(__MINGW64__)
# define __int64 long

View File

@ -4337,11 +4337,13 @@ static void load_sources( struct makefile *make )
if (make->use_msvcrt)
{
unsigned int msvcrt_version = 0;
for (i = 0; i < make->imports.count; i++)
{
if (strncmp( make->imports.str[i], "msvcr", 5 ) && strncmp( make->imports.str[i], "ucrt", 4 )) continue;
if (crt_dll) fatal_error( "More than one crt DLL imported: %s %s\n", crt_dll, make->imports.str[i] );
crt_dll = make->imports.str[i];
sscanf( crt_dll, "msvcr%u", &msvcrt_version );
}
if (!crt_dll && !strarray_exists( &make->extradllflags, "-nodefaultlibs" ))
{
@ -4349,6 +4351,7 @@ static void load_sources( struct makefile *make )
strarray_add( &make->imports, crt_dll );
}
if (crt_dll && !strncmp( crt_dll, "ucrt", 4 )) strarray_add( &make->define_args, "-D_UCRT" );
else strarray_add( &make->define_args, strmake( "-D_MSVCR_VER=%u", msvcrt_version ));
}
LIST_FOR_EACH_ENTRY( file, &make->includes, struct incl_file, entry ) parse_file( make, file, 0 );

View File

@ -1208,7 +1208,7 @@ static void build(struct options* opts)
add_library(opts, lib_dirs, files, "winecrt0");
if (opts->use_msvcrt)
{
if (!crt_lib) add_library(opts, lib_dirs, files, "msvcrt");
if (!crt_lib) add_library(opts, lib_dirs, files, "ucrtbase");
else strarray_add(files, strmake("-a%s", crt_lib));
}
if (opts->win16_app) add_library(opts, lib_dirs, files, "kernel");