Commit 14d97456 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

winegcc: Default to ucrtbase.

parent 058f8695
...@@ -33,6 +33,14 @@ ...@@ -33,6 +33,14 @@
#define _WIN64 #define _WIN64
#endif #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(_MSC_VER) && !defined(__int64)
# if defined(_WIN64) && !defined(__MINGW64__) # if defined(_WIN64) && !defined(__MINGW64__)
# define __int64 long # define __int64 long
......
...@@ -4337,11 +4337,13 @@ static void load_sources( struct makefile *make ) ...@@ -4337,11 +4337,13 @@ static void load_sources( struct makefile *make )
if (make->use_msvcrt) if (make->use_msvcrt)
{ {
unsigned int msvcrt_version = 0;
for (i = 0; i < make->imports.count; i++) 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 (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] ); 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]; crt_dll = make->imports.str[i];
sscanf( crt_dll, "msvcr%u", &msvcrt_version );
} }
if (!crt_dll && !strarray_exists( &make->extradllflags, "-nodefaultlibs" )) if (!crt_dll && !strarray_exists( &make->extradllflags, "-nodefaultlibs" ))
{ {
...@@ -4349,6 +4351,7 @@ static void load_sources( struct makefile *make ) ...@@ -4349,6 +4351,7 @@ static void load_sources( struct makefile *make )
strarray_add( &make->imports, crt_dll ); strarray_add( &make->imports, crt_dll );
} }
if (crt_dll && !strncmp( crt_dll, "ucrt", 4 )) strarray_add( &make->define_args, "-D_UCRT" ); 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 ); LIST_FOR_EACH_ENTRY( file, &make->includes, struct incl_file, entry ) parse_file( make, file, 0 );
......
...@@ -1208,7 +1208,7 @@ static void build(struct options* opts) ...@@ -1208,7 +1208,7 @@ static void build(struct options* opts)
add_library(opts, lib_dirs, files, "winecrt0"); add_library(opts, lib_dirs, files, "winecrt0");
if (opts->use_msvcrt) 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)); else strarray_add(files, strmake("-a%s", crt_lib));
} }
if (opts->win16_app) add_library(opts, lib_dirs, files, "kernel"); if (opts->win16_app) add_library(opts, lib_dirs, files, "kernel");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment