diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3a26c9bd..058ae75c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -37,7 +37,7 @@ set (CMAKE_FIND_LIBRARY_SUFFIXES .a .so .dylib) # Windows-specific definitions if (CMAKE_SYSTEM MATCHES "Windows*") - set (DEFINES ${DEFINES} -DTARGET_WIN -D_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS -D_UNICODE -D_CRT_SECURE_NO_WARNINGS) + set (DEFINES ${DEFINES} -DTARGET_WIN -D_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS -D_UNICODE -D_CRT_SECURE_NO_WARNINGS -DNOMINMAX) set (TARGET_WIN ON) endif() @@ -340,9 +340,14 @@ set (LIBS_STATIC ${LIBS_STATIC} jrtplib g729_codec gsm_codec opus if (USE_AMR_CODEC) #include (${LIB_PLATFORM}/platform_libs.cmake) - set (OPENCORE_AMRNB opencore-amrnb) - set (OPENCORE_AMRWB opencore-amrwb) - message("Media: AMR NB and WB codecs will be included.") + if (TARGET_WIN) + set (OPENCORE_AMRNB ${CMAKE_CURRENT_LIST_DIR}/libs/opencore-amr/opencore-amrnb.lib) + set (OPENCORE_AMRWB ${CMAKE_CURRENT_LIST_DIR}/libs/opencore-amr/opencore-amrwb.lib) + else() + set (OPENCORE_AMRNB opencore-amrnb) + set (OPENCORE_AMRWB opencore-amrwb) + endif() + message("Media: AMR NB and WB codecs will be included: {OPENCORE_AMRNB} / {OPENCORE_AMRWB}") set (DEFINES ${DEFINES} -DUSE_AMR_CODEC) set (LIBS_STATIC ${LIBS_STATIC} ${OPENCORE_AMRNB} ${OPENCORE_AMRWB}) endif() diff --git a/src/engine/audio/Audio_DataWindow.cpp b/src/engine/audio/Audio_DataWindow.cpp index 8a16c404..62b00940 100644 --- a/src/engine/audio/Audio_DataWindow.cpp +++ b/src/engine/audio/Audio_DataWindow.cpp @@ -1,4 +1,4 @@ -/* Copyright(C) 2007-2018 VoIP objects (voipobjects.com) +/* Copyright(C) 2007-2026 VoIP objects (voipobjects.com) * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/src/engine/audio/Audio_DevicePair.cpp b/src/engine/audio/Audio_DevicePair.cpp index b408f9b0..fd66bd3b 100644 --- a/src/engine/audio/Audio_DevicePair.cpp +++ b/src/engine/audio/Audio_DevicePair.cpp @@ -1,9 +1,8 @@ -/* Copyright(C) 2007-2017 VoIPobjects (voipobjects.com) +/* Copyright(C) 2007-2026 VoIPobjects (voipobjects.com) * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#define NOMINMAX #include "Audio_DevicePair.h" #include #include diff --git a/src/engine/helper/HL_Process.cpp b/src/engine/helper/HL_Process.cpp index fdaf240d..31a4c9b1 100644 --- a/src/engine/helper/HL_Process.cpp +++ b/src/engine/helper/HL_Process.cpp @@ -1,6 +1,7 @@ #include "HL_Process.h" #include #include +#include #ifdef TARGET_WIN # define popen _popen @@ -9,7 +10,6 @@ #if defined(TARGET_WIN) #include -#include #include "helper/HL_String.h" int OsProcess::execSystem(const std::string& cmd) @@ -68,7 +68,7 @@ std::string OsProcess::execCommand(const std::string& cmd) if (!dwAvail) // no data available, return break; - if (!::ReadFile(hPipeRead, buf, min(sizeof(buf) - 1, dwAvail), &dwRead, NULL) || !dwRead) + if (!::ReadFile(hPipeRead, buf, std::min(sizeof(buf) - 1, (size_t)dwAvail), &dwRead, NULL) || !dwRead) // error, the child process might ended break; @@ -148,7 +148,7 @@ std::shared_ptr OsProcess::asyncExecCommand(const std::string& cmdl break; int filled = strlen(buf); - if (!::ReadFile(hPipeRead, buf + filled, min(sizeof(buf) - 1 - filled, dwAvail), &dwRead, nullptr) || !dwRead) + if (!::ReadFile(hPipeRead, buf + filled, std::min(sizeof(buf) - 1 - filled, (size_t)dwAvail), &dwRead, nullptr) || !dwRead) // error, the child process might ended break; diff --git a/src/engine/media/MT_AudioCodec.cpp b/src/engine/media/MT_AudioCodec.cpp index e41746e6..f855614d 100644 --- a/src/engine/media/MT_AudioCodec.cpp +++ b/src/engine/media/MT_AudioCodec.cpp @@ -1,10 +1,8 @@ -/* Copyright(C) 2007-2023 VoIPobjects (voipobjects.com) +/* Copyright(C) 2007-2026 VoIPobjects (voipobjects.com) * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#define NOMINMAX - #include "../engine_config.h" #include "MT_AudioCodec.h" #include "MT_CodecList.h" diff --git a/src/engine/media/MT_AudioReceiver.cpp b/src/engine/media/MT_AudioReceiver.cpp index 9c2da62c..1ff2805f 100644 --- a/src/engine/media/MT_AudioReceiver.cpp +++ b/src/engine/media/MT_AudioReceiver.cpp @@ -1,12 +1,8 @@ -/* Copyright(C) 2007-2021 VoIPobjects (voipobjects.com) +/* Copyright(C) 2007-2026 VoIPobjects (voipobjects.com) * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#if defined(TARGET_WIN) && !defined(NOMINMAX) -# define NOMINMAX -#endif - #include "../engine_config.h" #include "MT_AudioReceiver.h" #include "MT_AudioCodec.h" diff --git a/src/libs/ice/ICEByteBuffer.cpp b/src/libs/ice/ICEByteBuffer.cpp index 9f671691..85b67d2c 100644 --- a/src/libs/ice/ICEByteBuffer.cpp +++ b/src/libs/ice/ICEByteBuffer.cpp @@ -3,8 +3,6 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#define NOMINMAX - #include "ICEPlatform.h" #include "ICEByteBuffer.h" #include "ICEError.h" diff --git a/src/libs/ice/ICETypes.h b/src/libs/ice/ICETypes.h index fe5e00e6..145dd59a 100644 --- a/src/libs/ice/ICETypes.h +++ b/src/libs/ice/ICETypes.h @@ -1,4 +1,4 @@ -/* Copyright(C) 2007-2014 VoIP objects (voipobjects.com) +/* Copyright(C) 2007-2026 VoIP objects (voipobjects.com) * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ @@ -6,11 +6,8 @@ #ifndef __ICE_TYPES_H #define __ICE_TYPES_H -#include - - //#define INVALID_SOCKET (-1) -# ifndef SOCKET +#if !defined(TARGET_WIN) && !defined(SOCKET) # define SOCKET int -# endif +#endif #endif diff --git a/src/libs/resiprocate/CMakeLists.txt b/src/libs/resiprocate/CMakeLists.txt index cd04a40e..b1cac894 100644 --- a/src/libs/resiprocate/CMakeLists.txt +++ b/src/libs/resiprocate/CMakeLists.txt @@ -363,7 +363,7 @@ target_include_directories(resiprocate PUBLIC set (RESIP_DEFINES -DUSE_SSL -DUSE_IPV6 -DUSE_ARES) if (TARGET_WIN) - set (RESIP_DEFINES ${RESIP_DEFINES} -DARES_LEGACY_DEFINES) + set (RESIP_DEFINES ${RESIP_DEFINES} -DARES_LEGACY_DEFINES -DNOMINMAX) else() set (RESIP_DEFINES ${RESIP_DEFINES} -DHAVE_ARPA_NAMESER_H) endif() @@ -373,4 +373,7 @@ target_link_libraries(resiprocate PUBLIC OpenSSL::SSL) target_link_libraries(resiprocate PUBLIC OpenSSL::Crypto) target_compile_definitions(resiprocate PUBLIC ${RESIP_DEFINES}) -target_compile_options(resiprocate PUBLIC -Wno-deprecated -Wno-deprecated-declarations) + +if (TARGET_LINUX OR TARGET_OSX OR TARGET_ANDROID OR TARGET_IOS) + target_compile_options(resiprocate PUBLIC -Wno-deprecated -Wno-deprecated-declarations) +endif() diff --git a/src/libs/resiprocate/rutil/ssl/SHA1Stream.cxx b/src/libs/resiprocate/rutil/ssl/SHA1Stream.cxx index ffeedb5d..989f5026 100644 --- a/src/libs/resiprocate/rutil/ssl/SHA1Stream.cxx +++ b/src/libs/resiprocate/rutil/ssl/SHA1Stream.cxx @@ -1,4 +1,3 @@ -#define NOMINMAX #include #include