mirror of
https://github.com/reactos/reactos.git
synced 2025-01-03 21:09:19 +00:00
This commit brings support for compiling ReactOS with Visual Studio 2015 RC (and possibly the final release).
[BUILD] msvc.cmake: Disable thread-local static initialization. CMakeLists.txt: Disable PCH for VS2015. configure.cmd: Make it aware of cl.exe version 19.x [CPPRT] Add alias for the new variants of the delete operators. [BROWSEUI] [MFIFS] [FRAMEDYN] [NDIS] [DDK] [PSDK] [STLPORT] Add explicit declarations of the new delete operators for those modules that don't use the WITH_RUNTIME option. [WIDL] [WPP] Do not alias the snprintf family of functions to the _snprintf variants, since VS14 already declares them internally. svn path=/trunk/; revision=67483
This commit is contained in:
parent
a4df06a55c
commit
3933ca6bce
13 changed files with 80 additions and 20 deletions
|
@ -137,7 +137,7 @@ else()
|
||||||
add_definitions(-D_WINKD_=1)
|
add_definitions(-D_WINKD_=1)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CMAKE_VERSION MATCHES "ReactOS")
|
if(CMAKE_VERSION MATCHES "ReactOS" AND MSVC_VERSION LESS 1900)
|
||||||
set(PCH 1 CACHE BOOL "Whether to use precompiled headers")
|
set(PCH 1 CACHE BOOL "Whether to use precompiled headers")
|
||||||
else()
|
else()
|
||||||
set(PCH 0 CACHE BOOL "Whether to use precompiled headers")
|
set(PCH 0 CACHE BOOL "Whether to use precompiled headers")
|
||||||
|
|
|
@ -33,6 +33,11 @@ if(MSVC_VERSION GREATER 1799 AND NOT MSVC_IDE)
|
||||||
add_compile_flags("/FS")
|
add_compile_flags("/FS")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
# VS14+ tries to use thread-safe initialization
|
||||||
|
if(MSVC_VERSION GREATER 1899)
|
||||||
|
add_compile_flags("/Zc:threadSafeInit-")
|
||||||
|
endif ()
|
||||||
|
|
||||||
# Disable overly sensitive warnings as well as those that generally aren't
|
# Disable overly sensitive warnings as well as those that generally aren't
|
||||||
# useful to us.
|
# useful to us.
|
||||||
# - C4244: implicit integer truncation
|
# - C4244: implicit integer truncation
|
||||||
|
|
|
@ -56,6 +56,7 @@ if defined ROS_ARCH (
|
||||||
cl 2>&1 | find "16.00." > NUL && set VS_VERSION=10
|
cl 2>&1 | find "16.00." > NUL && set VS_VERSION=10
|
||||||
cl 2>&1 | find "17.00." > NUL && set VS_VERSION=11
|
cl 2>&1 | find "17.00." > NUL && set VS_VERSION=11
|
||||||
cl 2>&1 | find "18.00." > NUL && set VS_VERSION=12
|
cl 2>&1 | find "18.00." > NUL && set VS_VERSION=12
|
||||||
|
cl 2>&1 | find "19.00." > NUL && set VS_VERSION=14
|
||||||
if not defined VS_VERSION (
|
if not defined VS_VERSION (
|
||||||
echo Error: Visual Studio version too old or version detection failed.
|
echo Error: Visual Studio version too old or version detection failed.
|
||||||
exit /b
|
exit /b
|
||||||
|
|
|
@ -9,3 +9,8 @@ void operator delete(void *p)
|
||||||
{
|
{
|
||||||
LocalFree(p);
|
LocalFree(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void operator delete(void *p, unsigned int)
|
||||||
|
{
|
||||||
|
LocalFree(p);
|
||||||
|
}
|
||||||
|
|
|
@ -13,9 +13,10 @@
|
||||||
|
|
||||||
/* INCLUDES ******************************************************************/
|
/* INCLUDES ******************************************************************/
|
||||||
|
|
||||||
|
#define WIN32_NO_STATUS
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#define WIN32_NO_STATUS
|
|
||||||
|
|
||||||
/* PSDK/NDK Headers */
|
/* PSDK/NDK Headers */
|
||||||
#include <windef.h>
|
#include <windef.h>
|
||||||
|
|
|
@ -54,6 +54,19 @@ void operator delete(void* ptr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if _MSC_VER >= 51900
|
||||||
|
void __cdecl operator delete(void* ptr, unsigned int)
|
||||||
|
{
|
||||||
|
// In Windows 2k3, they check for ptr being null.
|
||||||
|
// ISO, POSIX and even MSDN explains that it is allowed
|
||||||
|
// to call free with NULL pointer...
|
||||||
|
if (ptr)
|
||||||
|
{
|
||||||
|
free(ptr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// Implement our own new operator so that we can throw our own exception in case
|
// Implement our own new operator so that we can throw our own exception in case
|
||||||
// of allocation failure.
|
// of allocation failure.
|
||||||
// It could have been done using set_new_handler(), but well. MS guys didn't do it
|
// It could have been done using set_new_handler(), but well. MS guys didn't do it
|
||||||
|
|
|
@ -10,6 +10,13 @@
|
||||||
#ifndef __NDISSYS_H
|
#ifndef __NDISSYS_H
|
||||||
#define __NDISSYS_H
|
#define __NDISSYS_H
|
||||||
|
|
||||||
|
/* portability fixes */
|
||||||
|
#ifdef _M_AMD64
|
||||||
|
#define KfReleaseSpinLock KeReleaseSpinLock
|
||||||
|
#define KefAcquireSpinLockAtDpcLevel KeAcquireSpinLockAtDpcLevel
|
||||||
|
#define KefReleaseSpinLockFromDpcLevel KeReleaseSpinLockFromDpcLevel
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <ndis.h>
|
#include <ndis.h>
|
||||||
|
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
@ -54,11 +61,4 @@ NTAPI
|
||||||
ExGetCurrentProcessorCpuUsage(
|
ExGetCurrentProcessorCpuUsage(
|
||||||
PULONG CpuUsage);
|
PULONG CpuUsage);
|
||||||
|
|
||||||
/* portability fixes */
|
|
||||||
#ifdef _M_AMD64
|
|
||||||
#define KfReleaseSpinLock KeReleaseSpinLock
|
|
||||||
#define KefAcquireSpinLockAtDpcLevel KeAcquireSpinLockAtDpcLevel
|
|
||||||
#define KefReleaseSpinLockFromDpcLevel KeReleaseSpinLockFromDpcLevel
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* __NDISSYS_H */
|
#endif /* __NDISSYS_H */
|
||||||
|
|
|
@ -204,6 +204,13 @@ operator delete(
|
||||||
ExFreePool(ptr);
|
ExFreePool(ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline void __cdecl
|
||||||
|
operator delete(
|
||||||
|
PVOID ptr, UINT unk)
|
||||||
|
{
|
||||||
|
ExFreePool(ptr);
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* ALLOCATION_OPERATORS_DEFINED */
|
#endif /* ALLOCATION_OPERATORS_DEFINED */
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -234,6 +234,12 @@ inline void __cdecl operator delete(
|
||||||
if (pVoid) ExFreePool(pVoid);
|
if (pVoid) ExFreePool(pVoid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline void __cdecl operator delete(
|
||||||
|
PVOID pVoid, UINT unk)
|
||||||
|
{
|
||||||
|
if (pVoid) ExFreePool(pVoid);
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* _NEW_DELETE_OPERATORS_ */
|
#endif /* _NEW_DELETE_OPERATORS_ */
|
||||||
|
|
||||||
#if defined(_SYS_GUID_OPERATOR_EQ_)
|
#if defined(_SYS_GUID_OPERATOR_EQ_)
|
||||||
|
|
|
@ -264,6 +264,14 @@ void _STLP_CALL operator delete(void* s)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined (EH_DELETE_HAS_THROW_SPEC)
|
||||||
|
void _STLP_CALL operator delete(void* s, unsigned int) throw()
|
||||||
|
#else
|
||||||
|
void _STLP_CALL operator delete(void* s, unsigned int)
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
::operator delete(s);
|
||||||
|
}
|
||||||
|
|
||||||
/*===================================================================================
|
/*===================================================================================
|
||||||
ClearAllocationSet (private helper)
|
ClearAllocationSet (private helper)
|
||||||
|
|
|
@ -27,7 +27,17 @@ _CallCxxFrameHandler:
|
||||||
; void __stdcall `eh vector constructor iterator'(void *,unsigned int,int,void (__thiscall*)(void *),void (__thiscall*)(void *))
|
; void __stdcall `eh vector constructor iterator'(void *,unsigned int,int,void (__thiscall*)(void *),void (__thiscall*)(void *))
|
||||||
DEFINE_ALIAS ??_L@YGXPAXIHP6EX0@Z1@Z, ?MSVCRTEX_eh_vector_constructor_iterator@@YGXPAXIHP6EX0@Z1@Z
|
DEFINE_ALIAS ??_L@YGXPAXIHP6EX0@Z1@Z, ?MSVCRTEX_eh_vector_constructor_iterator@@YGXPAXIHP6EX0@Z1@Z
|
||||||
|
|
||||||
|
; void __stdcall `eh vector constructor iterator'(void *,unsigned int,int,void (__thiscall*)(void *),void (__thiscall*)(void *))
|
||||||
|
DEFINE_ALIAS ??_L@YGXPAXIIP6EX0@Z1@Z, ?MSVCRTEX_eh_vector_constructor_iterator@@YGXPAXIHP6EX0@Z1@Z
|
||||||
|
|
||||||
; void __stdcall `eh vector destructor iterator'(void *,unsigned int,int,void (__thiscall*)(void *))
|
; void __stdcall `eh vector destructor iterator'(void *,unsigned int,int,void (__thiscall*)(void *))
|
||||||
DEFINE_ALIAS ??_M@YGXPAXIHP6EX0@Z@Z, ?MSVCRTEX_eh_vector_destructor_iterator@@YGXPAXIHP6EX0@Z@Z
|
DEFINE_ALIAS ??_M@YGXPAXIHP6EX0@Z@Z, ?MSVCRTEX_eh_vector_destructor_iterator@@YGXPAXIHP6EX0@Z@Z
|
||||||
|
|
||||||
|
; void __stdcall `eh vector destructor iterator'(void *,unsigned int,unsigned int,void (__thiscall*)(void *))
|
||||||
|
DEFINE_ALIAS ??_M@YGXPAXIIP6EX0@Z@Z, ?MSVCRTEX_eh_vector_destructor_iterator@@YGXPAXIHP6EX0@Z@Z
|
||||||
|
|
||||||
|
; void __cdecl operator delete(void *,unsigned int)
|
||||||
|
DEFINE_ALIAS ??3@YAXPAXI@Z, ??3@YAXPAX@Z
|
||||||
|
DEFINE_ALIAS ??3@YAXPAXII@Z, ??3@YAXPAX@Z
|
||||||
|
|
||||||
END
|
END
|
||||||
|
|
|
@ -1,11 +1,13 @@
|
||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
|
if(MSVC_VERSION LESS 1900)
|
||||||
add_definitions(-Dsnprintf=_snprintf)
|
add_definitions(-Dsnprintf=_snprintf)
|
||||||
|
|
||||||
# Add this definition for WDK only, VS 9 doesn't like that
|
# Add this definition for WDK only, VS 9 doesn't like that
|
||||||
if(DEFINED ENV{DDKBUILDENV})
|
if(DEFINED ENV{DDKBUILDENV})
|
||||||
add_definitions(-Dvsnprintf=_vsnprintf)
|
add_definitions(-Dvsnprintf=_vsnprintf)
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
list(APPEND SOURCE getopt.c)
|
list(APPEND SOURCE getopt.c)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
|
if(MSVC_VERSION LESS 1900)
|
||||||
add_definitions(
|
add_definitions(
|
||||||
-Dsnprintf=_snprintf
|
-Dsnprintf=_snprintf
|
||||||
-Dstrtoull=_strtoui64
|
-Dstrtoull=_strtoui64
|
||||||
|
@ -10,6 +11,7 @@ if(MSVC)
|
||||||
add_definitions(-Dvsnprintf=_vsnprintf)
|
add_definitions(-Dvsnprintf=_vsnprintf)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
if(CMAKE_CROSSCOMPILING)
|
if(CMAKE_CROSSCOMPILING)
|
||||||
add_definitions(
|
add_definitions(
|
||||||
|
|
Loading…
Reference in a new issue