Merge with develop

--HG--
branch : compatibility-develop
hg/compatibility-develop
kervala 7 years ago
commit ac7474c7ba

@ -28,10 +28,6 @@ IF(COMMAND cmake_policy)
# have absolute paths (e.g. -lpthread) # have absolute paths (e.g. -lpthread)
cmake_policy(SET CMP0003 NEW) cmake_policy(SET CMP0003 NEW)
# Works around warnings about escaped quotes in ADD_DEFINITIONS
# statements
cmake_policy(SET CMP0005 OLD)
# allow to link to qtmain automatically under Windows # allow to link to qtmain automatically under Windows
IF(POLICY CMP0020) IF(POLICY CMP0020)
CMAKE_POLICY(SET CMP0020 NEW) CMAKE_POLICY(SET CMP0020 NEW)
@ -451,6 +447,8 @@ IF(WITH_NEL)
SET(CURL_LIBRARIES ${CURL_LIBRARIES} ${INTL_LIBRARY}) SET(CURL_LIBRARIES ${CURL_LIBRARIES} ${INTL_LIBRARY})
ENDIF() ENDIF()
ENDIF() ENDIF()
ELSEIF(WIN32)
SET(CURL_LIBRARIES ${CURL_LIBRARIES} Crypt32.lib)
ENDIF() ENDIF()
ENDIF() ENDIF()
ENDIF() ENDIF()

@ -28,14 +28,14 @@ IF(TARGET_CPU STREQUAL "armv7")
SET(TOOLCHAIN_ARCH "arm") SET(TOOLCHAIN_ARCH "arm")
SET(GCC_TOOLCHAIN_PREFIX "arm-linux-androideabi") SET(GCC_TOOLCHAIN_PREFIX "arm-linux-androideabi")
SET(TOOLCHAIN_BIN_PREFIX "arm-linux-androideabi") SET(TOOLCHAIN_BIN_PREFIX "arm-linux-androideabi")
SET(MINIMUM_NDK_TARGET 4) SET(MINIMUM_NDK_TARGET 9)
ELSEIF(TARGET_CPU STREQUAL "armv5") ELSEIF(TARGET_CPU STREQUAL "armv5")
SET(LIBRARY_ARCHITECTURE "armeabi") SET(LIBRARY_ARCHITECTURE "armeabi")
SET(CMAKE_SYSTEM_PROCESSOR "armv5") SET(CMAKE_SYSTEM_PROCESSOR "armv5")
SET(TOOLCHAIN_ARCH "arm") SET(TOOLCHAIN_ARCH "arm")
SET(GCC_TOOLCHAIN_PREFIX "arm-linux-androideabi") SET(GCC_TOOLCHAIN_PREFIX "arm-linux-androideabi")
SET(TOOLCHAIN_BIN_PREFIX "arm-linux-androideabi") SET(TOOLCHAIN_BIN_PREFIX "arm-linux-androideabi")
SET(MINIMUM_NDK_TARGET 4) SET(MINIMUM_NDK_TARGET 9)
ELSEIF(TARGET_CPU STREQUAL "arm64") ELSEIF(TARGET_CPU STREQUAL "arm64")
SET(LIBRARY_ARCHITECTURE "arm64-v8a") SET(LIBRARY_ARCHITECTURE "arm64-v8a")
SET(CMAKE_SYSTEM_PROCESSOR "arm64") SET(CMAKE_SYSTEM_PROCESSOR "arm64")
@ -76,14 +76,9 @@ ELSE()
ENDIF() ENDIF()
SET(CLANG_TOOLCHAIN_PREFIX "llvm") SET(CLANG_TOOLCHAIN_PREFIX "llvm")
SET(ANDROID_COMPILER "GCC") SET(ANDROID_COMPILER "clang")
SET(ANDROID_COMPILER "clang")
IF(NDK_TOOLCHAIN_VERSION STREQUAL "clang") SET(CLANG ON)
SET(ANDROID_COMPILER "clang")
SET(CLANG ON)
ELSE()
SET(GCC_TOOLCHAIN_VERSION ${NDK_TOOLCHAIN_VERSION})
ENDIF()
IF(NOT NDK_TARGET) IF(NOT NDK_TARGET)
SET(NDK_TARGET ${MINIMUM_NDK_TARGET}) SET(NDK_TARGET ${MINIMUM_NDK_TARGET})
@ -94,88 +89,71 @@ ELSE()
ENDIF() ENDIF()
IF(CMAKE_HOST_WIN32) IF(CMAKE_HOST_WIN32)
SET(TOOLCHAIN_HOST "windows") SET(TOOLCHAIN_HOST "windows-x86_64")
SET(TOOLCHAIN_BIN_SUFFIX ".exe") SET(TOOLCHAIN_BIN_SUFFIX ".exe")
ELSEIF(CMAKE_HOST_APPLE) ELSEIF(CMAKE_HOST_APPLE)
SET(TOOLCHAIN_HOST "apple") SET(TOOLCHAIN_HOST "apple")
SET(TOOLCHAIN_BIN_SUFFIX "") SET(TOOLCHAIN_BIN_SUFFIX "")
ELSEIF(CMAKE_HOST_UNIX) ELSEIF(CMAKE_HOST_UNIX)
SET(TOOLCHAIN_HOST "linux") SET(TOOLCHAIN_HOST "linux-x86_64")
SET(TOOLCHAIN_BIN_SUFFIX "") SET(TOOLCHAIN_BIN_SUFFIX "")
ENDIF() ENDIF()
MACRO(SEARCH_TOOLCHAIN _COMPILER) # clang
SET(${_COMPILER}_TOOLCHAIN_VERSIONS) SET(CLANG_TOOLCHAIN_ROOT "${NDK_ROOT}/toolchains/${CLANG_TOOLCHAIN_PREFIX}/prebuilt/${TOOLCHAIN_HOST}")
FILE(GLOB _TOOLCHAIN_VERSIONS "${NDK_ROOT}/toolchains/${${_COMPILER}_TOOLCHAIN_PREFIX}-*")
IF(_TOOLCHAIN_VERSIONS)
LIST(SORT _TOOLCHAIN_VERSIONS)
LIST(REVERSE _TOOLCHAIN_VERSIONS)
FOREACH(_TOOLCHAIN_VERSION ${_TOOLCHAIN_VERSIONS})
STRING(REGEX REPLACE ".+${_PREFIX}-([0-9.]+)" "\\1" _TOOLCHAIN_VERSION "${_TOOLCHAIN_VERSION}")
IF(_TOOLCHAIN_VERSION MATCHES "^([0-9.]+)$")
LIST(APPEND ${_COMPILER}_TOOLCHAIN_VERSIONS ${_TOOLCHAIN_VERSION})
ENDIF()
ENDFOREACH()
ENDIF()
# try prefixes without version
SET(_TOOLCHAIN_WITHOUT_VERSION "${NDK_ROOT}/toolchains/${${_COMPILER}_TOOLCHAIN_PREFIX}")
IF(EXISTS ${_TOOLCHAIN_WITHOUT_VERSION})
LIST(APPEND ${_COMPILER}_TOOLCHAIN_VERSIONS "default")
ENDIF()
IF(NOT ${_COMPILER}_TOOLCHAIN_VERSIONS) IF(EXISTS ${CLANG_TOOLCHAIN_ROOT})
MESSAGE(FATAL_ERROR "No Android ${_COMPILER} toolchain found in default search path ${NDK_ROOT}/toolchains") MESSAGE(STATUS "Found LLVM toolchain in ${CLANG_TOOLCHAIN_ROOT}")
ENDIF() ELSE()
MESSAGE(FATAL_ERROR "No LLVM toolchain found in default search path ${CLANG_TOOLCHAIN_ROOT}")
ENDIF()
IF(${_COMPILER}_TOOLCHAIN_VERSIONS) # gcc
LIST(FIND ${_COMPILER}_TOOLCHAIN_VERSIONS "${${_COMPILER}_TOOLCHAIN_VERSION}" _INDEX) SET(GCC_TOOLCHAIN_VERSIONS)
IF(_INDEX EQUAL -1) FILE(GLOB _TOOLCHAIN_VERSIONS "${NDK_ROOT}/toolchains/${GCC_TOOLCHAIN_PREFIX}-*")
LIST(GET ${_COMPILER}_TOOLCHAIN_VERSIONS 0 ${_COMPILER}_TOOLCHAIN_VERSION) IF(_TOOLCHAIN_VERSIONS)
LIST(SORT _TOOLCHAIN_VERSIONS)
LIST(REVERSE _TOOLCHAIN_VERSIONS)
FOREACH(_TOOLCHAIN_VERSION ${_TOOLCHAIN_VERSIONS})
STRING(REGEX REPLACE ".+${_PREFIX}-([0-9.]+)" "\\1" _TOOLCHAIN_VERSION "${_TOOLCHAIN_VERSION}")
IF(_TOOLCHAIN_VERSION MATCHES "^([0-9.]+)$")
LIST(APPEND GCC_TOOLCHAIN_VERSIONS ${_TOOLCHAIN_VERSION})
ENDIF() ENDIF()
ELSE() ENDFOREACH()
LIST(GET ${_COMPILER}_TOOLCHAIN_VERSIONS 0 ${_COMPILER}_TOOLCHAIN_VERSION) ENDIF()
ENDIF()
MESSAGE(STATUS "TOOLCHAIN_PREFIX = ${${_COMPILER}_TOOLCHAIN_VERSION}")
IF("${${_COMPILER}_TOOLCHAIN_VERSION}" STREQUAL "default") IF(NOT GCC_TOOLCHAIN_VERSIONS)
MESSAGE(STATUS "default") MESSAGE(FATAL_ERROR "No GCC version found in default search path ${NDK_ROOT}/toolchains")
SET(${_COMPILER}_TOOLCHAIN_ROOT "${NDK_ROOT}/toolchains/${${_COMPILER}_TOOLCHAIN_PREFIX}/prebuilt/${TOOLCHAIN_HOST}") ENDIF()
ELSE()
MESSAGE(STATUS "not default")
SET(${_COMPILER}_TOOLCHAIN_ROOT "${NDK_ROOT}/toolchains/${${_COMPILER}_TOOLCHAIN_PREFIX}-${${_COMPILER}_TOOLCHAIN_VERSION}/prebuilt/${TOOLCHAIN_HOST}")
ENDIF()
IF(NOT EXISTS "${${_COMPILER}_TOOLCHAIN_ROOT}") IF(GCC_TOOLCHAIN_VERSIONS)
FILE(GLOB _TOOLCHAIN_PREFIXES "${${_COMPILER}_TOOLCHAIN_ROOT}*") LIST(FIND GCC_TOOLCHAIN_VERSIONS "${GCC_TOOLCHAIN_VERSION}" _INDEX)
IF(_TOOLCHAIN_PREFIXES) IF(_INDEX EQUAL -1)
LIST(GET _TOOLCHAIN_PREFIXES 0 ${_COMPILER}_TOOLCHAIN_ROOT) LIST(GET GCC_TOOLCHAIN_VERSIONS 0 GCC_TOOLCHAIN_VERSION)
ENDIF()
ENDIF() ENDIF()
ENDMACRO() ELSE()
LIST(GET GCC_TOOLCHAIN_VERSIONS 0 GCC_TOOLCHAIN_VERSION)
IF(CLANG)
SEARCH_TOOLCHAIN(CLANG)
MESSAGE(STATUS "Target Android NDK ${NDK_TARGET} and use clang ${CLANG_TOOLCHAIN_VERSION}")
ENDIF() ENDIF()
SEARCH_TOOLCHAIN(GCC) SET(GCC_TOOLCHAIN_ROOT "${NDK_ROOT}/toolchains/${GCC_TOOLCHAIN_PREFIX}-${GCC_TOOLCHAIN_VERSION}/prebuilt/${TOOLCHAIN_HOST}")
MESSAGE(STATUS "Target Android NDK ${NDK_TARGET} and use GCC ${GCC_TOOLCHAIN_VERSION}") IF(NOT EXISTS "${GCC_TOOLCHAIN_ROOT}")
FILE(GLOB _TOOLCHAIN_PREFIXES "${GCC_TOOLCHAIN_ROOT}*")
IF(CLANG_TOOLCHAIN_ROOT) IF(_TOOLCHAIN_PREFIXES)
MESSAGE(STATUS "Found Android LLVM toolchain in ${CLANG_TOOLCHAIN_ROOT}") LIST(GET _TOOLCHAIN_PREFIXES 0 GCC_TOOLCHAIN_ROOT)
ENDIF()
ENDIF() ENDIF()
IF(GCC_TOOLCHAIN_ROOT) IF(EXISTS "${GCC_TOOLCHAIN_ROOT}")
MESSAGE(STATUS "Found Android GCC toolchain in ${GCC_TOOLCHAIN_ROOT}") MESSAGE(STATUS "Found GCC toolchain in ${GCC_TOOLCHAIN_ROOT}")
ELSE()
MESSAGE(FATAL_ERROR "No GCC toolchain found in default search path ${GCC_TOOLCHAIN_ROOT}")
ENDIF() ENDIF()
# NDK
SET(PLATFORM_ROOT "${NDK_ROOT}/platforms/android-${NDK_TARGET}/arch-${TOOLCHAIN_ARCH}") SET(PLATFORM_ROOT "${NDK_ROOT}/platforms/android-${NDK_TARGET}/arch-${TOOLCHAIN_ARCH}")
MESSAGE(STATUS "Found Android platform in ${PLATFORM_ROOT}") MESSAGE(STATUS "Target Android NDK ${NDK_TARGET} found in ${PLATFORM_ROOT}")
# include dirs # include dirs
SET(PLATFORM_INCLUDE_DIR "${PLATFORM_ROOT}/usr/include") SET(PLATFORM_INCLUDE_DIR "${PLATFORM_ROOT}/usr/include")
@ -208,41 +186,29 @@ MACRO(SET_TOOLCHAIN_BINARY_GCC _NAME _BINARY)
SET(${_NAME} ${GCC_TOOLCHAIN_ROOT}/bin/${TOOLCHAIN_BIN_PREFIX}-${_BINARY}${TOOLCHAIN_BIN_SUFFIX} CACHE PATH "" FORCE) SET(${_NAME} ${GCC_TOOLCHAIN_ROOT}/bin/${TOOLCHAIN_BIN_PREFIX}-${_BINARY}${TOOLCHAIN_BIN_SUFFIX} CACHE PATH "" FORCE)
ENDMACRO() ENDMACRO()
# Force the compilers to GCC for Android SET(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
include (CMakeForceCompiler)
IF(CLANG)
MESSAGE(STATUS "Using clang compiler")
SET_TOOLCHAIN_BINARY_LLVM(CMAKE_C_COMPILER clang) SET_TOOLCHAIN_BINARY_LLVM(CMAKE_C_COMPILER clang)
SET_TOOLCHAIN_BINARY_LLVM(CMAKE_CXX_COMPILER clang++) SET_TOOLCHAIN_BINARY_LLVM(CMAKE_CXX_COMPILER clang++)
CMAKE_FORCE_C_COMPILER(${CMAKE_C_COMPILER} clang) SET(CMAKE_C_COMPILER ${CMAKE_C_COMPILER})
CMAKE_FORCE_CXX_COMPILER(${CMAKE_CXX_COMPILER} clang) SET(CMAKE_C_COMPILER_TARGET ${TOOLCHAIN_BIN_PREFIX})
SET(CMAKE_C_COMPILER_FORCED TRUE)
SET_TOOLCHAIN_BINARY_LLVM(CMAKE_ASM_COMPILER llvm-as) SET(CMAKE_CXX_COMPILER ${CMAKE_CXX_COMPILER})
SET_TOOLCHAIN_BINARY_LLVM(CMAKE_AR llvm-ar) SET(CMAKE_CXX_COMPILER_TARGET ${TOOLCHAIN_BIN_PREFIX})
SET_TOOLCHAIN_BINARY_LLVM(CMAKE_LINKER clang++) SET(CMAKE_CXX_COMPILER_FORCED TRUE)
IF(NOT EXISTS "${CMAKE_ASM_COMPILER}") SET_TOOLCHAIN_BINARY_LLVM(CMAKE_ASM_COMPILER llvm-as)
SET_TOOLCHAIN_BINARY_GCC(CMAKE_ASM_COMPILER as) SET_TOOLCHAIN_BINARY_LLVM(CMAKE_AR llvm-ar)
ENDIF() SET_TOOLCHAIN_BINARY_LLVM(CMAKE_LINKER clang++)
IF(NOT EXISTS "${CMAKE_AR}")
SET_TOOLCHAIN_BINARY_GCC(CMAKE_AR ar)
ENDIF()
ELSE()
MESSAGE(STATUS "Using GCC compiler")
SET_TOOLCHAIN_BINARY_GCC(CMAKE_C_COMPILER gcc)
SET_TOOLCHAIN_BINARY_GCC(CMAKE_CXX_COMPILER g++)
CMAKE_FORCE_C_COMPILER(${CMAKE_C_COMPILER} GNU)
CMAKE_FORCE_CXX_COMPILER(${CMAKE_CXX_COMPILER} GNU)
IF(NOT EXISTS "${CMAKE_ASM_COMPILER}")
SET_TOOLCHAIN_BINARY_GCC(CMAKE_ASM_COMPILER as) SET_TOOLCHAIN_BINARY_GCC(CMAKE_ASM_COMPILER as)
ENDIF()
IF(NOT EXISTS "${CMAKE_AR}")
SET_TOOLCHAIN_BINARY_GCC(CMAKE_AR ar) SET_TOOLCHAIN_BINARY_GCC(CMAKE_AR ar)
SET_TOOLCHAIN_BINARY_GCC(CMAKE_LINKER ld)
ENDIF() ENDIF()
SET_TOOLCHAIN_BINARY_GCC(CMAKE_STRIP strip) SET_TOOLCHAIN_BINARY_GCC(CMAKE_STRIP strip)

@ -5,6 +5,24 @@
# VC_LIBRARY_DIR - where to find libraries # VC_LIBRARY_DIR - where to find libraries
# VC_FOUND - True if MSVC found. # VC_FOUND - True if MSVC found.
MACRO(ADD_TRAILING_SLASH _FILENAME_VAR)
# put content in a new variable
SET(_FILENAME ${${_FILENAME_VAR}})
# get length of the string
STRING(LENGTH ${_FILENAME} _LEN)
# convert length to last pos
MATH(EXPR _POS "${_LEN}-1")
# get last character of the string
STRING(SUBSTRING ${_FILENAME} ${_POS} 1 _FILENAME_END)
# compare it with a slash
IF(NOT _FILENAME_END STREQUAL "/")
# not a slash, append it
SET(${_FILENAME_VAR} "${_FILENAME}/")
ELSE()
# already a slash
ENDIF()
ENDMACRO()
MACRO(DETECT_VC_VERSION_HELPER _ROOT _VERSION) MACRO(DETECT_VC_VERSION_HELPER _ROOT _VERSION)
# Software/Wow6432Node/... # Software/Wow6432Node/...
GET_FILENAME_COMPONENT(VC${_VERSION}_DIR "[${_ROOT}\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VC7;${_VERSION}]" ABSOLUTE) GET_FILENAME_COMPONENT(VC${_VERSION}_DIR "[${_ROOT}\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VC7;${_VERSION}]" ABSOLUTE)
@ -12,7 +30,11 @@ MACRO(DETECT_VC_VERSION_HELPER _ROOT _VERSION)
IF(VC${_VERSION}_DIR AND VC${_VERSION}_DIR STREQUAL "/registry") IF(VC${_VERSION}_DIR AND VC${_VERSION}_DIR STREQUAL "/registry")
SET(VC${_VERSION}_DIR) SET(VC${_VERSION}_DIR)
GET_FILENAME_COMPONENT(VC${_VERSION}_DIR "[${_ROOT}\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VS7;${_VERSION}]" ABSOLUTE) GET_FILENAME_COMPONENT(VC${_VERSION}_DIR "[${_ROOT}\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VS7;${_VERSION}]" ABSOLUTE)
IF(VC${_VERSION}_DIR AND NOT VC${_VERSION}_DIR STREQUAL "/registry") IF(VC${_VERSION}_DIR AND NOT VC${_VERSION}_DIR STREQUAL "/registry")
# be sure it's finishing by a /
ADD_TRAILING_SLASH(VC${_VERSION}_DIR)
SET(VC${_VERSION}_DIR "${VC${_VERSION}_DIR}VC/") SET(VC${_VERSION}_DIR "${VC${_VERSION}_DIR}VC/")
ENDIF() ENDIF()
ENDIF() ENDIF()
@ -55,7 +77,34 @@ MACRO(DETECT_EXPRESS_VERSION _VERSION)
ENDIF() ENDIF()
ENDMACRO() ENDMACRO()
IF(MSVC14) IF(MSVC1411 OR MSVC1410)
DETECT_VC_VERSION("15.0")
SET(MSVC_TOOLSET "140")
SET(VC_DIR "${VC_DIR}Tools/MSVC")
FILE(GLOB MSVC_TOOLCHAIN_VERSIONS RELATIVE ${VC_DIR} "${VC_DIR}/*")
IF(MSVC_TOOLCHAIN_VERSIONS)
LIST(SORT MSVC_TOOLCHAIN_VERSIONS)
LIST(REVERSE MSVC_TOOLCHAIN_VERSIONS)
ENDIF()
IF(NOT MSVC_TOOLCHAIN_VERSIONS)
MESSAGE(FATAL_ERROR "No MSVC version found in default search path ${VC_DIR}")
ENDIF()
LIST(GET MSVC_TOOLCHAIN_VERSIONS 0 MSVC_TOOLCHAIN_VERSION)
SET(VC_DIR "${VC_DIR}/${MSVC_TOOLCHAIN_VERSION}")
SET(VC_INCLUDE_DIR "${VC_DIR}/include")
IF(NOT MSVC14_REDIST_DIR)
# If you have VC++ 2017 Express, put x64/Microsoft.VC141.CRT/*.dll in ${EXTERNAL_PATH}/redist
# original files whould be in ${VC_DIR}/Redist/MSVC/14.11.25325/x64/Microsoft.VC141.CRT
SET(MSVC14_REDIST_DIR "${EXTERNAL_PATH}/redist")
ENDIF()
ELSEIF(MSVC14)
DETECT_VC_VERSION("14.0") DETECT_VC_VERSION("14.0")
SET(MSVC_TOOLSET "140") SET(MSVC_TOOLSET "140")
@ -109,6 +158,11 @@ IF(NOT VC_DIR)
STRING(REGEX REPLACE "/(bin|BIN|Bin)/.+" "" VC_DIR ${_COMPILER}) STRING(REGEX REPLACE "/(bin|BIN|Bin)/.+" "" VC_DIR ${_COMPILER})
ENDIF() ENDIF()
SET(VC_INCLUDE_DIR "${VC_DIR}/include") IF(NOT VC_INCLUDE_DIR)
SET(VC_INCLUDE_DIR "${VC_DIR}/include")
ENDIF()
MESSAGE(STATUS "Using headers from ${VC_INCLUDE_DIR}")
SET(VC_INCLUDE_DIRS ${VC_INCLUDE_DIR}) SET(VC_INCLUDE_DIRS ${VC_INCLUDE_DIR})
INCLUDE_DIRECTORIES(${VC_INCLUDE_DIR}) INCLUDE_DIRECTORIES(${VC_INCLUDE_DIR})

@ -35,7 +35,7 @@ MACRO(DETECT_WINKIT_VERSION _VERSION _SUFFIX)
SET(WINSDK${_VERSION}_FOUND ON) SET(WINSDK${_VERSION}_FOUND ON)
SET(WINSDK${_VERSION}_VERSION_FULL "${_VERSION}") SET(WINSDK${_VERSION}_VERSION_FULL "${_VERSION}")
IF(NOT WindowsSDK_FIND_QUIETLY) IF(NOT WindowsSDK_FIND_QUIETLY)
MESSAGE(STATUS "Found Windows SDK ${_VERSION} in ${WINSDK${_VERSION}_DIR}") MESSAGE(STATUS "Found Windows Kit ${_VERSION} in ${WINSDK${_VERSION}_DIR}")
ENDIF() ENDIF()
LIST(APPEND WINSDK_DETECTED_VERSIONS ${_VERSION}) LIST(APPEND WINSDK_DETECTED_VERSIONS ${_VERSION})
ELSE() ELSE()
@ -240,7 +240,11 @@ MACRO(USE_CURRENT_WINSDK)
IF(NOT WINSDK_DIR) IF(NOT WINSDK_DIR)
# Use Windows SDK versions installed with VC++ when possible # Use Windows SDK versions installed with VC++ when possible
IF(MSVC14) IF(MSVC1411 OR MSVC1410)
# Special case, use Kits for SDK
SET(WINSDK_VERSION "10.0")
SET(WINSDK_DIR ${WINSDK_UCRT_DIR})
ELSEIF(MSVC14)
SET(WINSDK_VERSION "8.1") SET(WINSDK_VERSION "8.1")
ELSEIF(MSVC12) ELSEIF(MSVC12)
SET(WINSDK_VERSION "8.1") SET(WINSDK_VERSION "8.1")
@ -305,7 +309,7 @@ MACRO(USE_CURRENT_WINSDK)
ENDMACRO() ENDMACRO()
IF(MSVC14) IF(MSVC14)
# Under VC++ 2015, stdio.h, stdlib.h, etc... are part of UCRT # Under VC++ 2015 and 2017, stdio.h, stdlib.h, etc... are part of UCRT
SET(WINSDK_UCRT_VERSION "10.0") SET(WINSDK_UCRT_VERSION "10.0")
ENDIF() ENDIF()
@ -314,6 +318,40 @@ IF(WINSDK_UCRT_VERSION AND WINSDK${WINSDK_UCRT_VERSION}_FOUND)
SET(WINSDK_UCRT_DIR "${WINSDK${WINSDK_UCRT_VERSION}_DIR}") SET(WINSDK_UCRT_DIR "${WINSDK${WINSDK_UCRT_VERSION}_DIR}")
ENDIF() ENDIF()
IF(WINSDK_UCRT_DIR)
# determine exact UCRT version
SET(WINSDK_UCRT_INCLUDE_ROOT_DIR ${WINSDK_UCRT_DIR}/Include)
SET(WINSDK_UCRT_LIB_ROOT_DIR ${WINSDK_UCRT_DIR}/Lib)
FILE(GLOB UCRT_SUBDIRS RELATIVE ${WINSDK_UCRT_INCLUDE_ROOT_DIR} ${WINSDK_UCRT_INCLUDE_ROOT_DIR}/*)
SET(UCRT_VERSION)
FOREACH(UCRT_SUBDIR ${UCRT_SUBDIRS})
IF(NOT UCRT_VERSION OR UCRT_SUBDIR VERSION_GREATER UCRT_VERSION)
SET(UCRT_VERSION ${UCRT_SUBDIR})
ENDIF()
ENDFOREACH()
IF(UCRT_VERSION)
MESSAGE(STATUS "Using Windows UCRT ${UCRT_VERSION}")
SET(WINSDK10_INCLUDE_DIR ${WINSDK_UCRT_INCLUDE_ROOT_DIR}/${UCRT_VERSION})
SET(WINSDK10_LIBRARY_DIR ${WINSDK_UCRT_LIB_ROOT_DIR}/${UCRT_VERSION})
# directory where UCRT headers are found
FIND_PATH(WINSDK_UCRT_INCLUDE_DIR corecrt.h
HINTS
${WINSDK10_INCLUDE_DIR}/ucrt
)
# directory where UCRT libraries are found
FIND_PATH(WINSDK_UCRT_LIBRARY_DIR ucrt.lib
HINTS
${WINSDK10_LIBRARY_DIR}/ucrt/${WINSDK8_SUFFIX}
)
ENDIF()
ENDIF()
IF(WINSDK_VERSION STREQUAL "CURRENT") IF(WINSDK_VERSION STREQUAL "CURRENT")
USE_CURRENT_WINSDK() USE_CURRENT_WINSDK()
ELSE() ELSE()
@ -334,93 +372,87 @@ ENDIF()
# directory where Win32 headers are found # directory where Win32 headers are found
FIND_PATH(WINSDK_INCLUDE_DIR Windows.h FIND_PATH(WINSDK_INCLUDE_DIR Windows.h
HINTS HINTS
${WINSDK_DIR}/Include/${UCRT_VERSION}/um
${WINSDK_DIR}/Include/um ${WINSDK_DIR}/Include/um
${WINSDK_DIR}/Include ${WINSDK_DIR}/Include
NO_DEFAULT_PATH
) )
MESSAGE(STATUS "Found Windows.h in ${WINSDK_INCLUDE_DIR}")
# directory where WinRT headers are found # directory where WinRT headers are found
FIND_PATH(WINSDK_WINRT_INCLUDE_DIR winstring.h FIND_PATH(WINSDK_WINRT_INCLUDE_DIR winstring.h
HINTS HINTS
${WINSDK_DIR}/Include/${UCRT_VERSION}/winrt
${WINSDK_DIR}/Include/winrt ${WINSDK_DIR}/Include/winrt
NO_DEFAULT_PATH
) )
MESSAGE(STATUS "Found winstring.h in ${WINSDK_WINRT_INCLUDE_DIR}")
# directory where DirectX headers are found # directory where DirectX headers are found
FIND_PATH(WINSDK_SHARED_INCLUDE_DIR d3d9.h FIND_PATH(WINSDK_SHARED_INCLUDE_DIR d3d9.h
HINTS HINTS
${WINSDK_DIR}/Include/${UCRT_VERSION}/shared
${WINSDK_DIR}/Include/shared ${WINSDK_DIR}/Include/shared
NO_DEFAULT_PATH
) )
MESSAGE(STATUS "Found d3d9.h in ${WINSDK_SHARED_INCLUDE_DIR}")
# directory where OpenGL headers are found # directory where OpenGL headers are found
FIND_PATH(WINSDK_OPENGL_INCLUDE_DIR GL.h FIND_PATH(WINSDK_OPENGL_INCLUDE_DIR GL.h
HINTS HINTS
${WINSDK_INCLUDE_DIR}/gl
${WINSDK_DIR}/Include/um/gl ${WINSDK_DIR}/Include/um/gl
${WINSDK_DIR}/Include/gl ${WINSDK_DIR}/Include/gl
NO_DEFAULT_PATH
) )
MESSAGE(STATUS "Found GL.h in ${WINSDK_OPENGL_INCLUDE_DIR}")
SET(WINSDK_LIBRARY_DIRS SET(WINSDK_LIBRARY_DIRS
${WINSDK_DIR}/Lib/${UCRT_VERSION}/um/${WINSDK8_SUFFIX}
${WINSDK_DIR}/Lib/winv6.3/um/${WINSDK8_SUFFIX} ${WINSDK_DIR}/Lib/winv6.3/um/${WINSDK8_SUFFIX}
${WINSDK_DIR}/Lib/win8/um/${WINSDK8_SUFFIX} ${WINSDK_DIR}/Lib/win8/um/${WINSDK8_SUFFIX}
) )
IF(WINSDK_SUFFIXES) IF(WINSDK_SUFFIXES)
FOREACH(_SUFFIX ${WINSDK_SUFFIXES}) FOREACH(_SUFFIX ${WINSDK_SUFFIXES})
SET(WINSDK_LIBRARY_DIRS ${WINSDK_LIBRARY_DIRS} ${WINSDK_DIR}/Lib/${_SUFFIX}) LIST(APPEND WINSDK_LIBRARY_DIRS ${WINSDK_DIR}/Lib/${_SUFFIX})
ENDFOREACH() ENDFOREACH()
ELSE() ELSE()
SET(WINSDK_LIBRARY_DIRS ${WINSDK_LIBRARY_DIRS} ${WINSDK_DIR}/Lib) LIST(APPEND WINSDK_LIBRARY_DIRS ${WINSDK_DIR}/Lib)
ENDIF() ENDIF()
# directory where all libraries are found # directory where all libraries are found
FIND_PATH(WINSDK_LIBRARY_DIR ComCtl32.lib FIND_PATH(WINSDK_LIBRARY_DIR ComCtl32.lib
HINTS HINTS
${WINSDK_LIBRARY_DIRS} ${WINSDK_LIBRARY_DIRS}
NO_DEFAULT_PATH
) )
IF(WINSDK_UCRT_DIR) MESSAGE(STATUS "Found ComCtl32.lib in ${WINSDK_LIBRARY_DIR}")
# determine exact UCRT version
SET(WINSDK_UCRT_INCLUDE_ROOT_DIR ${WINSDK_UCRT_DIR}/Include)
SET(WINSDK_UCRT_LIB_ROOT_DIR ${WINSDK_UCRT_DIR}/Lib)
FILE(GLOB UCRT_SUBDIRS RELATIVE ${WINSDK_UCRT_INCLUDE_ROOT_DIR} ${WINSDK_UCRT_INCLUDE_ROOT_DIR}/*)
SET(UCRT_VERSION)
FOREACH(UCRT_SUBDIR ${UCRT_SUBDIRS})
IF(NOT UCRT_VERSION OR UCRT_SUBDIR VERSION_GREATER UCRT_VERSION)
SET(UCRT_VERSION ${UCRT_SUBDIR})
ENDIF()
ENDFOREACH()
IF(UCRT_VERSION)
MESSAGE(STATUS "Using Windows UCRT ${UCRT_VERSION}")
# directory where UCRT headers are found
FIND_PATH(WINSDK_UCRT_INCLUDE_DIR corecrt.h
HINTS
${WINSDK_UCRT_INCLUDE_ROOT_DIR}/${UCRT_VERSION}/ucrt
)
# directory where UCRT libraries are found SET(WINSDK_BINARY_DIRS
FIND_PATH(WINSDK_UCRT_LIBRARY_DIR ucrt.lib ${WINSDK_DIR}/Bin/${UCRT_VERSION}/${WINSDK8_SUFFIX}
HINTS ${WINSDK_DIR}/Bin/${WINSDK8_SUFFIX}
${WINSDK_UCRT_LIB_ROOT_DIR}/${UCRT_VERSION}/ucrt/${WINSDK8_SUFFIX} ${WINSDK_DIR}/Bin/x86
) ${WINSDK_DIR}/Bin
ENDIF() )
ENDIF()
# signtool is used to sign executables # signtool is used to sign executables
FIND_PROGRAM(WINSDK_SIGNTOOL signtool FIND_PROGRAM(WINSDK_SIGNTOOL signtool
HINTS HINTS
${WINSDK_DIR}/Bin/${WINSDK8_SUFFIX} ${WINSDK_BINARY_DIRS}
${WINSDK_DIR}/Bin/x86 NO_DEFAULT_PATH
${WINSDK_DIR}/Bin
) )
# midl is used to generate IDL interfaces # midl is used to generate IDL interfaces
FIND_PROGRAM(WINSDK_MIDL midl FIND_PROGRAM(WINSDK_MIDL midl
HINTS HINTS
${WINSDK_DIR}/Bin/${WINSDK8_SUFFIX} ${WINSDK_BINARY_DIRS}
${WINSDK_DIR}/Bin/x86 NO_DEFAULT_PATH
${WINSDK_DIR}/Bin
) )
IF(WINSDK_INCLUDE_DIR) IF(WINSDK_INCLUDE_DIR)
@ -444,7 +476,7 @@ IF(WINSDK_INCLUDE_DIR)
SET(WINSDK_INCLUDE_DIRS ${WINSDK_INCLUDE_DIRS} ${WINSDK_WINRT_INCLUDE_DIR}) SET(WINSDK_INCLUDE_DIRS ${WINSDK_INCLUDE_DIRS} ${WINSDK_WINRT_INCLUDE_DIR})
ENDIF() ENDIF()
INCLUDE_DIRECTORIES(${WINSDK_INCLUDE_DIRS}) # TODO: Move this after all other includes somehow... INCLUDE_DIRECTORIES(${WINSDK_INCLUDE_DIRS})
IF(WINSDK_UCRT_LIBRARY_DIR) IF(WINSDK_UCRT_LIBRARY_DIR)
SET(CMAKE_LIBRARY_PATH ${WINSDK_UCRT_LIBRARY_DIR} ${CMAKE_LIBRARY_PATH}) SET(CMAKE_LIBRARY_PATH ${WINSDK_UCRT_LIBRARY_DIR} ${CMAKE_LIBRARY_PATH})

@ -114,12 +114,16 @@ MACRO(PCH_SET_COMPILE_FLAGS _target)
GET_TARGET_PROPERTY(oldProps ${_target} COMPILE_FLAGS) GET_TARGET_PROPERTY(oldProps ${_target} COMPILE_FLAGS)
IF(oldProps) IF(oldProps)
LIST(APPEND _FLAGS ${oldProps}) SET(_FLAG ${oldProps})
SEPARATE_ARGUMENTS(_FLAG)
LIST(APPEND _FLAGS ${_FLAG})
ENDIF() ENDIF()
GET_TARGET_PROPERTY(oldPropsBuild ${_target} COMPILE_FLAGS_${_UPPER_BUILD}) GET_TARGET_PROPERTY(oldPropsBuild ${_target} COMPILE_FLAGS_${_UPPER_BUILD})
IF(oldPropsBuild) IF(oldPropsBuild)
LIST(APPEND _FLAGS ${oldPropsBuild}) SET(_FLAG ${oldPropsBuild})
SEPARATE_ARGUMENTS(_FLAG)
LIST(APPEND _FLAGS ${_FLAG})
ENDIF() ENDIF()
GET_TARGET_PROPERTY(DIRINC ${_target} INCLUDE_DIRECTORIES) GET_TARGET_PROPERTY(DIRINC ${_target} INCLUDE_DIRECTORIES)
@ -205,6 +209,10 @@ MACRO(PCH_SET_COMPILE_FLAGS _target)
ENDIF() ENDIF()
ENDIF() ENDIF()
IF(USE_CPP0X AND gcc_compiler_version GREATER "6.2.0")
LIST(APPEND _FLAGS "-std=gnu++11")
ENDIF()
# Format definitions # Format definitions
IF(MSVC) IF(MSVC)
# Fix path with space # Fix path with space
@ -316,7 +324,7 @@ MACRO(PCH_SET_COMPILE_COMMAND _inputcpp _compile_FLAGS)
SET(_FLAGS "") SET(_FLAGS "")
IF(APPLE) IF(APPLE)
SET(HEADER_FORMAT "objective-${HEADER_FORMAT}") SET(HEADER_FORMAT "objective-${HEADER_FORMAT}")
SET(_FLAGS -fobjc-abi-version=2 -fobjc-legacy-dispatch) SET(_FLAGS ${OBJC_FLAGS})
ENDIF() ENDIF()
SET(PCH_COMMAND ${CMAKE_CXX_COMPILER} ${pchsupport_compiler_cxx_arg1} ${_compile_FLAGS} ${_FLAGS} -x ${HEADER_FORMAT} -o ${PCH_OUTPUT} -c ${PCH_INPUT}) SET(PCH_COMMAND ${CMAKE_CXX_COMPILER} ${pchsupport_compiler_cxx_arg1} ${_compile_FLAGS} ${_FLAGS} -x ${HEADER_FORMAT} -o ${PCH_OUTPUT} -c ${PCH_INPUT})
ENDIF() ENDIF()
@ -402,7 +410,8 @@ MACRO(ADD_PRECOMPILED_HEADER_TO_TARGET _targetName)
ENDIF() ENDIF()
IF(APPLE) IF(APPLE)
SET(PCH_ADDITIONAL_COMPILER_FLAGS "-fobjc-abi-version=2 -fobjc-legacy-dispatch -x objective-c++ ${PCH_ADDITIONAL_COMPILER_FLAGS}") STRING(REPLACE ";" " " OBJC_FLAGS_STR "${OBJC_FLAGS}")
SET(PCH_ADDITIONAL_COMPILER_FLAGS "${OBJC_FLAGS_STR} -x objective-c++ ${PCH_ADDITIONAL_COMPILER_FLAGS}")
ENDIF() ENDIF()
IF(WITH_PCH_DEBUG) IF(WITH_PCH_DEBUG)

@ -35,23 +35,6 @@ SET(UNIX ON)
SET(APPLE ON) SET(APPLE ON)
SET(IOS ON) SET(IOS ON)
# Force the compilers to Clang for iOS
include (CMakeForceCompiler)
CMAKE_FORCE_C_COMPILER (clang Clang)
CMAKE_FORCE_CXX_COMPILER (clang++ Clang)
IF(CMAKE_CXX_COMPILER)
EXECUTE_PROCESS(COMMAND ${CMAKE_CXX_COMPILER} --version
OUTPUT_VARIABLE CLANG_VERSION_RAW
OUTPUT_STRIP_TRAILING_WHITESPACE)
STRING(REGEX REPLACE "Apple LLVM version ([\\.0-9]+).*"
"\\1" CMAKE_CXX_COMPILER_VERSION "${CLANG_VERSION_RAW}")
SET(CMAKE_C_COMPILER_VERSION ${CMAKE_CXX_COMPILER_VERSION})
SET(CMAKE_COMPILER_VERSION ${CMAKE_CXX_COMPILER_VERSION})
ENDIF()
# Setup iOS platform # Setup iOS platform
IF(NOT DEFINED IOS_PLATFORM) IF(NOT DEFINED IOS_PLATFORM)
SET(IOS_PLATFORM "OS") SET(IOS_PLATFORM "OS")
@ -162,14 +145,14 @@ IF(CMAKE_GENERATOR MATCHES Xcode)
ENDIF() ENDIF()
ELSE() ELSE()
IF(${IOS_PLATFORM} STREQUAL "OS") IF(${IOS_PLATFORM} STREQUAL "OS")
SET(ARCHS "armv7;arm64") SET(ARCHS armv7 arm64)
SET(CMAKE_SYSTEM_PROCESSOR "armv7") SET(CMAKE_SYSTEM_PROCESSOR "armv7")
ELSEIF(${IOS_PLATFORM} STREQUAL "SIMULATOR") ELSEIF(${IOS_PLATFORM} STREQUAL "SIMULATOR")
# iPhone simulator targets i386 # iPhone simulator targets i386
SET(ARCHS "i386") SET(ARCHS "i386")
SET(CMAKE_SYSTEM_PROCESSOR "x86") SET(CMAKE_SYSTEM_PROCESSOR "x86")
ELSEIF(${IOS_PLATFORM} STREQUAL "ALL") ELSEIF(${IOS_PLATFORM} STREQUAL "ALL")
SET(ARCHS "armv7;arm64;i386;x86_64") SET(ARCHS armv7 arm64 i386 x86_64)
SET(CMAKE_SYSTEM_PROCESSOR "armv7") SET(CMAKE_SYSTEM_PROCESSOR "armv7")
ENDIF() ENDIF()
ENDIF() ENDIF()
@ -198,5 +181,13 @@ SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
# Force the compilers to Clang for iOS
SET(CMAKE_C_COMPILER clang)
SET(CMAKE_CXX_COMPILER clang++)
# Skip the platform compiler checks for cross compiling.
SET(CMAKE_CXX_COMPILER_FORCED TRUE)
SET(CMAKE_C_COMPILER_FORCED TRUE)
# determinate location for bin utils based on CMAKE_FIND_ROOT_PATH # determinate location for bin utils based on CMAKE_FIND_ROOT_PATH
include(CMakeFindBinUtils) INCLUDE(CMakeFindBinUtils)

@ -565,11 +565,18 @@ MACRO(NL_SETUP_BUILD)
ADD_PLATFORM_FLAGS("/X") ADD_PLATFORM_FLAGS("/X")
IF(MSVC14) IF(MSVC14)
ADD_PLATFORM_FLAGS("/Gy- /MP") ADD_PLATFORM_FLAGS("/Gy-")
# /Ox is working with VC++ 2015, but custom optimizations don't exist # /Ox is working with VC++ 2015 and 2017, but custom optimizations don't exist
SET(RELEASE_CFLAGS "/Ox /GF /GS- ${RELEASE_CFLAGS}") SET(RELEASE_CFLAGS "/Ox /GF /GS- ${RELEASE_CFLAGS}")
# without inlining it's unusable, use custom optimizations again # without inlining it's unusable, use custom optimizations again
SET(DEBUG_CFLAGS "/Od /Ob1 /GF- ${DEBUG_CFLAGS}") SET(DEBUG_CFLAGS "/Od /Ob1 /GF- ${DEBUG_CFLAGS}")
# Special cases for VC++ 2017
IF(MSVC_VERSION EQUAL "1911")
SET(MSVC1411 ON)
ELSEIF(MSVC_VERSION EQUAL "1910")
SET(MSVC1410 ON)
ENDIF()
ELSEIF(MSVC12) ELSEIF(MSVC12)
ADD_PLATFORM_FLAGS("/Gy-") ADD_PLATFORM_FLAGS("/Gy-")
# /Ox is working with VC++ 2013, but custom optimizations don't exist # /Ox is working with VC++ 2013, but custom optimizations don't exist
@ -657,6 +664,8 @@ MACRO(NL_SETUP_BUILD)
ENDIF() ENDIF()
IF(APPLE) IF(APPLE)
SET(OBJC_FLAGS -fobjc-abi-version=2 -fobjc-legacy-dispatch -fobjc-weak)
IF(NOT XCODE) IF(NOT XCODE)
IF(CMAKE_OSX_ARCHITECTURES) IF(CMAKE_OSX_ARCHITECTURES)
SET(TARGETS_COUNT 0) SET(TARGETS_COUNT 0)
@ -1160,6 +1169,7 @@ MACRO(SETUP_EXTERNAL)
IF(APPLE) IF(APPLE)
IF(WITH_STATIC_EXTERNAL) IF(WITH_STATIC_EXTERNAL)
# Look only for static libraries because systems libraries are using Frameworks
SET(CMAKE_FIND_LIBRARY_SUFFIXES .a) SET(CMAKE_FIND_LIBRARY_SUFFIXES .a)
ELSE() ELSE()
SET(CMAKE_FIND_LIBRARY_SUFFIXES .dylib .so .a) SET(CMAKE_FIND_LIBRARY_SUFFIXES .dylib .so .a)
@ -1173,12 +1183,13 @@ MACRO(SETUP_EXTERNAL)
ENDIF() ENDIF()
ENDIF() ENDIF()
# Android and iOS have pthread # Android, iOS and Mac OS X have pthread, but no need to link to libpthread
IF(ANDROID OR IOS) IF(ANDROID OR APPLE)
SET(CMAKE_USE_PTHREADS_INIT 1) SET(CMAKE_USE_PTHREADS_INIT 1)
SET(Threads_FOUND TRUE) SET(Threads_FOUND TRUE)
ELSE() ELSE()
FIND_PACKAGE(Threads REQUIRED) SET(THREADS_HAVE_PTHREAD_ARG ON)
FIND_PACKAGE(Threads)
# TODO: replace all -l<lib> by absolute path to <lib> in CMAKE_THREAD_LIBS_INIT # TODO: replace all -l<lib> by absolute path to <lib> in CMAKE_THREAD_LIBS_INIT
ENDIF() ENDIF()

@ -32,6 +32,10 @@
#include "driver_direct3d.h" #include "driver_direct3d.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;

@ -480,12 +480,21 @@ public:
virtual ~CStateRecord() {} virtual ~CStateRecord() {}
// use STL allocator for fast alloc. this works because objects are small ( < 128 bytes) // use STL allocator for fast alloc. this works because objects are small ( < 128 bytes)
void *operator new(size_t size) { return CStateRecord::Allocator.allocate(size); } void *operator new(size_t size) { return CStateRecord::Allocator.allocate(size); }
void *operator new(size_t size, int /* blockUse */, char const * /* fileName */, int /* lineNumber */)
{
// TODO: add memory leaks detector
return CStateRecord::Allocator.allocate(size);
}
void operator delete(void *block) { CStateRecord::Allocator.deallocate((uint8 *) block, 1); } void operator delete(void *block) { CStateRecord::Allocator.deallocate((uint8 *) block, 1); }
void operator delete(void *block, int /* blockUse */, char const* /* fileName */, int /* lineNumber */)
{
// TODO: add memory leaks detector
CStateRecord::Allocator.deallocate((uint8 *)block, 1);
}
static std::allocator<uint8> Allocator; static std::allocator<uint8> Allocator;
}; };
// record of a single .fx pass // record of a single .fx pass
class CFXPassRecord class CFXPassRecord
{ {

@ -25,6 +25,10 @@
#include "driver_direct3d.h" #include "driver_direct3d.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;

@ -17,6 +17,10 @@
#include "stddirect3d.h" #include "stddirect3d.h"
#include "driver_direct3d.h" #include "driver_direct3d.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;

@ -26,6 +26,10 @@
#include "driver_direct3d.h" #include "driver_direct3d.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;

@ -27,6 +27,10 @@
#include "driver_direct3d.h" #include "driver_direct3d.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;

@ -26,6 +26,10 @@
#include "driver_direct3d.h" #include "driver_direct3d.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;

@ -29,6 +29,10 @@
#include "driver_direct3d.h" #include "driver_direct3d.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;

@ -19,6 +19,10 @@
#include "driver_direct3d.h" #include "driver_direct3d.h"
#include "nel/misc/hierarchical_timer.h" #include "nel/misc/hierarchical_timer.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;

@ -27,6 +27,10 @@
#include "driver_direct3d.h" #include "driver_direct3d.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;

@ -20,6 +20,10 @@
#include "nel/misc/path.h" #include "nel/misc/path.h"
#include "nel/misc/file.h" #include "nel/misc/file.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;

@ -26,6 +26,10 @@
#include "driver_direct3d.h" #include "driver_direct3d.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;

@ -18,6 +18,10 @@
#include "driver_direct3d.h" #include "driver_direct3d.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;

@ -26,6 +26,10 @@
#include "driver_direct3d.h" #include "driver_direct3d.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;

@ -18,6 +18,10 @@
#include "driver_direct3d.h" #include "driver_direct3d.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;

@ -24,6 +24,10 @@
#include "nel/georges/form.h" #include "nel/georges/form.h"
#include "nel/georges/form_loader.h" #include "nel/georges/form_loader.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC; using namespace NLMISC;
namespace NLGEORGES namespace NLGEORGES

@ -24,6 +24,10 @@
#include "nel/georges/form_loader.h" #include "nel/georges/form_loader.h"
#include "nel/georges/form_elm.h" #include "nel/georges/form_elm.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC; using namespace NLMISC;
using namespace std; using namespace std;

@ -25,6 +25,10 @@
#include "nel/georges/form_loader.h" #include "nel/georges/form_loader.h"
#include "nel/georges/type.h" #include "nel/georges/type.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC; using namespace NLMISC;
using namespace std; using namespace std;

@ -27,6 +27,10 @@
#include "nel/georges/form.h" #include "nel/georges/form.h"
#include "nel/georges/form_dfn.h" #include "nel/georges/form_dfn.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC; using namespace NLMISC;
using namespace std; using namespace std;

@ -22,6 +22,10 @@
#include "nel/georges/header.h" #include "nel/georges/header.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC; using namespace NLMISC;
namespace NLGEORGES namespace NLGEORGES

@ -14,6 +14,16 @@
// You should have received a copy of the GNU Affero General Public License // You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef STDGEORGES_H
#define STDGEORGES_H
#if defined(_MSC_VER) && defined(_DEBUG)
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
#define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__)
#endif
#include "nel/misc/types_nl.h" #include "nel/misc/types_nl.h"
#include <cmath> #include <cmath>
#include <list> #include <list>
@ -27,3 +37,5 @@
// Include from libxml2 // Include from libxml2
#include <libxml/parser.h> #include <libxml/parser.h>
#endif

@ -27,6 +27,10 @@
#include "nel/georges/form_loader.h" #include "nel/georges/form_loader.h"
#include "nel/georges/type.h" #include "nel/georges/type.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC; using namespace NLMISC;
using namespace std; using namespace std;

@ -23,6 +23,10 @@
#include <windows.h> #include <windows.h>
#include <mmsystem.h> #include <mmsystem.h>
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC; using namespace NLMISC;
using namespace std; using namespace std;

@ -18,6 +18,9 @@
#include "listener_dsound.h" #include "listener_dsound.h"
#include "sound_driver_dsound.h" #include "sound_driver_dsound.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC; using namespace NLMISC;

@ -31,6 +31,9 @@
#include "sound_driver_dsound.h" #include "sound_driver_dsound.h"
#include "listener_dsound.h" #include "listener_dsound.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;

@ -21,6 +21,9 @@
#include "buffer_dsound.h" #include "buffer_dsound.h"
#include "listener_dsound.h" #include "listener_dsound.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC; using namespace NLMISC;
using namespace std; using namespace std;

@ -14,6 +14,16 @@
// You should have received a copy of the GNU Affero General Public License // You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef STDDSOUND_H
#define STDDSOUND_H
#if defined(_MSC_VER) && defined(_DEBUG)
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
#define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__)
#endif
#include "nel/misc/types_nl.h" #include "nel/misc/types_nl.h"
#define EAX_AVAILABLE 0 #define EAX_AVAILABLE 0
@ -44,4 +54,5 @@
#include "nel/sound/driver/source.h" #include "nel/sound/driver/source.h"
#include "nel/sound/driver/listener.h" #include "nel/sound/driver/listener.h"
#endif
/* end of file */ /* end of file */

@ -25,6 +25,10 @@
# include <mmsystem.h> # include <mmsystem.h>
#endif #endif
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC; using namespace NLMISC;
using namespace std; using namespace std;

@ -18,6 +18,9 @@
#include "listener_fmod.h" #include "listener_fmod.h"
#include "sound_driver_fmod.h" #include "sound_driver_fmod.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC; using namespace NLMISC;

@ -18,6 +18,10 @@
#include "music_channel_fmod.h" #include "music_channel_fmod.h"
#include "sound_driver_fmod.h" #include "sound_driver_fmod.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;

@ -26,6 +26,10 @@
#include <Windows.h> #include <Windows.h>
#endif #endif
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;

@ -21,6 +21,9 @@
#include "buffer_fmod.h" #include "buffer_fmod.h"
#include "listener_fmod.h" #include "listener_fmod.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC; using namespace NLMISC;
using namespace std; using namespace std;

@ -14,6 +14,16 @@
// You should have received a copy of the GNU Affero General Public License // You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef STDFMOD_H
#define STDFMOD_H
#if defined(_MSC_VER) && defined(_DEBUG)
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
#define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__)
#endif
#include <nel/misc/types_nl.h> #include <nel/misc/types_nl.h>
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
@ -42,4 +52,6 @@
#include "nel/sound/driver/source.h" #include "nel/sound/driver/source.h"
#include "nel/sound/driver/listener.h" #include "nel/sound/driver/listener.h"
#endif
/* end of file */ /* end of file */

@ -18,6 +18,10 @@
#include "sound_driver_al.h" #include "sound_driver_al.h"
#include "buffer_al.h" #include "buffer_al.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC; using namespace NLMISC;
namespace NLSOUND namespace NLSOUND

@ -19,6 +19,10 @@
#include "effect_al.h" #include "effect_al.h"
#include "sound_driver_al.h" #include "sound_driver_al.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std; using namespace std;
// using namespace NLMISC; // using namespace NLMISC;

@ -18,6 +18,10 @@
#include "listener_al.h" #include "listener_al.h"
#include "sound_driver_al.h" #include "sound_driver_al.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC; using namespace NLMISC;
namespace NLSOUND { namespace NLSOUND {

@ -22,6 +22,10 @@
#include "ext_al.h" #include "ext_al.h"
#include "effect_al.h" #include "effect_al.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;

@ -22,6 +22,10 @@
#include "source_al.h" #include "source_al.h"
#include "ext_al.h" #include "ext_al.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
// #define NLSOUND_DEBUG_GAIN // #define NLSOUND_DEBUG_GAIN
using namespace std; using namespace std;

@ -20,6 +20,10 @@
#include "buffer_xaudio2.h" #include "buffer_xaudio2.h"
#include "adpcm_xaudio2.h" #include "adpcm_xaudio2.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std; using namespace std;
// using namespace NLMISC; // using namespace NLMISC;

@ -20,6 +20,10 @@
#include "buffer_xaudio2.h" #include "buffer_xaudio2.h"
#include "sound_driver_xaudio2.h" #include "sound_driver_xaudio2.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;

@ -21,6 +21,10 @@
#include "listener_xaudio2.h" #include "listener_xaudio2.h"
#include "effect_xaudio2.h" #include "effect_xaudio2.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;

@ -20,6 +20,10 @@
#include "sound_driver_xaudio2.h" #include "sound_driver_xaudio2.h"
#include "listener_xaudio2.h" #include "listener_xaudio2.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;

@ -22,6 +22,10 @@
#include "effect_xaudio2.h" #include "effect_xaudio2.h"
#include "sound_driver_xaudio2.h" #include "sound_driver_xaudio2.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;

@ -26,6 +26,10 @@
#include "effect_xaudio2.h" #include "effect_xaudio2.h"
#include "source_xaudio2.h" #include "source_xaudio2.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;

@ -135,7 +135,6 @@ IF(WITH_RYZOM_CLIENT)
ENDIF() ENDIF()
ENDIF() ENDIF()
IF(WITH_RYZOM_STEAM AND STEAM_RUNTIME) IF(WITH_RYZOM_STEAM AND STEAM_RUNTIME)
ADD_CUSTOM_COMMAND(TARGET ryzom_client POST_BUILD COMMAND cp -p ${STEAM_RUNTIME} ${RYZOM_CONTENTS_DIR}/MacOS) ADD_CUSTOM_COMMAND(TARGET ryzom_client POST_BUILD COMMAND cp -p ${STEAM_RUNTIME} ${RYZOM_CONTENTS_DIR}/MacOS)
@ -178,7 +177,6 @@ IF(WITH_RYZOM_CLIENT)
${LUA_LIBRARIES} ${LUA_LIBRARIES}
${LUABIND_LIBRARIES} ${LUABIND_LIBRARIES}
${CURL_LIBRARIES} ${CURL_LIBRARIES}
${OPENSSL_LIBRARIES}
) )
IF(NOT APPLE AND NOT WIN32) IF(NOT APPLE AND NOT WIN32)

@ -22,6 +22,10 @@
#include "events_listener.h" #include "events_listener.h"
#include "interface_v3/interface_manager.h" #include "interface_v3/interface_manager.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;

@ -28,6 +28,9 @@
#include "actions_client.h" #include "actions_client.h"
#include "interface_v3/input_handler_manager.h" #include "interface_v3/input_handler_manager.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
/////////// ///////////
// USING // // USING //

@ -35,6 +35,9 @@
#include "client_cfg.h" #include "client_cfg.h"
#include "entity_animation_manager.h" // \todo GUIGUI : added to recompile animations at loading (to do better ?). #include "entity_animation_manager.h" // \todo GUIGUI : added to recompile animations at loading (to do better ?).
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
/////////// ///////////
// USING // // USING //

@ -27,6 +27,10 @@
#include "nel/3d/u_scene.h" #include "nel/3d/u_scene.h"
#include "client_sheets/animation_fx_set_sheet.h" #include "client_sheets/animation_fx_set_sheet.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
extern NL3D::UScene *Scene; extern NL3D::UScene *Scene;

@ -23,6 +23,10 @@
// //
#include "nel/3d/u_scene.h" #include "nel/3d/u_scene.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
extern NL3D::UScene *Scene; extern NL3D::UScene *Scene;
// ********************************************************************* // *********************************************************************

@ -20,4 +20,8 @@
#include "animation_fx_misc.h" #include "animation_fx_misc.h"
#include "animation_fx_id_array.h" #include "animation_fx_id_array.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
CAnimationFXIDArray AnimFXMisc; CAnimationFXIDArray AnimFXMisc;

@ -27,6 +27,9 @@
// 3d // 3d
#include "nel/3d/u_track.h" #include "nel/3d/u_track.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
/////////// ///////////
// USING // // USING //

@ -33,6 +33,10 @@
#include "nel/georges/u_form_elm.h" #include "nel/georges/u_form_elm.h"
#include "nel/georges/u_form_loader.h" #include "nel/georges/u_form_loader.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
/////////// ///////////
// USING // // USING //
/////////// ///////////

@ -30,6 +30,10 @@
// Georges // Georges
#include "nel/georges/u_form_elm.h" #include "nel/georges/u_form_elm.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
/////////// ///////////
// USING // // USING //
/////////// ///////////

@ -21,6 +21,10 @@
#include <CoreFoundation/CoreFoundation.h> #include <CoreFoundation/CoreFoundation.h>
#endif #endif
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
std::string getAppBundlePath() std::string getAppBundlePath()
{ {
static std::string s_cachedPathToBundle; static std::string s_cachedPathToBundle;

@ -27,6 +27,10 @@
#include "time_client.h" #include "time_client.h"
#include "fx_manager.h" #include "fx_manager.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
extern NL3D::UScene *Scene; extern NL3D::UScene *Scene;

@ -29,6 +29,9 @@
// //
#include <utility> #include <utility>
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
H_AUTO_DECL(RZ_AttackList) H_AUTO_DECL(RZ_AttackList)

@ -33,6 +33,9 @@
#include <string> #include <string>
#include <fstream> #include <fstream>
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
/////////// ///////////
// USING // // USING //

@ -19,6 +19,10 @@
#include "stdpch.h" #include "stdpch.h"
#include "behaviour_context.h" #include "behaviour_context.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
CBehaviourContext::CBehaviourContext() CBehaviourContext::CBehaviourContext()
{ {
} }

@ -31,6 +31,10 @@
#include "nel/misc/win_thread.h" #include "nel/misc/win_thread.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace BGDownloader; using namespace BGDownloader;
using namespace NLMISC; using namespace NLMISC;

@ -17,6 +17,10 @@
#include "stdpch.h" #include "stdpch.h"
#include "browse_faq.h" #include "browse_faq.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC; using namespace NLMISC;
void browseFAQ(NLMISC::CConfigFile &cf) void browseFAQ(NLMISC::CConfigFile &cf)

@ -22,6 +22,10 @@
#include "global.h" #include "global.h"
#include "misc.h" #include "misc.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC; using namespace NLMISC;
using namespace NL3D; using namespace NL3D;

@ -111,6 +111,9 @@
#include "game_share/range_weapon_type.h" #include "game_share/range_weapon_type.h"
// //
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
//////////// ////////////
// DEFINE // // DEFINE //
@ -137,10 +140,6 @@ using namespace std;
using namespace MBEHAV; using namespace MBEHAV;
using namespace CLFECOMMON; using namespace CLFECOMMON;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
//////////// ////////////
// EXTERN // // EXTERN //
//////////// ////////////

@ -107,6 +107,9 @@
// to desactive some commands // to desactive some commands
// //
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
//////////////// ////////////////

@ -935,7 +935,6 @@ void CContinent::unselect()
// Remove the instances (shapes). // Remove the instances (shapes).
EntitiesMngr.removeInstances(); EntitiesMngr.removeInstances();
// release collision primitives // release collision primitives
if (IGCallbacks) if (IGCallbacks)
{ {

@ -26,6 +26,10 @@ using namespace NLMISC;
using namespace NLNET; using namespace NLNET;
using namespace std; using namespace std;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
#define _Curl (CURL *)_CurlStruct #define _Curl (CURL *)_CurlStruct
@ -113,6 +117,25 @@ static CURLcode sslctx_function(CURL * /* curl */, void *sslctx, void * /* parm
if (itmp && itmp->x509) if (itmp && itmp->x509)
{ {
X509_NAME *subject = X509_get_subject_name(itmp->x509);
std::string name;
unsigned char *tmp = NULL;
// construct a multiline string with name
for (int i = 0, ilen = X509_NAME_entry_count(subject); i < ilen; ++i)
{
X509_NAME_ENTRY *e = X509_NAME_get_entry(subject, i);
ASN1_STRING *d = X509_NAME_ENTRY_get_data(e);
if (ASN1_STRING_to_UTF8(&tmp, d) > 0)
{
name += NLMISC::toString("%s\n", tmp);
OPENSSL_free(tmp);
}
}
// add our certificate to this store // add our certificate to this store
if (X509_STORE_add_cert(store, itmp->x509) == 0) if (X509_STORE_add_cert(store, itmp->x509) == 0)
{ {
@ -122,13 +145,13 @@ static CURLcode sslctx_function(CURL * /* curl */, void *sslctx, void * /* parm
if (ERR_GET_LIB(errCode) != ERR_LIB_X509 || ERR_GET_REASON(errCode) != X509_R_CERT_ALREADY_IN_HASH_TABLE) if (ERR_GET_LIB(errCode) != ERR_LIB_X509 || ERR_GET_REASON(errCode) != X509_R_CERT_ALREADY_IN_HASH_TABLE)
{ {
ERR_error_string_n(errCode, errorBuffer, 1024); ERR_error_string_n(errCode, errorBuffer, 1024);
nlwarning("Error adding certificate %s: %s", itmp->x509->name, errorBuffer); nlwarning("Error adding certificate %s: %s", name.c_str(), errorBuffer);
res = CURLE_SSL_CACERT; res = CURLE_SSL_CACERT;
} }
} }
else else
{ {
nlinfo("Added certificate %s", itmp->x509->name); nlinfo("Added certificate %s", name.c_str());
} }
} }
} }

@ -21,6 +21,10 @@
// //
#include "nel/misc/i18n.h" #include "nel/misc/i18n.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC; using namespace NLMISC;

@ -17,6 +17,9 @@
#include "stdpch.h" #include "stdpch.h"
#include "config_var.h" #include "config_var.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace R2 namespace R2

@ -23,6 +23,10 @@
#include "nel/gui/lua_ihm.h" #include "nel/gui/lua_ihm.h"
#include "nel/gui/interface_element.h" #include "nel/gui/interface_element.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace R2 namespace R2
{ {

@ -20,6 +20,10 @@
#include "../interface_v3/lua_ihm_ryzom.h" #include "../interface_v3/lua_ihm_ryzom.h"
#include "editor.h" #include "editor.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace R2 namespace R2
{ {

@ -33,6 +33,10 @@
// //
#include "r2_config.h" #include "r2_config.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC; using namespace NLMISC;
extern uint SkipFrame; extern uint SkipFrame;

@ -23,6 +23,9 @@
#include "../interface_v3/interface_manager.h" #include "../interface_v3/interface_manager.h"
#include "nel/gui/view_renderer.h" #include "nel/gui/view_renderer.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC; using namespace NLMISC;

@ -58,6 +58,10 @@
// //
#include "../sheet_manager.h" #include "../sheet_manager.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC; using namespace NLMISC;
using namespace NL3D; using namespace NL3D;

@ -38,6 +38,10 @@
#include "../time_client.h" #include "../time_client.h"
// //
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
class CGroupMap; class CGroupMap;
using namespace R2; using namespace R2;

@ -22,6 +22,9 @@
#include "../global.h" #include "../global.h"
// //
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC; using namespace NLMISC;
using namespace NL3D; using namespace NL3D;

@ -33,6 +33,9 @@
#include "nel/3d/u_visual_collision_manager.h" #include "nel/3d/u_visual_collision_manager.h"
#include "nel/3d/u_visual_collision_entity.h" #include "nel/3d/u_visual_collision_entity.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC; using namespace NLMISC;

@ -21,6 +21,10 @@
#include "../editor.h" #include "../editor.h"
#include "nel/gui/lua_ihm.h" #include "nel/gui/lua_ihm.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace R2 namespace R2
{ {

@ -68,6 +68,9 @@
#include <zlib.h> #include <zlib.h>
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std; using namespace std;

@ -58,6 +58,9 @@ using namespace NLGUI;
using namespace NLMISC; using namespace NLMISC;
using namespace R2; using namespace R2;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
std::map<lua_State*, CComLuaModule*> CComLuaModule::_Instance; std::map<lua_State*, CComLuaModule*> CComLuaModule::_Instance;

@ -45,6 +45,9 @@
#include <assert.h> #include <assert.h>
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLNET; using namespace NLNET;
using namespace NLMISC; using namespace NLMISC;

@ -21,6 +21,10 @@
#include <assert.h> #include <assert.h>
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace R2; using namespace R2;
namespace R2 namespace R2

@ -21,6 +21,11 @@
#include "game_share/object.h" #include "game_share/object.h"
#include <assert.h> #include <assert.h>
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace R2; using namespace R2;

@ -47,7 +47,6 @@
#include "editor.h" #include "editor.h"
// //
#include "nel/gui/lua_helper.h" #include "nel/gui/lua_helper.h"
using namespace NLGUI;
#include "nel/gui/group_tree.h" #include "nel/gui/group_tree.h"
#include "../interface_v3/interface_manager.h" #include "../interface_v3/interface_manager.h"
#include "../contextual_cursor.h" #include "../contextual_cursor.h"
@ -115,11 +114,14 @@ using namespace NLGUI;
#include "../far_tp.h" #include "../far_tp.h"
#include "nel/gui/lua_manager.h" #include "nel/gui/lua_manager.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC; using namespace NLMISC;
using namespace NLNET; using namespace NLNET;
using namespace NL3D; using namespace NL3D;
using namespace NLGUI;
extern CEventsListener EventsListener; extern CEventsListener EventsListener;
extern CLog g_log; extern CLog g_log;
@ -1628,8 +1630,17 @@ int CEditor::luaEnumInstances(CLuaState &ls)
mt.setValue("__gc", CLuaObject(ls)); mt.setValue("__gc", CLuaObject(ls));
// //
void *newIter = ls.newUserData(sizeof(CInstanceEnumerator)); void *newIter = ls.newUserData(sizeof(CInstanceEnumerator));
#ifdef new
#undef new
#endif
CInstanceEnumerator *ie = new (newIter) CInstanceEnumerator; CInstanceEnumerator *ie = new (newIter) CInstanceEnumerator;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
ie->InstMap = &getEditor()._InstancesByDispName[classIndex]; ie->InstMap = &getEditor()._InstancesByDispName[classIndex];
ie->Current = ie->InstMap->begin(); ie->Current = ie->InstMap->begin();
mt.push(); mt.push();

@ -21,6 +21,10 @@
// //
#include "nel/misc/vector.h" #include "nel/misc/vector.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC; using namespace NLMISC;
namespace R2 namespace R2

@ -20,6 +20,10 @@
#include "../user_entity.h" #include "../user_entity.h"
#include "../time_client.h" #include "../time_client.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC; using namespace NLMISC;
namespace R2 namespace R2

@ -30,6 +30,9 @@
// //
#include "displayer_visual_entity.h" #include "displayer_visual_entity.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC; using namespace NLMISC;

@ -33,6 +33,10 @@
// //
#include "nel/3d/texture_file.h" #include "nel/3d/texture_file.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
extern CContinentManager ContinentMngr; extern CContinentManager ContinentMngr;
using namespace NL3D; using namespace NL3D;

@ -18,6 +18,9 @@
#include "lua_event_forwarder.h" #include "lua_event_forwarder.h"
#include "nel/gui/lua_object.h" #include "nel/gui/lua_object.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace R2 namespace R2
{ {

@ -21,6 +21,9 @@
#include "../global.h" #include "../global.h"
#include "../misc.h" #include "../misc.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC; using namespace NLMISC;
using namespace NL3D; using namespace NL3D;

@ -27,6 +27,10 @@
#include "../sheet_manager.h" #include "../sheet_manager.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC; using namespace NLMISC;
using namespace NL3D; using namespace NL3D;
using namespace std; using namespace std;

@ -21,6 +21,10 @@
#include "nel/gui/lua_ihm.h" #include "nel/gui/lua_ihm.h"
#include "../interface_v3/lua_ihm_ryzom.h" #include "../interface_v3/lua_ihm_ryzom.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace R2 namespace R2
{ {
@ -319,7 +323,17 @@ void CObjectTableClient::pushOnLuaStack(CLuaState &state, CLuaObject &metatable)
nlassert(metatable.isValid()); nlassert(metatable.isValid());
// return a new refptr on the sub table // return a new refptr on the sub table
void *block = state.newUserData(sizeof(TRefPtrConst)); void *block = state.newUserData(sizeof(TRefPtrConst));
#ifdef new
#undef new
#endif
new (block) CObjectTable::TRefPtrConst(this); // create in place new (block) CObjectTable::TRefPtrConst(this); // create in place
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
metatable.push(); metatable.push();
state.setMetaTable(-2); state.setMetaTable(-2);
_Ref.pop(state); _Ref.pop(state);

@ -18,6 +18,9 @@
#include "palette_node.h" #include "palette_node.h"
#include "editor.h" #include "editor.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace R2 namespace R2

@ -29,6 +29,9 @@
#include "nel/gui/view_renderer.h" #include "nel/gui/view_renderer.h"
#include "../interface_v3/group_map.h" #include "../interface_v3/group_map.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NL3D; using namespace NL3D;
using namespace NLMISC; using namespace NLMISC;

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save