From e10e8aab78cd70edc606b475d7feca2f0845f780 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 27 Apr 2011 12:34:56 +0200 Subject: Use QtCore prefix when including Qt headers This appears to be more portable. For example, on Mac OS X with -framework QtCore option include does not work while including does. --- m4/libqt.m4 | 41 ++++++++++++++++++++++++--- odb/qt/basic/mysql/default-mapping.hxx | 4 +-- odb/qt/basic/mysql/qbyte-array-traits.hxx | 2 +- odb/qt/basic/mysql/qstring-traits.hxx | 2 +- odb/qt/basic/sqlite/default-mapping.hxx | 4 +-- odb/qt/basic/sqlite/qbyte-array-traits.hxx | 2 +- odb/qt/basic/sqlite/qstring-traits.hxx | 2 +- odb/qt/containers/qhash-traits.hxx | 4 +-- odb/qt/containers/qlinked-list-traits.hxx | 2 +- odb/qt/containers/qlist-traits.hxx | 2 +- odb/qt/containers/qmap-traits.hxx | 4 +-- odb/qt/containers/qset-traits.hxx | 2 +- odb/qt/containers/qvector-traits.hxx | 2 +- odb/qt/date-time/mysql/default-mapping.hxx | 6 ++-- odb/qt/date-time/mysql/qdate-time-traits.hxx | 2 +- odb/qt/date-time/mysql/qdate-traits.hxx | 2 +- odb/qt/date-time/mysql/qtime-traits.hxx | 2 +- odb/qt/date-time/sqlite/default-mapping.hxx | 6 ++-- odb/qt/date-time/sqlite/qdate-time-traits.hxx | 2 +- odb/qt/date-time/sqlite/qdate-traits.hxx | 2 +- odb/qt/date-time/sqlite/qtime-traits.hxx | 2 +- odb/qt/smart-ptr.options | 2 +- odb/qt/smart-ptr/lazy-ptr.hxx | 6 ++-- odb/qt/smart-ptr/pointer-traits.hxx | 4 +-- 24 files changed, 71 insertions(+), 38 deletions(-) diff --git a/m4/libqt.m4 b/m4/libqt.m4 index 2ab8272..bb7ffa5 100644 --- a/m4/libqt.m4 +++ b/m4/libqt.m4 @@ -20,7 +20,7 @@ AC_MSG_CHECKING([for QtCore]) CXX_LIBTOOL_LINK_IFELSE( AC_LANG_SOURCE([[ #include -#include +#include int main () @@ -44,7 +44,7 @@ if test x"$libqt_found" = xno; then CXX_LIBTOOL_LINK_IFELSE( AC_LANG_SOURCE([[ #include -#include +#include int main () @@ -63,6 +63,39 @@ libqt_found=yes fi fi +# Try framework in case we are on Mac OS X. +# +if test x"$libqt_found" = xno; then + + save_CPPFLAGS="$CPPFLAGS" + save_LIBS="$LIBS" + + CPPFLAGS="$CPPFLAGS -framework QtCore" + LIBS="-framework QtCore $LIBS" + + CXX_LIBTOOL_LINK_IFELSE( +AC_LANG_SOURCE([[ +#include +#include + +int +main () +{ + QString qs ("test"); + std::string ss (qs.toStdString ()); + return ss.size () != 0; +} +]]), +[ +libqt_found=yes +]) + + if test x"$libqt_found" = xno; then + CPPFLAGS="$save_CPPFLAGS" + LIBS="$save_LIBS" + fi +fi + # If QtCore is not found, try its versioned variant, QtCore4. # if test x"$libqt_found" = xno; then @@ -73,7 +106,7 @@ if test x"$libqt_found" = xno; then CXX_LIBTOOL_LINK_IFELSE( AC_LANG_SOURCE([[ #include -#include +#include int main () @@ -111,7 +144,7 @@ if test x"$libqt_found" = xno; then CXX_LIBTOOL_LINK_IFELSE( AC_LANG_SOURCE([[ #include -#include +#include int main () diff --git a/odb/qt/basic/mysql/default-mapping.hxx b/odb/qt/basic/mysql/default-mapping.hxx index 8ffcafe..d111a08 100644 --- a/odb/qt/basic/mysql/default-mapping.hxx +++ b/odb/qt/basic/mysql/default-mapping.hxx @@ -6,8 +6,8 @@ #ifndef ODB_QT_BASIC_MYSQL_DEFAULT_MAPPING_HXX #define ODB_QT_BASIC_MYSQL_DEFAULT_MAPPING_HXX -#include -#include +#include +#include // By default, map QString to MySQL TEXT for non-id and to VARCHAR(256) for // id members. MySQL cannot have primary keys of the TEXT type. diff --git a/odb/qt/basic/mysql/qbyte-array-traits.hxx b/odb/qt/basic/mysql/qbyte-array-traits.hxx index 0c1a5b8..52e620c 100644 --- a/odb/qt/basic/mysql/qbyte-array-traits.hxx +++ b/odb/qt/basic/mysql/qbyte-array-traits.hxx @@ -11,7 +11,7 @@ #include // std::memcpy #include // std::size_t -#include +#include #include #include diff --git a/odb/qt/basic/mysql/qstring-traits.hxx b/odb/qt/basic/mysql/qstring-traits.hxx index 17f0946..922c4c3 100644 --- a/odb/qt/basic/mysql/qstring-traits.hxx +++ b/odb/qt/basic/mysql/qstring-traits.hxx @@ -11,7 +11,7 @@ #include // std::memcpy #include // std::size_t -#include +#include #include #include diff --git a/odb/qt/basic/sqlite/default-mapping.hxx b/odb/qt/basic/sqlite/default-mapping.hxx index 7211700..cc04ddd 100644 --- a/odb/qt/basic/sqlite/default-mapping.hxx +++ b/odb/qt/basic/sqlite/default-mapping.hxx @@ -6,8 +6,8 @@ #ifndef ODB_QT_BASIC_SQLITE_DEFAULT_MAPPING_HXX #define ODB_QT_BASIC_SQLITE_DEFAULT_MAPPING_HXX -#include -#include +#include +#include // Map QString to SQLite TEXT by default. Allow NULL values by default as // QString provides a null representation. diff --git a/odb/qt/basic/sqlite/qbyte-array-traits.hxx b/odb/qt/basic/sqlite/qbyte-array-traits.hxx index 0ab4835..0d1437e 100644 --- a/odb/qt/basic/sqlite/qbyte-array-traits.hxx +++ b/odb/qt/basic/sqlite/qbyte-array-traits.hxx @@ -11,7 +11,7 @@ #include // std::memcpy #include // std::size_t -#include +#include #include #include diff --git a/odb/qt/basic/sqlite/qstring-traits.hxx b/odb/qt/basic/sqlite/qstring-traits.hxx index 53c4be4..5014aaf 100644 --- a/odb/qt/basic/sqlite/qstring-traits.hxx +++ b/odb/qt/basic/sqlite/qstring-traits.hxx @@ -11,7 +11,7 @@ #include // std::memcpy #include // std::size_t -#include +#include #include #include diff --git a/odb/qt/containers/qhash-traits.hxx b/odb/qt/containers/qhash-traits.hxx index c34b768..b215a16 100644 --- a/odb/qt/containers/qhash-traits.hxx +++ b/odb/qt/containers/qhash-traits.hxx @@ -8,8 +8,8 @@ #include -#include -#include +#include +#include #include diff --git a/odb/qt/containers/qlinked-list-traits.hxx b/odb/qt/containers/qlinked-list-traits.hxx index 708e240..454079c 100644 --- a/odb/qt/containers/qlinked-list-traits.hxx +++ b/odb/qt/containers/qlinked-list-traits.hxx @@ -8,7 +8,7 @@ #include -#include +#include #include diff --git a/odb/qt/containers/qlist-traits.hxx b/odb/qt/containers/qlist-traits.hxx index 9ac7cbf..e2c4c80 100644 --- a/odb/qt/containers/qlist-traits.hxx +++ b/odb/qt/containers/qlist-traits.hxx @@ -8,7 +8,7 @@ #include -#include +#include #include diff --git a/odb/qt/containers/qmap-traits.hxx b/odb/qt/containers/qmap-traits.hxx index 854dc87..c94c912 100644 --- a/odb/qt/containers/qmap-traits.hxx +++ b/odb/qt/containers/qmap-traits.hxx @@ -8,8 +8,8 @@ #include -#include -#include +#include +#include #include diff --git a/odb/qt/containers/qset-traits.hxx b/odb/qt/containers/qset-traits.hxx index 13216b9..3e21b95 100644 --- a/odb/qt/containers/qset-traits.hxx +++ b/odb/qt/containers/qset-traits.hxx @@ -8,7 +8,7 @@ #include -#include +#include #include diff --git a/odb/qt/containers/qvector-traits.hxx b/odb/qt/containers/qvector-traits.hxx index c86aa01..eebe5e1 100644 --- a/odb/qt/containers/qvector-traits.hxx +++ b/odb/qt/containers/qvector-traits.hxx @@ -8,7 +8,7 @@ #include -#include +#include #include diff --git a/odb/qt/date-time/mysql/default-mapping.hxx b/odb/qt/date-time/mysql/default-mapping.hxx index fa0b823..250d668 100644 --- a/odb/qt/date-time/mysql/default-mapping.hxx +++ b/odb/qt/date-time/mysql/default-mapping.hxx @@ -6,9 +6,9 @@ #ifndef ODB_QT_DATE_TIME_MYSQL_DEFAULT_MAPPING_HXX #define ODB_QT_DATE_TIME_MYSQL_DEFAULT_MAPPING_HXX -#include -#include -#include +#include +#include +#include // Map QDate to MySQL DATE by default. QDate provides a null // representation so allow NULL values by default. diff --git a/odb/qt/date-time/mysql/qdate-time-traits.hxx b/odb/qt/date-time/mysql/qdate-time-traits.hxx index fcb2d79..db8840c 100644 --- a/odb/qt/date-time/mysql/qdate-time-traits.hxx +++ b/odb/qt/date-time/mysql/qdate-time-traits.hxx @@ -8,7 +8,7 @@ #include -#include +#include #include diff --git a/odb/qt/date-time/mysql/qdate-traits.hxx b/odb/qt/date-time/mysql/qdate-traits.hxx index 4f1c753..a1b3fac 100644 --- a/odb/qt/date-time/mysql/qdate-traits.hxx +++ b/odb/qt/date-time/mysql/qdate-traits.hxx @@ -8,7 +8,7 @@ #include -#include +#include #include #include diff --git a/odb/qt/date-time/mysql/qtime-traits.hxx b/odb/qt/date-time/mysql/qtime-traits.hxx index f984f1a..b90faef 100644 --- a/odb/qt/date-time/mysql/qtime-traits.hxx +++ b/odb/qt/date-time/mysql/qtime-traits.hxx @@ -8,7 +8,7 @@ #include -#include +#include #include diff --git a/odb/qt/date-time/sqlite/default-mapping.hxx b/odb/qt/date-time/sqlite/default-mapping.hxx index 82321af..e497e96 100644 --- a/odb/qt/date-time/sqlite/default-mapping.hxx +++ b/odb/qt/date-time/sqlite/default-mapping.hxx @@ -6,9 +6,9 @@ #ifndef ODB_QT_DATE_TIME_SQLITE_DEFAULT_MAPPING_HXX #define ODB_QT_DATE_TIME_SQLITE_DEFAULT_MAPPING_HXX -#include -#include -#include +#include +#include +#include // Map QDate to SQLite TEXT by default. QDate provides a null representation // so allow NULL values by default. diff --git a/odb/qt/date-time/sqlite/qdate-time-traits.hxx b/odb/qt/date-time/sqlite/qdate-time-traits.hxx index f36852f..7d34647 100644 --- a/odb/qt/date-time/sqlite/qdate-time-traits.hxx +++ b/odb/qt/date-time/sqlite/qdate-time-traits.hxx @@ -12,7 +12,7 @@ #include // std::size_t #include // std::memcpy -#include +#include #include #include diff --git a/odb/qt/date-time/sqlite/qdate-traits.hxx b/odb/qt/date-time/sqlite/qdate-traits.hxx index 7d8215b..a1d7d6c 100644 --- a/odb/qt/date-time/sqlite/qdate-traits.hxx +++ b/odb/qt/date-time/sqlite/qdate-traits.hxx @@ -12,7 +12,7 @@ #include // std::size_t #include // std::memcpy -#include +#include #include #include diff --git a/odb/qt/date-time/sqlite/qtime-traits.hxx b/odb/qt/date-time/sqlite/qtime-traits.hxx index d50332f..7c99831 100644 --- a/odb/qt/date-time/sqlite/qtime-traits.hxx +++ b/odb/qt/date-time/sqlite/qtime-traits.hxx @@ -12,7 +12,7 @@ #include // std::size_t #include // std::memcpy -#include +#include #include #include diff --git a/odb/qt/smart-ptr.options b/odb/qt/smart-ptr.options index f9de219..636b130 100644 --- a/odb/qt/smart-ptr.options +++ b/odb/qt/smart-ptr.options @@ -7,7 +7,7 @@ # Make QSharedPointer the default object pointer. # ---hxx-prologue '#include ' +--hxx-prologue '#include ' --default-pointer QSharedPointer # Include pointer traits. diff --git a/odb/qt/smart-ptr/lazy-ptr.hxx b/odb/qt/smart-ptr/lazy-ptr.hxx index 0d0e60a..e22dc3e 100644 --- a/odb/qt/smart-ptr/lazy-ptr.hxx +++ b/odb/qt/smart-ptr/lazy-ptr.hxx @@ -8,9 +8,9 @@ #include -#include -#include -#include +#include +#include +#include #include // odb::database #include diff --git a/odb/qt/smart-ptr/pointer-traits.hxx b/odb/qt/smart-ptr/pointer-traits.hxx index 488e1db..8a981ba 100644 --- a/odb/qt/smart-ptr/pointer-traits.hxx +++ b/odb/qt/smart-ptr/pointer-traits.hxx @@ -8,8 +8,8 @@ #include -#include -#include +#include +#include #include -- cgit v1.1