summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac1
-rw-r--r--include/xine.h2
-rw-r--r--include/xine/attributes.h6
-rw-r--r--m4/attributes.m47
4 files changed, 15 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index c55f23a0f..653d42b3e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -468,6 +468,7 @@ CC_ATTRIBUTE_FORMAT_ARG
CC_ATTRIBUTE_DEPRECATED
CC_ATTRIBUTE_UNUSED
CC_ATTRIBUTE_MALLOC
+CC_ATTRIBUTE_WEAK
CC_ATTRIBUTE_PACKED([],
[AC_MSG_WARN([Your compiler doesn't support __attribute__((packed)); xine might not work as expected.])])
diff --git a/include/xine.h b/include/xine.h
index 19731e820..073a9facd 100644
--- a/include/xine.h
+++ b/include/xine.h
@@ -120,7 +120,7 @@ xine_t *xine_new (void) XINE_PROTECTED;
/* allow the setting of some flags before xine_init
* FIXME-ABI: this is currently GLOBAL
*/
-void xine_set_flags (xine_t *, int) XINE_PROTECTED __attribute__((weak));
+void xine_set_flags (xine_t *, int) XINE_PROTECTED XINE_WEAK;
#define XINE_FLAG_NO_WRITE_CACHE 1
/*
diff --git a/include/xine/attributes.h b/include/xine/attributes.h
index 2326dab18..544228664 100644
--- a/include/xine/attributes.h
+++ b/include/xine/attributes.h
@@ -78,6 +78,12 @@
# define XINE_DEPRECATED
#endif
+#ifdef SUPPORT_ATTRIBUTE_WEAK
+# define XINE_WEAK __attribute__((weak))
+#else
+# define XINE_WEAK
+#endif
+
#ifndef __attr_unused
# ifdef SUPPORT_ATTRIBUTE_UNUSED
# define __attr_unused __attribute__((__unused__))
diff --git a/m4/attributes.m4 b/m4/attributes.m4
index 3d9c256a0..4e613f23a 100644
--- a/m4/attributes.m4
+++ b/m4/attributes.m4
@@ -218,6 +218,13 @@ AC_DEFUN([CC_ATTRIBUTE_SENTINEL], [
[$1], [$2])
])
+AC_DEFUN([CC_ATTRIBUTE_WEAK], [
+ CC_CHECK_ATTRIBUTE(
+ [weak], ,
+ [void some_function(void *, int) __attribute__((weak));],
+ [$1], [$2])
+])
+
AC_DEFUN([CC_ATTRIBUTE_DEPRECATED], [
CC_CHECK_ATTRIBUTE(
[deprecated], ,