From e5d3dcc188439321e129406cb14a51e60a19b727 Mon Sep 17 00:00:00 2001
From: Jonathan Nieder <jrnieder@gmail.com>
Date: Fri, 7 May 2010 13:37:16 -0500
Subject: Qt3 Support headers: Avoid warnings from mingw g++
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

q3textstream.h and q3cstring.h include some functions declared
Q_COMPAT_EXPORT inline, which doesn’t make much sense.  It probably
makes sense to keep exporting them for backward compatibility, but there
is no reason to import them, as gcc notices:

  q3cstring.h:164: warning: inline function 'bool operator==(const
  Q3CString&, const Q3CString&)' declared as  dllimport: attribute
  ignored

This is analogous to the case of Q_GUI_EXPORT_INLINE, which is already
handled in qglobal.h.

Reviewed-By: Thierry
---
 src/corelib/global/qglobal.h       |  7 ++++++
 src/qt3support/text/q3textstream.h |  6 ++---
 src/qt3support/tools/q3cstring.h   | 50 +++++++++++++++++++-------------------
 3 files changed, 35 insertions(+), 28 deletions(-)

diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index dd8e6ca..924142a 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -1361,15 +1361,22 @@ class QDataStream;
 #    else
 #      define Q_GUI_EXPORT_INLINE inline
 #    endif
+#    if defined(QT_BUILD_COMPAT_LIB)
+#      define Q_COMPAT_EXPORT_INLINE Q_COMPAT_EXPORT inline
+#    else
+#      define Q_COMPAT_EXPORT_INLINE inline
+#    endif
 #elif defined(Q_CC_RVCT)
 // we force RVCT not to export inlines by passing --visibility_inlines_hidden
 // so we need to just inline it, rather than exporting and inlining
 // note: this affects the contents of the DEF files (ie. these functions do not appear)
 #    define Q_CORE_EXPORT_INLINE inline
 #    define Q_GUI_EXPORT_INLINE inline
+#    define Q_COMPAT_EXPORT_INLINE inline
 #else
 #    define Q_CORE_EXPORT_INLINE Q_CORE_EXPORT inline
 #    define Q_GUI_EXPORT_INLINE Q_GUI_EXPORT inline
+#    define Q_COMPAT_EXPORT_INLINE Q_COMPAT_EXPORT inline
 #endif
 
 /*
diff --git a/src/qt3support/text/q3textstream.h b/src/qt3support/text/q3textstream.h
index d0c4f48..0e26e08 100644
--- a/src/qt3support/text/q3textstream.h
+++ b/src/qt3support/text/q3textstream.h
@@ -272,13 +272,13 @@ private:
     int	   arg;					// member function argument
 };
 
-Q_COMPAT_EXPORT inline Q3TextStream &operator>>( Q3TextStream &s, Q3TSFUNC f )
+Q_COMPAT_EXPORT_INLINE Q3TextStream &operator>>( Q3TextStream &s, Q3TSFUNC f )
 { return (*f)( s ); }
 
-Q_COMPAT_EXPORT inline Q3TextStream &operator<<( Q3TextStream &s, Q3TSFUNC f )
+Q_COMPAT_EXPORT_INLINE Q3TextStream &operator<<( Q3TextStream &s, Q3TSFUNC f )
 { return (*f)( s ); }
 
-Q_COMPAT_EXPORT inline Q3TextStream &operator<<( Q3TextStream &s, Q3TSManip m )
+Q_COMPAT_EXPORT_INLINE Q3TextStream &operator<<( Q3TextStream &s, Q3TSManip m )
 { m.exec(s); return s; }
 
 Q_COMPAT_EXPORT Q3TextStream &bin( Q3TextStream &s );	// set bin notation
diff --git a/src/qt3support/tools/q3cstring.h b/src/qt3support/tools/q3cstring.h
index b280ebc..86a31fa 100644
--- a/src/qt3support/tools/q3cstring.h
+++ b/src/qt3support/tools/q3cstring.h
@@ -161,75 +161,75 @@ inline Q3CString &Q3CString::setNum(float n, char f, int prec)
   Q3CString non-member operators
  *****************************************************************************/
 
-Q_COMPAT_EXPORT inline bool operator==(const Q3CString &s1, const Q3CString &s2)
+Q_COMPAT_EXPORT_INLINE bool operator==(const Q3CString &s1, const Q3CString &s2)
 { return qstrcmp(s1, s2) == 0; }
 
-Q_COMPAT_EXPORT inline bool operator==(const Q3CString &s1, const char *s2)
+Q_COMPAT_EXPORT_INLINE bool operator==(const Q3CString &s1, const char *s2)
 { return qstrcmp(s1, s2) == 0; }
 
-Q_COMPAT_EXPORT inline bool operator==(const char *s1, const Q3CString &s2)
+Q_COMPAT_EXPORT_INLINE bool operator==(const char *s1, const Q3CString &s2)
 { return qstrcmp(s1, s2) == 0; }
 
-Q_COMPAT_EXPORT inline bool operator!=(const Q3CString &s1, const Q3CString &s2)
+Q_COMPAT_EXPORT_INLINE bool operator!=(const Q3CString &s1, const Q3CString &s2)
 { return qstrcmp(s1, s2) != 0; }
 
-Q_COMPAT_EXPORT inline bool operator!=(const Q3CString &s1, const char *s2)
+Q_COMPAT_EXPORT_INLINE bool operator!=(const Q3CString &s1, const char *s2)
 { return qstrcmp(s1, s2) != 0; }
 
-Q_COMPAT_EXPORT inline bool operator!=(const char *s1, const Q3CString &s2)
+Q_COMPAT_EXPORT_INLINE bool operator!=(const char *s1, const Q3CString &s2)
 { return qstrcmp(s1, s2) != 0; }
 
-Q_COMPAT_EXPORT inline bool operator<(const Q3CString &s1, const Q3CString& s2)
+Q_COMPAT_EXPORT_INLINE bool operator<(const Q3CString &s1, const Q3CString& s2)
 { return qstrcmp(s1, s2) < 0; }
 
-Q_COMPAT_EXPORT inline bool operator<(const Q3CString &s1, const char *s2)
+Q_COMPAT_EXPORT_INLINE bool operator<(const Q3CString &s1, const char *s2)
 { return qstrcmp(s1, s2) < 0; }
 
-Q_COMPAT_EXPORT inline bool operator<(const char *s1, const Q3CString &s2)
+Q_COMPAT_EXPORT_INLINE bool operator<(const char *s1, const Q3CString &s2)
 { return qstrcmp(s1, s2) < 0; }
 
-Q_COMPAT_EXPORT inline bool operator<=(const Q3CString &s1, const Q3CString &s2)
+Q_COMPAT_EXPORT_INLINE bool operator<=(const Q3CString &s1, const Q3CString &s2)
 { return qstrcmp(s1, s2) <= 0; }
 
-Q_COMPAT_EXPORT inline bool operator<=(const Q3CString &s1, const char *s2)
+Q_COMPAT_EXPORT_INLINE bool operator<=(const Q3CString &s1, const char *s2)
 { return qstrcmp(s1, s2) <= 0; }
 
-Q_COMPAT_EXPORT inline bool operator<=(const char *s1, const Q3CString &s2)
+Q_COMPAT_EXPORT_INLINE bool operator<=(const char *s1, const Q3CString &s2)
 { return qstrcmp(s1, s2) <= 0; }
 
-Q_COMPAT_EXPORT inline bool operator>(const Q3CString &s1, const Q3CString &s2)
+Q_COMPAT_EXPORT_INLINE bool operator>(const Q3CString &s1, const Q3CString &s2)
 { return qstrcmp(s1, s2) > 0; }
 
-Q_COMPAT_EXPORT inline bool operator>(const Q3CString &s1, const char *s2)
+Q_COMPAT_EXPORT_INLINE bool operator>(const Q3CString &s1, const char *s2)
 { return qstrcmp(s1, s2) > 0; }
 
-Q_COMPAT_EXPORT inline bool operator>(const char *s1, const Q3CString &s2)
+Q_COMPAT_EXPORT_INLINE bool operator>(const char *s1, const Q3CString &s2)
 { return qstrcmp(s1, s2) > 0; }
 
-Q_COMPAT_EXPORT inline bool operator>=(const Q3CString &s1, const Q3CString& s2)
+Q_COMPAT_EXPORT_INLINE bool operator>=(const Q3CString &s1, const Q3CString& s2)
 { return qstrcmp(s1, s2) >= 0; }
 
-Q_COMPAT_EXPORT inline bool operator>=(const Q3CString &s1, const char *s2)
+Q_COMPAT_EXPORT_INLINE bool operator>=(const Q3CString &s1, const char *s2)
 { return qstrcmp(s1, s2) >= 0; }
 
-Q_COMPAT_EXPORT inline bool operator>=(const char *s1, const Q3CString &s2)
+Q_COMPAT_EXPORT_INLINE bool operator>=(const char *s1, const Q3CString &s2)
 { return qstrcmp(s1, s2) >= 0; }
 
-Q_COMPAT_EXPORT inline const Q3CString operator+(const Q3CString &s1,
+Q_COMPAT_EXPORT_INLINE const Q3CString operator+(const Q3CString &s1,
                                           const Q3CString &s2)
 {
     Q3CString tmp(s1);
     tmp += s2;
     return tmp;
 }
-Q_COMPAT_EXPORT inline const Q3CString operator+(const Q3CString &s1,
+Q_COMPAT_EXPORT_INLINE const Q3CString operator+(const Q3CString &s1,
                                           const QByteArray &s2)
 {
     QByteArray tmp(s1);
     tmp += s2;
     return tmp;
 }
-Q_COMPAT_EXPORT inline const Q3CString operator+(const QByteArray &s1,
+Q_COMPAT_EXPORT_INLINE const Q3CString operator+(const QByteArray &s1,
                                           const Q3CString &s2)
 {
     QByteArray tmp(s1);
@@ -237,28 +237,28 @@ Q_COMPAT_EXPORT inline const Q3CString operator+(const QByteArray &s1,
     return tmp;
 }
 
-Q_COMPAT_EXPORT inline const Q3CString operator+(const Q3CString &s1, const char *s2)
+Q_COMPAT_EXPORT_INLINE const Q3CString operator+(const Q3CString &s1, const char *s2)
 {
     Q3CString tmp(s1);
     tmp += s2;
     return tmp;
 }
 
-Q_COMPAT_EXPORT inline const Q3CString operator+(const char *s1, const Q3CString &s2)
+Q_COMPAT_EXPORT_INLINE const Q3CString operator+(const char *s1, const Q3CString &s2)
 {
     Q3CString tmp(s1);
     tmp += s2;
     return tmp;
 }
 
-Q_COMPAT_EXPORT inline const Q3CString operator+(const Q3CString &s1, char c2)
+Q_COMPAT_EXPORT_INLINE const Q3CString operator+(const Q3CString &s1, char c2)
 {
     Q3CString tmp(s1);
     tmp += c2;
     return tmp;
 }
 
-Q_COMPAT_EXPORT inline const Q3CString operator+(char c1, const Q3CString &s2)
+Q_COMPAT_EXPORT_INLINE const Q3CString operator+(char c1, const Q3CString &s2)
 {
     Q3CString tmp;
     tmp += c1;
-- 
cgit v0.12