[PATCH 3/4] xmms - Fix inline linking problems with old glib

Timothy B. Terriberry tterribe at xiph.org
Thu Feb 7 12:28:39 PST 2013


f0296255 switched to --std=c99 by default, but old glib relies on
 the pre-C99 extern inline rules.
Override G_INLINE_FUNC for it to avoid multiple definition linker
 errors.
---
 src/plugin_xmms/charset.c   | 4 +---
 src/plugin_xmms/configure.c | 4 +---
 src/plugin_xmms/fileinfo.c  | 4 +---
 src/plugin_xmms/http.c      | 5 +----
 src/plugin_xmms/plugin.c    | 4 +---
 src/plugin_xmms/plugin.h    | 8 ++++++++
 src/plugin_xmms/tag.c       | 4 +---
 7 files changed, 14 insertions(+), 19 deletions(-)

diff --git a/src/plugin_xmms/charset.c b/src/plugin_xmms/charset.c
index d2d39e9..2c5167f 100644
--- a/src/plugin_xmms/charset.c
+++ b/src/plugin_xmms/charset.c
@@ -20,9 +20,7 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-#if HAVE_CONFIG_H
-#  include <config.h>
-#endif
+#include "plugin.h"
 
 #include <stdlib.h>
 #include <glib.h>
diff --git a/src/plugin_xmms/configure.c b/src/plugin_xmms/configure.c
index af57f52..6b83435 100644
--- a/src/plugin_xmms/configure.c
+++ b/src/plugin_xmms/configure.c
@@ -21,9 +21,7 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-#if HAVE_CONFIG_H
-#  include <config.h>
-#endif
+#include "plugin.h"
 
 #include <stdlib.h>
 #include <string.h>
diff --git a/src/plugin_xmms/fileinfo.c b/src/plugin_xmms/fileinfo.c
index 392a128..e5e5fb1 100644
--- a/src/plugin_xmms/fileinfo.c
+++ b/src/plugin_xmms/fileinfo.c
@@ -18,9 +18,7 @@
  *  with this program; if not, write to the Free Software Foundation, Inc.,
  */
 
-#if HAVE_CONFIG_H
-#  include <config.h>
-#endif
+#include "plugin.h"
 
 #include <stdlib.h>
 #include <string.h> /* for strlen() */
diff --git a/src/plugin_xmms/http.c b/src/plugin_xmms/http.c
index 44c9ce9..ce06447 100644
--- a/src/plugin_xmms/http.c
+++ b/src/plugin_xmms/http.c
@@ -17,9 +17,7 @@
  */
 /* modified for FLAC support by Steven Richman (2003) */
 
-#if HAVE_CONFIG_H
-#  include <config.h>
-#endif
+#include "plugin.h"
 
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -44,7 +42,6 @@
 #include "FLAC/format.h"
 #include "configure.h"
 #include "locale_hack.h"
-#include "plugin.h"
 
 /* on FreeBSD we get socklen_t from <sys/socket.h> */
 #if (!defined HAVE_SOCKLEN_T) && !defined(__FreeBSD__)
diff --git a/src/plugin_xmms/plugin.c b/src/plugin_xmms/plugin.c
index 32ad733..85147cf 100644
--- a/src/plugin_xmms/plugin.c
+++ b/src/plugin_xmms/plugin.c
@@ -16,9 +16,7 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-#if HAVE_CONFIG_H
-#  include <config.h>
-#endif
+#include "plugin.h"
 
 #include <limits.h>
 #include <pthread.h>
diff --git a/src/plugin_xmms/plugin.h b/src/plugin_xmms/plugin.h
index e17cb1c..858a874 100644
--- a/src/plugin_xmms/plugin.h
+++ b/src/plugin_xmms/plugin.h
@@ -19,6 +19,14 @@
 #ifndef FLAC__PLUGIN_XMMS__PLUGIN_H
 #define FLAC__PLUGIN_XMMS__PLUGIN_H
 
+#if HAVE_CONFIG_H
+#  include <config.h>
+#endif
+
+#if defined(__GNUC_STDC_INLINE__)
+#  define G_INLINE_FUNC extern inline __attribute__((gnu_inline))
+#endif
+
 void set_track_info(const char* title, int length_in_msec);
 
 #endif
diff --git a/src/plugin_xmms/tag.c b/src/plugin_xmms/tag.c
index 938cde8..3012d4d 100644
--- a/src/plugin_xmms/tag.c
+++ b/src/plugin_xmms/tag.c
@@ -19,9 +19,7 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-#if HAVE_CONFIG_H
-#  include <config.h>
-#endif
+#include "plugin.h"
 
 #include <stdlib.h>
 #include <string.h>
-- 
1.7.12


--------------040009050609040409090503--


More information about the flac-dev mailing list