Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove malloc header to restore builds on BSDs #2374

Merged
merged 1 commit into from
Jul 9, 2018
Merged

Remove malloc header to restore builds on BSDs #2374

merged 1 commit into from
Jul 9, 2018

Conversation

jbeich
Copy link
Contributor

@jbeich jbeich commented Jul 9, 2018

<malloc.h> is unusable on FreeBSD, DragonFly, OpenBSD. On FreeBSD non-POSIX malloc extensions are in <malloc_np.h>. CC @yurivict per downstream hack.

Let's backport the upstream fix.

In file included from common/src/fft/kiss_fft.c:16:
In file included from common/include/pcl/common/fft/_kiss_fft_guts.h:19:
In file included from common/include/pcl/common/fft/kiss_fft.h:10:
/usr/include/malloc.h:3:2: error: "<malloc.h> has been replaced by <stdlib.h>"
 #error "<malloc.h> has been replaced by <stdlib.h>"
  ^

https://sourceforge.net/p/kissfft/code/ci/1a954c8a18b21b512c05b020d57f18d907ea412f/
@taketwo
Copy link
Member

taketwo commented Jul 9, 2018

The commit you referenced adds "stdlib.h" include instead. Is this not necessary?

@jbeich
Copy link
Contributor Author

jbeich commented Jul 9, 2018

Which commit? kiss_fft.h already has <stdlib.h> both in pcl and upstream.

@taketwo
Copy link
Member

taketwo commented Jul 9, 2018

I'm talking about the "downstream link" you provided, which adds the following patch:

--- common/include/pcl/common/fft/kiss_fft.h.orig	2017-08-08 06:04:14 UTC
+++ common/include/pcl/common/fft/kiss_fft.h
@@ -7,7 +7,7 @@
 #include <string.h>
 
 #if !defined(__APPLE__)
-#include <malloc.h>
+#include <stdlib.h>
 #endif
 
#include <pcl/pcl_exports.h>

But you are right, in fact "stdlib.h" is already included, I overlooked that.

@taketwo taketwo merged commit b0b7fa4 into PointCloudLibrary:master Jul 9, 2018
@SergioRAgostinho SergioRAgostinho changed the title Unbreak build on BSDs Remove malloc header to restore builds on BSDs Aug 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants