gplugin/gplugin

Hide properties type on FreeBSD.
develop
2020-02-29, Elliott Sales de Andrade
412d67a92be9
Parents 757e8645d9e0
Children de7769e8d081
Hide properties type on FreeBSD.

In `perl.h`, there is:
```
#ifdef I_LIBUTIL
#include
#endif
```
and on FreeBSD, `I_LIBUTIL` is defined in Perl's `config.h`. That header does
not really appear to be necessary for Perl, but it has the side effect of
declaring a `properties` type. This is a generic name used in our code base, so
we hack around it with the preprocessor. Preferably, FreeBSD would fix that in
their Perl port in the future.
--- a/perl/gplugin-perl-plugin.h Sat Feb 29 19:32:45 2020 -0500
+++ b/perl/gplugin-perl-plugin.h Sat Feb 29 23:38:41 2020 -0500
@@ -22,12 +22,21 @@
#include <gplugin-native.h>
#define PERL_NO_GET_CONTEXT
+#ifdef __FreeBSD__
+/* On FreeBSD, perl.h includes libutil.h (which doesn't appear necessary), and
+ * that defines some generic 'properties' type. So use the preprocessor to hide
+ * that name. */
+#define properties freebsd_properties
+#endif
#include <EXTERN.h>
#include <perl.h>
/* perl define's _() to something completely different that we don't use. So
* we undef it so that we can use it for gettext.
*/
#undef _
+#ifdef __FreeBSD__
+#undef properties
+#endif
G_BEGIN_DECLS