msvcp140: Add MSVC 2015 C++ support DLL.

Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Daniel Lehman <dlehman@esri.com>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Martin Storsjo 2015-11-03 23:54:34 +02:00 committed by Alexandre Julliard
parent ff49f86fa1
commit 1135db7095
9 changed files with 3876 additions and 2 deletions

4
configure vendored
View File

@ -1221,6 +1221,7 @@ enable_msvcp100
enable_msvcp110
enable_msvcp120
enable_msvcp120_app
enable_msvcp140
enable_msvcp60
enable_msvcp70
enable_msvcp71
@ -17865,6 +17866,7 @@ wine_fn_config_test dlls/msvcp110/tests msvcp110_test
wine_fn_config_dll msvcp120 enable_msvcp120
wine_fn_config_test dlls/msvcp120/tests msvcp120_test
wine_fn_config_dll msvcp120_app enable_msvcp120_app
wine_fn_config_dll msvcp140 enable_msvcp140
wine_fn_config_dll msvcp60 enable_msvcp60
wine_fn_config_test dlls/msvcp60/tests msvcp60_test
wine_fn_config_dll msvcp70 enable_msvcp70
@ -18057,7 +18059,7 @@ wine_fn_config_dll twain.dll16 enable_win16
wine_fn_config_dll twain_32 enable_twain_32
wine_fn_config_test dlls/twain_32/tests twain_32_test
wine_fn_config_dll typelib.dll16 enable_win16
wine_fn_config_dll ucrtbase enable_ucrtbase
wine_fn_config_dll ucrtbase enable_ucrtbase implib
wine_fn_config_test dlls/ucrtbase/tests ucrtbase_test
wine_fn_config_dll unicows enable_unicows implib
wine_fn_config_dll updspapi enable_updspapi

View File

@ -3099,6 +3099,7 @@ WINE_CONFIG_TEST(dlls/msvcp110/tests)
WINE_CONFIG_DLL(msvcp120)
WINE_CONFIG_TEST(dlls/msvcp120/tests)
WINE_CONFIG_DLL(msvcp120_app)
WINE_CONFIG_DLL(msvcp140)
WINE_CONFIG_DLL(msvcp60)
WINE_CONFIG_TEST(dlls/msvcp60/tests)
WINE_CONFIG_DLL(msvcp70)
@ -3291,7 +3292,7 @@ WINE_CONFIG_DLL(twain.dll16,enable_win16)
WINE_CONFIG_DLL(twain_32)
WINE_CONFIG_TEST(dlls/twain_32/tests)
WINE_CONFIG_DLL(typelib.dll16,enable_win16)
WINE_CONFIG_DLL(ucrtbase)
WINE_CONFIG_DLL(ucrtbase,,[implib])
WINE_CONFIG_TEST(dlls/ucrtbase/tests)
WINE_CONFIG_DLL(unicows,,[implib])
WINE_CONFIG_DLL(updspapi)

14
dlls/msvcp140/Makefile.in Normal file
View File

@ -0,0 +1,14 @@
MODULE = msvcp140.dll
IMPORTS = ucrtbase
EXTRADEFS = -D_MSVCP_VER=140
PARENTSRC = ../msvcp90
C_SRCS = \
exception.c \
ios.c \
locale.c \
math.c \
memory.c \
misc.c \
msvcp_main.c \
string.c

3783
dlls/msvcp140/msvcp140.spec Normal file

File diff suppressed because it is too large Load Diff

View File

@ -35,6 +35,16 @@ WINE_DEFAULT_DEBUG_CHANNEL(msvcp);
#define TICKSPERSEC 10000000
#define TICKS_1601_TO_1970 (SECS_1601_TO_1970 * TICKSPERSEC)
#if _MSVCP_VER >= 140
FILE* __cdecl __acrt_iob_func(unsigned);
#undef stdin
#undef stdout
#undef stderr
#define stdin __acrt_iob_func(STDIN_FILENO)
#define stdout __acrt_iob_func(STDOUT_FILENO)
#define stderr __acrt_iob_func(STDERR_FILENO)
#endif
/* ?_Index@ios_base@std@@0HA */
int ios_base_Index = 0;
/* ?_Sync@ios_base@std@@0_NA */

View File

@ -37,9 +37,11 @@ typedef SSIZE_T streamsize;
#define STREAMSIZE_BITS 32
#endif
void __cdecl _invalid_parameter_noinfo(void);
void __cdecl _invalid_parameter(const wchar_t*, const wchar_t*,
const wchar_t*, unsigned int, uintptr_t);
BOOL __cdecl __uncaught_exception(void);
int __cdecl _callnewh(size_t);
extern void* (__cdecl *MSVCRT_operator_new)(MSVCP_size_t);
extern void (__cdecl *MSVCRT_operator_delete)(void*);
@ -634,3 +636,9 @@ static inline int mbstowcs_wrapper( size_t *ret, wchar_t *wcs, size_t size, cons
#endif
void free_misc(void);
#if _MSVCP_VER >= 140
#define UCRTBASE_PRINTF_STANDARD_SNPRINTF_BEHAVIOUR (0x0002)
int __cdecl __stdio_common_vsprintf(unsigned __int64 options, char *str, size_t len, const char *format,
_locale_t locale, __ms_va_list valist);
#endif

View File

@ -69,7 +69,55 @@ MSVCP_bool (__thiscall *critical_section_trylock)(critical_section*);
#endif
#define VERSION_STRING(ver) #ver
#if _MSVCP_VER >= 140
#define MSVCRT_NAME(ver) "ucrtbase.dll"
#else
#define MSVCRT_NAME(ver) "msvcr" VERSION_STRING(ver) ".dll"
#endif
#if _MSVCP_VER >= 140
static void* __cdecl operator_new(MSVCP_size_t size)
{
void *retval;
int freed;
do
{
retval = malloc(size);
if (retval)
{
TRACE("(%ld) returning %p\n", size, retval);
return retval;
}
freed = _callnewh(size);
} while (freed);
TRACE("(%ld) out of memory\n", size);
throw_exception(EXCEPTION_BAD_ALLOC, "bad allocation");
return NULL;
}
static void __cdecl operator_delete(void *mem)
{
TRACE("(%p)\n", mem);
free(mem);
}
void __cdecl _invalid_parameter(const wchar_t *expr, const wchar_t *func, const wchar_t *file, unsigned int line, uintptr_t arg)
{
_invalid_parameter_noinfo();
}
int __cdecl _scprintf(const char* fmt, ...)
{
int ret;
__ms_va_list valist;
__ms_va_start(valist, fmt);
ret = __stdio_common_vsprintf(UCRTBASE_PRINTF_STANDARD_SNPRINTF_BEHAVIOUR, NULL, 0, fmt, NULL, valist);
__ms_va_end(valist);
return ret;
}
#endif
static void init_cxx_funcs(void)
{
@ -77,6 +125,11 @@ static void init_cxx_funcs(void)
if (!hmod) FIXME( "%s not loaded\n", MSVCRT_NAME(_MSVCP_VER) );
#if _MSVCP_VER >= 140
MSVCRT_operator_new = operator_new;
MSVCRT_operator_delete = operator_delete;
MSVCRT_set_new_handler = (void*)GetProcAddress(hmod, "_set_new_handler");
#else
if (sizeof(void *) > sizeof(int)) /* 64-bit has different names */
{
MSVCRT_operator_new = (void*)GetProcAddress(hmod, "??2@YAPEAX_K@Z");
@ -113,6 +166,7 @@ static void init_cxx_funcs(void)
#endif
#endif /* _MSVCP_VER >= 110 */
}
#endif
}
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)

View File

@ -1,5 +1,6 @@
EXTRADEFS = -D_MT -D_MSVCR_VER=140
MODULE = ucrtbase.dll
IMPORTLIB = ucrtbase
DELAYIMPORTS = advapi32 user32
PARENTSRC = ../msvcrt

View File

@ -40,6 +40,7 @@ my @dll_groups =
"msvcp100",
"msvcp110",
"msvcp120",
"msvcp140",
"msvcp71",
"msvcp80",
"msvcp70",