compat: wrap math.h to avoid AIX-specific clashes
authorLuca Barbato <lu_zero@gentoo.org>
Thu, 4 Jul 2013 19:53:08 +0000 (21:53 +0200)
committerLuca Barbato <lu_zero@gentoo.org>
Thu, 4 Jul 2013 19:54:32 +0000 (21:54 +0200)
AIX defines a class() function in its math.h header without any
guard.

compat/aix/math.h [new file with mode: 0644]
configure

diff --git a/compat/aix/math.h b/compat/aix/math.h
new file mode 100644 (file)
index 0000000..7c8134c
--- /dev/null
@@ -0,0 +1,14 @@
+/*
+ * Workaround aix-specific class() function clashing with libav class usage
+ */
+
+#ifndef COMPAT_AIX_MATH_H
+#define COMPAT_AIX_MATH_H
+
+#define class class_in_math_h_causes_problems
+
+#include_next <math.h>
+
+#undef class
+
+#endif /* COMPAT_AIX_MATH_H */
index db591e883616dc2a9b1e6292aed5418b54786d61..e1edbe6996926a17a65b984c2591ed5acb939ce7 100755 (executable)
--- a/configure
+++ b/configure
@@ -3049,6 +3049,9 @@ enabled spic && enable_weak pic
 
 # OS specific
 case $target_os in
+    aix)
+        add_cppflags '-I\$(SRC_PATH)/compat/aix'
+        ;;
     haiku)
         prefix_default="/boot/common"
         network_extralibs="-lnetwork"