From ed92cbdab56dde0a4873f298328d5a073ffb949b Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 2 Oct 2024 14:50:00 +0200 Subject: [PATCH 01/11] [cgal] update to version 6.0 --- ports/cgal/portfile.cmake | 10 ++-------- ports/cgal/vcpkg.json | 14 ++++---------- ports/cgal/x86_windows.patch | 24 ------------------------ 3 files changed, 6 insertions(+), 42 deletions(-) delete mode 100644 ports/cgal/x86_windows.patch diff --git a/ports/cgal/portfile.cmake b/ports/cgal/portfile.cmake index 4cc25786876e63..43c7fd955b9418 100644 --- a/ports/cgal/portfile.cmake +++ b/ports/cgal/portfile.cmake @@ -4,16 +4,10 @@ vcpkg_buildpath_length_warning(37) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO CGAL/cgal - REF v5.6.1 - SHA512 943413bf3b94da066d47051b22f1c1b66a39a43dad865dd0e4912a9ae6508d9a490bcfe4ef7d662844e9a1ba6e552748fad785b52b2cce98133c2dfdfbfe1a4d + REF v6.0 + SHA512 f61e608898d798b90ce07260928b682161f00e964b43b9876ef6604d10c30787a0814e13afde90f7d703efd6b83c61dd4a9d9f50d21068bd50c5c15f94b5755b HEAD_REF master ) - -vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS - FEATURES - qt WITH_CGAL_Qt5 -) - vcpkg_cmake_configure( SOURCE_PATH "${SOURCE_PATH}" OPTIONS diff --git a/ports/cgal/vcpkg.json b/ports/cgal/vcpkg.json index ad521023d5cf4c..0f180163f7f658 100644 --- a/ports/cgal/vcpkg.json +++ b/ports/cgal/vcpkg.json @@ -1,7 +1,6 @@ { "name": "cgal", - "version": "5.6.1", - "port-version": 1, + "version": "6.0", "description": "The Computational Geometry Algorithms Library (CGAL) is a C++ library that aims to provide easy access to efficient and reliable algorithms in computational geometry.", "homepage": "https://github.com/CGAL/cgal", "license": "GPL-3.0-or-later AND LGPL-3.0-or-later AND BSL-1.0", @@ -67,14 +66,9 @@ "description": "Qt GUI support for CGAL", "dependencies": [ "eigen3", - "qt5-3d", - { - "name": "qt5-base", - "default-features": false - }, - "qt5-script", - "qt5-svg", - "qt5-xmlpatterns" + "qtbase", + "qtdeclarative", + "qtsvg" ] } } diff --git a/ports/cgal/x86_windows.patch b/ports/cgal/x86_windows.patch deleted file mode 100644 index fcb26a683807ca..00000000000000 --- a/ports/cgal/x86_windows.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff --git a/Number_types/include/CGAL/boost_mp.h b/Number_types/include/CGAL/boost_mp.h -index 3dcaadcad21..b98980acbc5 100644 ---- a/Number_types/include/CGAL/boost_mp.h -+++ b/Number_types/include/CGAL/boost_mp.h -@@ -20,8 +20,18 @@ - // easy solution. - // MSVC had trouble with versions <= 1.69: - // https://github.com/boostorg/multiprecision/issues/98 -+// -+// Disable also on Windows 32 bits -+// because CGAL/cpp_float.h assumes _BitScanForward64 is available -+// See https://learn.microsoft.com/en-us/cpp/intrinsics/bitscanforward-bitscanforward64 -+// -+// Disable also with PowerPC processors, with Boost<1.80 because of that bug: -+// https://github.com/boostorg/multiprecision/pull/421 -+// - #if !defined CGAL_DO_NOT_USE_BOOST_MP && \ -- (!defined _MSC_VER || BOOST_VERSION >= 107000) -+ (!defined _MSC_VER || BOOST_VERSION >= 107000) && \ -+ (!defined _WIN32 || defined _WIN64) && \ -+ (BOOST_VERSION >= 108000 || (!defined _ARCH_PPC && !defined _ARCH_PPC64)) - #define CGAL_USE_BOOST_MP 1 - - #include From ce264097336d7b1551e0586fd04f90c03bc33a13 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Mon, 7 Oct 2024 14:08:06 +0200 Subject: [PATCH 02/11] fixes/improvements after [review by @dg0yt] Thanks for the review. [review by @dg0yt]: https://github.com/microsoft/vcpkg/pull/41300#pullrequestreview-2344624295 --- ports/cgal/portfile.cmake | 2 +- ports/cgal/vcpkg.json | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ports/cgal/portfile.cmake b/ports/cgal/portfile.cmake index 43c7fd955b9418..a1f4258081838a 100644 --- a/ports/cgal/portfile.cmake +++ b/ports/cgal/portfile.cmake @@ -4,7 +4,7 @@ vcpkg_buildpath_length_warning(37) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO CGAL/cgal - REF v6.0 + REF v${VERSION} SHA512 f61e608898d798b90ce07260928b682161f00e964b43b9876ef6604d10c30787a0814e13afde90f7d703efd6b83c61dd4a9d9f50d21068bd50c5c15f94b5755b HEAD_REF master ) diff --git a/ports/cgal/vcpkg.json b/ports/cgal/vcpkg.json index 0f180163f7f658..6698de04ae7fb2 100644 --- a/ports/cgal/vcpkg.json +++ b/ports/cgal/vcpkg.json @@ -66,7 +66,10 @@ "description": "Qt GUI support for CGAL", "dependencies": [ "eigen3", - "qtbase", + { + "name": "qtbase", + "default-features": false + }, "qtdeclarative", "qtsvg" ] From 12f85a895ba0cd3aa382b235a71b567c95f2d651 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Mon, 7 Oct 2024 14:11:27 +0200 Subject: [PATCH 03/11] add a patch patch from upstream PR https://github.com/CGAL/cgal/pull/8523 --- ...L_CGAL-protect_against_macro_free-GF.patch | 88 +++++++++++++++++++ ports/cgal/portfile.cmake | 2 + 2 files changed, 90 insertions(+) create mode 100644 ports/cgal/PR-8523__CGAL_CGAL-protect_against_macro_free-GF.patch diff --git a/ports/cgal/PR-8523__CGAL_CGAL-protect_against_macro_free-GF.patch b/ports/cgal/PR-8523__CGAL_CGAL-protect_against_macro_free-GF.patch new file mode 100644 index 00000000000000..a319cfc1f89acc --- /dev/null +++ b/ports/cgal/PR-8523__CGAL_CGAL-protect_against_macro_free-GF.patch @@ -0,0 +1,88 @@ +From cab1117b50a322f8d99f10b11b9654d36e889548 Mon Sep 17 00:00:00 2001 +From: Laurent Rineau +Date: Mon, 7 Oct 2024 10:52:17 +0200 +Subject: [PATCH] CGAL_Core: protect against macro `free` https://github.com/CGAL/cgal/pull/8523 + +From vcpkg CI, there is this error: + +``` +123456789101112131415161718192021222324252627C:\PROGRA~1\MICROS~1\2022\ENTERP~1\VC\Tools\MSVC\1441~1.341\bin\Hostx64\x64\cl.exe /TP -DBOOST_ATOMIC_DYN_LINK -DBOOST_ATOMIC_NO_LIB -DBOOST_CHRONO_DYN_LINK -DBOOST_CHRONO_NO_LIB -DBOOST_CONTAINER_DYN_LINK -DBOOST_CONTAINER_NO_LIB -DBOOST_DATE_TIME_DYN_LINK -DBOOST_DATE_TIME_NO_LIB -DBOOST_IOSTREAMS_DYN_LINK -DBOOST_IOSTREAMS_NO_LIB -DBOOST_PROGRAM_OPTIONS_DYN_LINK -DBOOST_PROGRAM_OPTIONS_NO_LIB -DBOOST_RANDOM_DYN_LINK -DBOOST_RANDOM_NO_LIB -DBOOST_SERIALIZATION_DYN_LINK -DBOOST_SERIALIZATION_NO_LIB -DBOOST_THREAD_DYN_LINK -DBOOST_THREAD_NO_LIB -DBOOST_THREAD_USE_DLL -DCGAL_USE_GMPXX=1 -DGFLAGS_IS_A_DLL=1 -DGLOG_NO_ABBREVIATED_SEVERITIES -DGLOG_USE_GFLAGS -DGLOG_USE_GLOG_EXPORT -DH5_BUILT_AS_DYNAMIC_LIB -D_LIB -D_USE_BOOST -D_USE_EIGEN -D_USE_FAST_CBRT -D_USE_FAST_FLOAT2INT -D_USE_NONFREE -D_USE_OPENGL -D_USE_SSE -ID:\b\openmvs\x64-windows-dbg\libs\MVS\MVS_autogen\include -ID:\b\openmvs\src\v2.1.0-1e694de437.clean -ID:\b\openmvs\x64-windows-dbg -external:ID:\installed\x64-windows\include -external:ID:\installed\x64-windows\include\eigen3 -external:W0 /nologo /DWIN32 /D_WINDOWS /utf-8 /GR /EHsc /MP /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi /Zm170 /Zc:__cplusplus /wd4231 /wd4251 /wd4308 /wd4396 /wd4503 /wd4661 /wd4996 /D_DEBUG /MDd /Z7 /Ob0 /Od /RTC1 -std:c++17 -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS /fp:strict /fp:except- /bigobj /Zc:__cplusplus /YuD:/b/openmvs/x64-windows-dbg/libs/MVS/CMakeFiles/MVS.dir/cmake_pch.hxx /FpD:/b/openmvs/x64-windows-dbg/libs/MVS/CMakeFiles/MVS.dir/./cmake_pch.cxx.pch /FID:/b/openmvs/x64-windows-dbg/libs/MVS/CMakeFiles/MVS.dir/cmake_pch.hxx /showIncludes /Folibs\MVS\CMakeFiles\MVS.dir\SceneReconstruct.cpp.obj /Fdlibs\MVS\CMakeFiles\MVS.dir\MVS.pdb /FS -c D:\b\openmvs\src\v2.1.0-1e694de437.clean\libs\MVS\SceneReconstruct.cpp +D:\installed\x64-windows\include\CGAL/CORE/MemoryPool.h(76): error C2059: syntax error: 'constant' +D:\installed\x64-windows\include\CGAL/CORE/MemoryPool.h(76): note: the template instantiation context (the oldest one first) is +D:\installed\x64-windows\include\CGAL/CORE/MemoryPool.h(39): note: while compiling class template 'CORE::MemoryPool' +D:\installed\x64-windows\include\CGAL/CORE/MemoryPool.h(119): error C2988: unrecognizable template declaration/definition +D:\installed\x64-windows\include\CGAL/CORE/MemoryPool.h(119): error C2059: syntax error: 'constant' +D:\installed\x64-windows\include\CGAL/CORE/Expr_impl.h(1217): error C2660: 'CORE::MemoryPool::_free_dbg': function does not take 2 arguments +D:\installed\x64-windows\include\CGAL/CORE/MemoryPool.h(76): note: see declaration of 'CORE::MemoryPool::_free_dbg' +D:\installed\x64-windows\include\CGAL/CORE/Expr_impl.h(1217): note: while trying to match the argument list '(void *, int)' +``` + +There is probably a macro named `free` somewhere. +--- + CGAL_Core/include/CGAL/CORE/ExprRep.h | 4 ++-- + CGAL_Core/include/CGAL/CORE/Impl.h | 2 +- + CGAL_Core/include/CGAL/CORE/MemoryPool.h | 2 +- + CGAL_Core/include/CGAL/CORE/RealRep.h | 2 +- + 4 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/CGAL_Core/include/CGAL/CORE/ExprRep.h b/CGAL_Core/include/CGAL/CORE/ExprRep.h +index 0e721dda16a8..a325930a2ab4 100644 +--- a/CGAL_Core/include/CGAL/CORE/ExprRep.h ++++ b/CGAL_Core/include/CGAL/CORE/ExprRep.h +@@ -595,7 +595,7 @@ class CGAL_CORE_EXPORT ConstPolyRep : public ConstRep { + } + + void operator delete( void *p, size_t ){ +- MemoryPool::global_allocator().free(p); ++ (MemoryPool::global_allocator().free)(p); + } + + private: +@@ -1248,7 +1248,7 @@ void * AddSubRep::operator new( size_t size) + + template + void AddSubRep::operator delete( void *p, size_t ) +-{ MemoryPool >::global_allocator().free(p); } ++{ (MemoryPool >::global_allocator().free)(p); } + + + /// \typedef AddRep +diff --git a/CGAL_Core/include/CGAL/CORE/Impl.h b/CGAL_Core/include/CGAL/CORE/Impl.h +index 4ff8b4fa3d48..8ae4c53fe7d1 100644 +--- a/CGAL_Core/include/CGAL/CORE/Impl.h ++++ b/CGAL_Core/include/CGAL/CORE/Impl.h +@@ -58,7 +58,7 @@ + { return MemoryPool >::global_allocator().allocate(size); } \ + template \ + CGAL_INLINE_FUNCTION void C::operator delete( void *p, size_t ) \ +- { MemoryPool >::global_allocator().free(p); } ++ { (MemoryPool >::global_allocator().free)(p); } + #endif + + // include some common header files +diff --git a/CGAL_Core/include/CGAL/CORE/MemoryPool.h b/CGAL_Core/include/CGAL/CORE/MemoryPool.h +index 2db3de8736e1..d218a871bec5 100644 +--- a/CGAL_Core/include/CGAL/CORE/MemoryPool.h ++++ b/CGAL_Core/include/CGAL/CORE/MemoryPool.h +@@ -73,7 +73,7 @@ class MemoryPool { + + + void* allocate(std::size_t size); +- void free(void* p); ++ void free BOOST_PREVENT_MACRO_SUBSTITUTION (void* p); + + // Access the corresponding static global allocator. + static MemoryPool& global_allocator() { +diff --git a/CGAL_Core/include/CGAL/CORE/RealRep.h b/CGAL_Core/include/CGAL/CORE/RealRep.h +index 1c5d0f13a405..f2ec1e90cb3b 100644 +--- a/CGAL_Core/include/CGAL/CORE/RealRep.h ++++ b/CGAL_Core/include/CGAL/CORE/RealRep.h +@@ -154,7 +154,7 @@ void * Realbase_for::operator new( size_t size) + + template + void Realbase_for::operator delete( void *p, size_t ) +-{ MemoryPool >::global_allocator().free(p); } ++{ (MemoryPool >::global_allocator().free)(p); } + + typedef Realbase_for RealLong; + typedef Realbase_for RealDouble; diff --git a/ports/cgal/portfile.cmake b/ports/cgal/portfile.cmake index a1f4258081838a..9f540d24bbe3ba 100644 --- a/ports/cgal/portfile.cmake +++ b/ports/cgal/portfile.cmake @@ -7,6 +7,8 @@ vcpkg_from_github( REF v${VERSION} SHA512 f61e608898d798b90ce07260928b682161f00e964b43b9876ef6604d10c30787a0814e13afde90f7d703efd6b83c61dd4a9d9f50d21068bd50c5c15f94b5755b HEAD_REF master + PATCHES + PR-8523__CGAL_CGAL-protect_against_macro_free-GF.patch ) vcpkg_cmake_configure( SOURCE_PATH "${SOURCE_PATH}" From f5cedc2a2046329a785b978e0b94ee8afb283782 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Mon, 7 Oct 2024 14:08:32 +0200 Subject: [PATCH 04/11] remove unused variable WITH_CGAL_Qt5 --- ports/cgal/portfile.cmake | 1 - 1 file changed, 1 deletion(-) diff --git a/ports/cgal/portfile.cmake b/ports/cgal/portfile.cmake index 9f540d24bbe3ba..45ddcbde2721c5 100644 --- a/ports/cgal/portfile.cmake +++ b/ports/cgal/portfile.cmake @@ -22,7 +22,6 @@ vcpkg_cmake_configure( MAYBE_UNUSED_VARIABLES CGAL_BUILD_THREE_DOC CGAL_HEADER_ONLY - WITH_CGAL_Qt5 ) vcpkg_cmake_install() From 40a1304d0a9fe609db3daeb5a777deb059aaffc2 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Mon, 7 Oct 2024 15:29:30 +0200 Subject: [PATCH 05/11] ./vcpkg x-add-version --all --- versions/baseline.json | 4 ++-- versions/c-/cgal.json | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/versions/baseline.json b/versions/baseline.json index f195e362d5bdbf..9f90a391d8f353 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -1585,8 +1585,8 @@ "port-version": 6 }, "cgal": { - "baseline": "5.6.1", - "port-version": 1 + "baseline": "6.0", + "port-version": 0 }, "cgicc": { "baseline": "3.2.20", diff --git a/versions/c-/cgal.json b/versions/c-/cgal.json index f77fa5bec639e8..a5245b72b3a1bc 100644 --- a/versions/c-/cgal.json +++ b/versions/c-/cgal.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "f57210a9f4713a483560abd57f3a5cf19a3869f8", + "version": "6.0", + "port-version": 0 + }, { "git-tree": "194089df2abf78f3701c7be7d51ddb25feaf108e", "version": "5.6.1", From dff4e67f3a1a5c8e017410f63c2d86be1490bdcf Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 8 Oct 2024 10:50:18 +0200 Subject: [PATCH 06/11] useless now that CGAL is header-only (since version 5.0) --- ports/cgal/portfile.cmake | 1 - 1 file changed, 1 deletion(-) diff --git a/ports/cgal/portfile.cmake b/ports/cgal/portfile.cmake index 45ddcbde2721c5..771025b243533d 100644 --- a/ports/cgal/portfile.cmake +++ b/ports/cgal/portfile.cmake @@ -1,5 +1,4 @@ # Header only -vcpkg_buildpath_length_warning(37) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH From c0d0b4802f8e6140618d2a30fd903c010af2e2df Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 8 Oct 2024 10:51:20 +0200 Subject: [PATCH 07/11] apply suggestions by @dg0yt Thanks again. Ref: https://github.com/microsoft/vcpkg/pull/41300#pullrequestreview-2353645190 --- ...L_CGAL-protect_against_macro_free-GF.patch | 26 ------------------- ports/cgal/portfile.cmake | 2 +- 2 files changed, 1 insertion(+), 27 deletions(-) diff --git a/ports/cgal/PR-8523__CGAL_CGAL-protect_against_macro_free-GF.patch b/ports/cgal/PR-8523__CGAL_CGAL-protect_against_macro_free-GF.patch index a319cfc1f89acc..93dc2bb0c40334 100644 --- a/ports/cgal/PR-8523__CGAL_CGAL-protect_against_macro_free-GF.patch +++ b/ports/cgal/PR-8523__CGAL_CGAL-protect_against_macro_free-GF.patch @@ -1,29 +1,3 @@ -From cab1117b50a322f8d99f10b11b9654d36e889548 Mon Sep 17 00:00:00 2001 -From: Laurent Rineau -Date: Mon, 7 Oct 2024 10:52:17 +0200 -Subject: [PATCH] CGAL_Core: protect against macro `free` https://github.com/CGAL/cgal/pull/8523 - -From vcpkg CI, there is this error: - -``` -123456789101112131415161718192021222324252627C:\PROGRA~1\MICROS~1\2022\ENTERP~1\VC\Tools\MSVC\1441~1.341\bin\Hostx64\x64\cl.exe /TP -DBOOST_ATOMIC_DYN_LINK -DBOOST_ATOMIC_NO_LIB -DBOOST_CHRONO_DYN_LINK -DBOOST_CHRONO_NO_LIB -DBOOST_CONTAINER_DYN_LINK -DBOOST_CONTAINER_NO_LIB -DBOOST_DATE_TIME_DYN_LINK -DBOOST_DATE_TIME_NO_LIB -DBOOST_IOSTREAMS_DYN_LINK -DBOOST_IOSTREAMS_NO_LIB -DBOOST_PROGRAM_OPTIONS_DYN_LINK -DBOOST_PROGRAM_OPTIONS_NO_LIB -DBOOST_RANDOM_DYN_LINK -DBOOST_RANDOM_NO_LIB -DBOOST_SERIALIZATION_DYN_LINK -DBOOST_SERIALIZATION_NO_LIB -DBOOST_THREAD_DYN_LINK -DBOOST_THREAD_NO_LIB -DBOOST_THREAD_USE_DLL -DCGAL_USE_GMPXX=1 -DGFLAGS_IS_A_DLL=1 -DGLOG_NO_ABBREVIATED_SEVERITIES -DGLOG_USE_GFLAGS -DGLOG_USE_GLOG_EXPORT -DH5_BUILT_AS_DYNAMIC_LIB -D_LIB -D_USE_BOOST -D_USE_EIGEN -D_USE_FAST_CBRT -D_USE_FAST_FLOAT2INT -D_USE_NONFREE -D_USE_OPENGL -D_USE_SSE -ID:\b\openmvs\x64-windows-dbg\libs\MVS\MVS_autogen\include -ID:\b\openmvs\src\v2.1.0-1e694de437.clean -ID:\b\openmvs\x64-windows-dbg -external:ID:\installed\x64-windows\include -external:ID:\installed\x64-windows\include\eigen3 -external:W0 /nologo /DWIN32 /D_WINDOWS /utf-8 /GR /EHsc /MP /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi /Zm170 /Zc:__cplusplus /wd4231 /wd4251 /wd4308 /wd4396 /wd4503 /wd4661 /wd4996 /D_DEBUG /MDd /Z7 /Ob0 /Od /RTC1 -std:c++17 -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS /fp:strict /fp:except- /bigobj /Zc:__cplusplus /YuD:/b/openmvs/x64-windows-dbg/libs/MVS/CMakeFiles/MVS.dir/cmake_pch.hxx /FpD:/b/openmvs/x64-windows-dbg/libs/MVS/CMakeFiles/MVS.dir/./cmake_pch.cxx.pch /FID:/b/openmvs/x64-windows-dbg/libs/MVS/CMakeFiles/MVS.dir/cmake_pch.hxx /showIncludes /Folibs\MVS\CMakeFiles\MVS.dir\SceneReconstruct.cpp.obj /Fdlibs\MVS\CMakeFiles\MVS.dir\MVS.pdb /FS -c D:\b\openmvs\src\v2.1.0-1e694de437.clean\libs\MVS\SceneReconstruct.cpp -D:\installed\x64-windows\include\CGAL/CORE/MemoryPool.h(76): error C2059: syntax error: 'constant' -D:\installed\x64-windows\include\CGAL/CORE/MemoryPool.h(76): note: the template instantiation context (the oldest one first) is -D:\installed\x64-windows\include\CGAL/CORE/MemoryPool.h(39): note: while compiling class template 'CORE::MemoryPool' -D:\installed\x64-windows\include\CGAL/CORE/MemoryPool.h(119): error C2988: unrecognizable template declaration/definition -D:\installed\x64-windows\include\CGAL/CORE/MemoryPool.h(119): error C2059: syntax error: 'constant' -D:\installed\x64-windows\include\CGAL/CORE/Expr_impl.h(1217): error C2660: 'CORE::MemoryPool::_free_dbg': function does not take 2 arguments -D:\installed\x64-windows\include\CGAL/CORE/MemoryPool.h(76): note: see declaration of 'CORE::MemoryPool::_free_dbg' -D:\installed\x64-windows\include\CGAL/CORE/Expr_impl.h(1217): note: while trying to match the argument list '(void *, int)' -``` - -There is probably a macro named `free` somewhere. ---- - CGAL_Core/include/CGAL/CORE/ExprRep.h | 4 ++-- - CGAL_Core/include/CGAL/CORE/Impl.h | 2 +- - CGAL_Core/include/CGAL/CORE/MemoryPool.h | 2 +- - CGAL_Core/include/CGAL/CORE/RealRep.h | 2 +- - 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CGAL_Core/include/CGAL/CORE/ExprRep.h b/CGAL_Core/include/CGAL/CORE/ExprRep.h index 0e721dda16a8..a325930a2ab4 100644 diff --git a/ports/cgal/portfile.cmake b/ports/cgal/portfile.cmake index 771025b243533d..977a3ad1bd7071 100644 --- a/ports/cgal/portfile.cmake +++ b/ports/cgal/portfile.cmake @@ -1,4 +1,4 @@ -# Header only +set(VCPKG_BUILD_TYPE release) # header-only vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH From 1e06cb8455689a1ab0a3ce270028915ad749c299 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 8 Oct 2024 11:03:42 +0200 Subject: [PATCH 08/11] new version of the patch --- ..._CGAL_CGAL-protect_against_macro_free-GF.patch | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/ports/cgal/PR-8523__CGAL_CGAL-protect_against_macro_free-GF.patch b/ports/cgal/PR-8523__CGAL_CGAL-protect_against_macro_free-GF.patch index 93dc2bb0c40334..fd82db67a81c8e 100644 --- a/ports/cgal/PR-8523__CGAL_CGAL-protect_against_macro_free-GF.patch +++ b/ports/cgal/PR-8523__CGAL_CGAL-protect_against_macro_free-GF.patch @@ -1,4 +1,3 @@ - diff --git a/CGAL_Core/include/CGAL/CORE/ExprRep.h b/CGAL_Core/include/CGAL/CORE/ExprRep.h index 0e721dda16a8..a325930a2ab4 100644 --- a/CGAL_Core/include/CGAL/CORE/ExprRep.h @@ -60,3 +59,17 @@ index 1c5d0f13a405..f2ec1e90cb3b 100644 typedef Realbase_for RealLong; typedef Realbase_for RealDouble; + +diff --git a/CGAL_Core/include/CGAL/CORE/MemoryPool.h b/CGAL_Core/include/CGAL/CORE/MemoryPool.h +index d218a871bec5..1cfa96fa93d1 100644 +--- a/CGAL_Core/include/CGAL/CORE/MemoryPool.h ++++ b/CGAL_Core/include/CGAL/CORE/MemoryPool.h +@@ -116,7 +116,7 @@ void* MemoryPool< T, nObjects >::allocate(std::size_t) { + } + + template< class T, int nObjects > +-void MemoryPool< T, nObjects >::free(void* t) { ++void MemoryPool< T, nObjects >::free BOOST_PREVENT_MACRO_SUBSTITUTION (void* t) { + CGAL_assertion(t != 0); + if (t == 0) return; // for safety + if(blocks.empty()){ From 55adfd536b0b036e9be897723900d5aa16d0bae7 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 8 Oct 2024 11:04:15 +0200 Subject: [PATCH 09/11] ./vcpkg x-add-version --all --overwrite-version No need to bump the version, because the previous build of 6.0 failed. --- versions/c-/cgal.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/c-/cgal.json b/versions/c-/cgal.json index a5245b72b3a1bc..6ea9de5234442e 100644 --- a/versions/c-/cgal.json +++ b/versions/c-/cgal.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "f57210a9f4713a483560abd57f3a5cf19a3869f8", + "git-tree": "5ca3382e7746f5ad4aa54d700958cf06b452f124", "version": "6.0", "port-version": 0 }, From dddf4789cd06086690a04bfa8e7f8fc08ed8a485 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 8 Oct 2024 13:43:19 +0200 Subject: [PATCH 10/11] another version of the patch... hope this one will be complete --- ...L_CGAL-protect_against_macro_free-GF.patch | 137 ++++++++++++++++++ 1 file changed, 137 insertions(+) diff --git a/ports/cgal/PR-8523__CGAL_CGAL-protect_against_macro_free-GF.patch b/ports/cgal/PR-8523__CGAL_CGAL-protect_against_macro_free-GF.patch index fd82db67a81c8e..09e45a63f0727c 100644 --- a/ports/cgal/PR-8523__CGAL_CGAL-protect_against_macro_free-GF.patch +++ b/ports/cgal/PR-8523__CGAL_CGAL-protect_against_macro_free-GF.patch @@ -73,3 +73,140 @@ index d218a871bec5..1cfa96fa93d1 100644 CGAL_assertion(t != 0); if (t == 0) return; // for safety if(blocks.empty()){ + +diff --git a/BGL/include/CGAL/boost/graph/METIS/partition_dual_graph.h b/BGL/include/CGAL/boost/graph/METIS/partition_dual_graph.h +index 53f8968f86f4..9a217389d82e 100644 +--- a/BGL/include/CGAL/boost/graph/METIS/partition_dual_graph.h ++++ b/BGL/include/CGAL/boost/graph/METIS/partition_dual_graph.h +@@ -116,8 +116,8 @@ void partition_dual_graph(const TriangleMesh& tm, + delete[] eptr; + delete[] eind; + +- std::free(npart); +- std::free(epart); ++ (std::free)(npart); ++ (std::free)(epart); + } + + template +diff --git a/BGL/include/CGAL/boost/graph/METIS/partition_graph.h b/BGL/include/CGAL/boost/graph/METIS/partition_graph.h +index 08926a641169..42f8c240f011 100644 +--- a/BGL/include/CGAL/boost/graph/METIS/partition_graph.h ++++ b/BGL/include/CGAL/boost/graph/METIS/partition_graph.h +@@ -151,8 +151,8 @@ void partition_graph(const TriangleMesh& tm, + delete[] eptr; + delete[] eind; + +- std::free(npart); +- std::free(epart); ++ (std::free)(npart); ++ (std::free)(epart); + } + + template +diff --git a/CGAL_Core/include/CGAL/CORE/Impl.h b/CGAL_Core/include/CGAL/CORE/Impl.h +index 8ae4c53fe7d1..2e21aab5ac0a 100644 +--- a/CGAL_Core/include/CGAL/CORE/Impl.h ++++ b/CGAL_Core/include/CGAL/CORE/Impl.h +@@ -51,7 +51,7 @@ + CGAL_INLINE_FUNCTION void *T::operator new( size_t size) \ + { return MemoryPool::global_allocator().allocate(size); } \ + CGAL_INLINE_FUNCTION void T::operator delete( void *p, size_t ) \ +- { MemoryPool::global_allocator().free(p); } ++ { (MemoryPool::global_allocator().free)(p); } + #define CORE_MEMORY_IMPL_TEMPLATE_WITH_ONE_ARG(C) \ + template \ + CGAL_INLINE_FUNCTION void *C::operator new( size_t size) \ +diff --git a/Classification/include/CGAL/Classification/Feature/Elevation.h b/Classification/include/CGAL/Classification/Feature/Elevation.h +index 175b20b6a44e..9ea9f267cc46 100644 +--- a/Classification/include/CGAL/Classification/Feature/Elevation.h ++++ b/Classification/include/CGAL/Classification/Feature/Elevation.h +@@ -130,7 +130,7 @@ class Elevation : public Feature_base + std::nth_element (z.begin(), z.begin() + (z.size() / 10), z.end()); + dtm_x(i,j) = z[z.size() / 10]; + } +- dem.free(); ++ (dem.free)(); + + if (grid.width() * grid.height() > input.size()) + values.resize (input.size(), compressed_float(0)); +@@ -162,7 +162,7 @@ class Elevation : public Feature_base + values[*it] = v; + } + } +- dtm_x.free(); ++ (dtm_x.free)(); + + } + +diff --git a/Classification/include/CGAL/Classification/Feature/Height_above.h b/Classification/include/CGAL/Classification/Feature/Height_above.h +index b59b108c1aca..3c85d27f91e2 100644 +--- a/Classification/include/CGAL/Classification/Feature/Height_above.h ++++ b/Classification/include/CGAL/Classification/Feature/Height_above.h +@@ -100,7 +100,7 @@ class Height_above : public Feature_base + std::size_t J = grid.y(i); + values[i] = float(dtm(I,J) - get (point_map, *(input.begin() + i)).z()); + } +- dtm.free(); ++ (dtm.free)(); + } + + } +diff --git a/Classification/include/CGAL/Classification/Feature/Height_below.h b/Classification/include/CGAL/Classification/Feature/Height_below.h +index 223719341555..f71195dd3489 100644 +--- a/Classification/include/CGAL/Classification/Feature/Height_below.h ++++ b/Classification/include/CGAL/Classification/Feature/Height_below.h +@@ -100,7 +100,7 @@ class Height_below : public Feature_base + std::size_t J = grid.y(i); + values[i] = float(get (point_map, *(input.begin() + i)).z() - dtm(I,J)); + } +- dtm.free(); ++ (dtm.free)(); + } + + } +diff --git a/Classification/include/CGAL/Classification/Feature/Vertical_range.h b/Classification/include/CGAL/Classification/Feature/Vertical_range.h +index 45b9c98d3ee7..a4df1591c13f 100644 +--- a/Classification/include/CGAL/Classification/Feature/Vertical_range.h ++++ b/Classification/include/CGAL/Classification/Feature/Vertical_range.h +@@ -102,7 +102,7 @@ class Vertical_range : public Feature_base + std::size_t J = grid.y(i); + values[i] = dtm(I,J); + } +- dtm.free(); ++ (dtm.free)(); + } + + } +diff --git a/Classification/include/CGAL/Classification/Image.h b/Classification/include/CGAL/Classification/Image.h +index 084e9572764a..3bd915f0b5d7 100644 +--- a/Classification/include/CGAL/Classification/Image.h ++++ b/Classification/include/CGAL/Classification/Image.h +@@ -71,7 +71,7 @@ class Image + { + } + +- void free() ++ void free BOOST_PREVENT_MACRO_SUBSTITUTION () + { + m_raw.reset(); + m_sparse.reset(); + +diff --git a/Installation/include/CGAL/config.h b/Installation/include/CGAL/config.h +index bd5dafbf0171..92a4ac768f58 100644 +--- a/Installation/include/CGAL/config.h ++++ b/Installation/include/CGAL/config.h +@@ -37,6 +37,13 @@ + #endif + + #ifdef CGAL_INCLUDE_WINDOWS_DOT_H ++ ++#if defined(_MSC_VER) && defined(_DEBUG) ++// Include support for memory leak detection ++// This is only available in debug mode and when _CRTDBG_MAP_ALLOC is defined. ++// It will include which will redefine `malloc` and `free`. ++# define _CRTDBG_MAP_ALLOC 1 ++#endif + // Mimic users including this file which defines min max macros + // and other names leading to name clashes + #include From dd891bad51ca2f7d3abf35700f5833e149144e83 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 8 Oct 2024 13:43:31 +0200 Subject: [PATCH 11/11] ./vcpkg x-add-version --all --overwrite-version No need to bump the version, because the previous build of 6.0 failed. --- versions/c-/cgal.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/c-/cgal.json b/versions/c-/cgal.json index 6ea9de5234442e..0b9eb53014a51e 100644 --- a/versions/c-/cgal.json +++ b/versions/c-/cgal.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "5ca3382e7746f5ad4aa54d700958cf06b452f124", + "git-tree": "f1be286404a2a318493e10e1818b244e2772f2f0", "version": "6.0", "port-version": 0 },