[Interest] rvalue references on Mac OS X 10.10 and XCode 7

Philippe philwave at gmail.com
Fri Sep 25 22:41:38 CEST 2015


In my case, I have to add libstdc++.dylib as a linker argument, else the
presence of an old static third-party library that I must use, causes some
linker error.

But __GNUC_LIBSTD__ is not defined, hence Q_COMPILER_RVALUE_REFS is
#defined.

IOW, it's possible to link with libstdc++ without the penalty of
undefining Q_COMPILER_RVALUE_REFS

Philippe

On Fri, 25 Sep 2015 12:51:29 -0700
Thiago Macieira <thiago.macieira at intel.com> wrote:

> On Friday 25 September 2015 20:55:03 Philippe wrote:
> > Why do you say so?
> > 
> > Qt defines Q_COMPILER_RVALUE_REFS
> > and I don't see this define dependent on the presence of libstdc++
> 
> Sven is right. From qcompilerdetection.h:
> 
> # if (defined(Q_CC_CLANG) || defined(Q_CC_INTEL)) && defined(Q_OS_MAC) && 
> defined(__GNUC_LIBSTD__) \
>     && ((__GNUC_LIBSTD__-0) * 100 + __GNUC_LIBSTD_MINOR__-0 <= 402)
> // Apple has not updated libstdc++ since 2007, which means it does not have
> // <initializer_list> or std::move. Let's disable these features
> #  undef Q_COMPILER_INITIALIZER_LISTS
> #  undef Q_COMPILER_RVALUE_REFS
> #  undef Q_COMPILER_REF_QUALIFIERS
> // Also disable <atomic>, since it's clearly not there
> #  undef Q_COMPILER_ATOMICS
> # endif
> 
> In other words: stop using libstdc++ on OS X.
> -- 
> Thiago Macieira - thiago.macieira (AT) intel.com
>   Software Architect - Intel Open Source Technology Center
> 
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest





More information about the Interest mailing list