forked from mxe/mxe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pcl-1-fixes.patch
122 lines (110 loc) · 4.84 KB
/
pcl-1-fixes.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
This file is part of MXE. See LICENSE.md for licensing information.
Contains ad hoc patches for cross building.
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Tony Theodore <tonyt@logyst.com>
Date: Wed, 27 Feb 2019 00:55:49 +1100
Subject: [PATCH 1/1] mingw fixes
From: kirill Okhotnikov <kirill.okhotnikov@gmail.com>
Date: Mon, 3 Jan 2022 02:40:22 +0100
Subject: [PATCH 1/1] Fixes eigen 3.4.0 compatibility.
diff --git a/common/include/pcl/pcl_macros.h b/common/include/pcl/pcl_macros.h
index 1111111..2222222 100644
--- a/common/include/pcl/pcl_macros.h
+++ b/common/include/pcl/pcl_macros.h
@@ -412,7 +412,7 @@ aligned_malloc (size_t size)
ptr = 0;
#elif defined (HAVE_MM_MALLOC)
ptr = _mm_malloc (size, 16);
-#elif defined (_MSC_VER)
+#elif defined (_WIN32)
ptr = _aligned_malloc (size, 16);
#elif defined (ANDROID)
ptr = memalign (16, size);
@@ -430,7 +430,7 @@ aligned_free (void* ptr)
std::free (ptr);
#elif defined (HAVE_MM_MALLOC)
_mm_free (ptr);
-#elif defined (_MSC_VER)
+#elif defined (_WIN32)
_aligned_free (ptr);
#elif defined (ANDROID)
free (ptr);
diff --git a/io/include/pcl/io/low_level_io.h b/io/include/pcl/io/low_level_io.h
index 1111111..2222222 100644
--- a/io/include/pcl/io/low_level_io.h
+++ b/io/include/pcl/io/low_level_io.h
@@ -52,8 +52,7 @@
# endif
# include <io.h>
# include <windows.h>
-# include <BaseTsd.h>
-typedef SSIZE_T ssize_t;
+# include <basetsd.h>
#else
# include <unistd.h>
# include <sys/mman.h>
diff --git a/surface/CMakeLists.txt b/surface/CMakeLists.txt
index 1111111..2222222 100644
--- a/surface/CMakeLists.txt
+++ b/surface/CMakeLists.txt
@@ -181,4 +181,7 @@ if(build)
if(WIN32)
target_link_libraries("${LIB_NAME}" Rpcrt4.lib)
endif(WIN32)
+ if(MINGW)
+ add_definitions(-Wa,-mbig-obj)
+ endif(MINGW)
endif(build)
diff --git a/filters/include/pcl/filters/impl/frustum_culling.hpp b/filters/include/pcl/filters/impl/frustum_culling.hpp
index 1111111..2222222 100644
--- a/filters/include/pcl/filters/impl/frustum_culling.hpp
+++ b/filters/include/pcl/filters/impl/frustum_culling.hpp
@@ -109,12 +109,12 @@ pcl::FrustumCulling<PointT>::applyFilter (std::vector<int> &indices)
Eigen::Vector3f np_bl (np_c - (up * np_h / 2) - (right * np_w / 2)); // Bottom left corner of the near plane
Eigen::Vector3f np_br (np_c - (up * np_h / 2) + (right * np_w / 2)); // Bottom right corner of the near plane
- pl_f.block (0, 0, 3, 1).matrix () = (fp_bl - fp_br).cross (fp_tr - fp_br); // Far plane equation - cross product of the
- pl_f (3) = -fp_c.dot (pl_f.block (0, 0, 3, 1)); // perpendicular edges of the far plane
-
- pl_n.block (0, 0, 3, 1).matrix () = (np_tr - np_br).cross (np_bl - np_br); // Near plane equation - cross product of the
- pl_n (3) = -np_c.dot (pl_n.block (0, 0, 3, 1)); // perpendicular edges of the far plane
+ pl_f.head<3> () = (fp_bl - fp_br).cross (fp_tr - fp_br); // Far plane equation - cross product of the
+ pl_f (3) = -fp_c.dot (pl_f.head<3> ()); // perpendicular edges of the far plane
+ pl_n.head<3> () = (np_tr - np_br).cross (np_bl - np_br); // Near plane equation - cross product of the
+ pl_n (3) = -np_c.dot (pl_n.head<3> ()); // perpendicular edges of the far plane
+
Eigen::Vector3f a (fp_bl - T); // Vector connecting the camera and far plane bottom left
Eigen::Vector3f b (fp_br - T); // Vector connecting the camera and far plane bottom right
Eigen::Vector3f c (fp_tr - T); // Vector connecting the camera and far plane top right
@@ -133,15 +133,15 @@ pcl::FrustumCulling<PointT>::applyFilter (std::vector<int> &indices)
// T
//
- pl_r.block (0, 0, 3, 1).matrix () = b.cross (c);
- pl_l.block (0, 0, 3, 1).matrix () = d.cross (a);
- pl_t.block (0, 0, 3, 1).matrix () = c.cross (d);
- pl_b.block (0, 0, 3, 1).matrix () = a.cross (b);
+ pl_r.head<3> () = b.cross (c);
+ pl_l.head<3> () = d.cross (a);
+ pl_t.head<3> () = c.cross (d);
+ pl_b.head<3> () = a.cross (b);
- pl_r (3) = -T.dot (pl_r.block (0, 0, 3, 1));
- pl_l (3) = -T.dot (pl_l.block (0, 0, 3, 1));
- pl_t (3) = -T.dot (pl_t.block (0, 0, 3, 1));
- pl_b (3) = -T.dot (pl_b.block (0, 0, 3, 1));
+ pl_r (3) = -T.dot (pl_r.head<3> ());
+ pl_l (3) = -T.dot (pl_l.head<3> ());
+ pl_t (3) = -T.dot (pl_t.head<3> ());
+ pl_b (3) = -T.dot (pl_b.head<3> ());
if (extract_removed_indices_)
{
diff --git a/segmentation/CMakeLists.txt b/segmentation/CMakeLists.txt
index 1111111..2222222 100644
--- a/segmentation/CMakeLists.txt
+++ b/segmentation/CMakeLists.txt
@@ -130,6 +130,9 @@ if(build)
# Install include files
PCL_ADD_INCLUDES("${SUBSYS_NAME}" "${SUBSYS_NAME}" ${incs})
PCL_ADD_INCLUDES("${SUBSYS_NAME}" "${SUBSYS_NAME}/impl" ${impl_incs})
+ if(MINGW)
+ add_definitions(-Wa,-mbig-obj)
+ endif(MINGW)
endif(build)