KDE/kdelibs/kdeui

Peter Kümmel syntheticpp at gmx.net
Sat Mar 11 12:41:01 GMT 2006


Thiago Macieira wrote:
> Christian Ehrlicher wrote:
>> We discussed this two weeks ago and came to the conclusion to write it
>> in front like Qt does. We already define KDE_DEPRECATED to
>> Q_DECL_DEPRECATED so there is no more problem with gcc version which
>> don't like it in the front.
> 
> What I failed to notice when looking at the Qt4 headers is that it doesn't 
> turn Q_DECL_DEPRECATED on by default.
> 
Don't know what you mean, Q_DECL_DEPRECATED is always defined when a deprecated
mechanism is available:

qglobal.h:

#if defined(Q_MOC_RUN)
#  define Q_DECL_DEPRECATED Q_DECL_DEPRECATED
#elif defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && (__GNUC__ - 0 > 3 || (__GNUC__ - 0 == 3 && __GNUC_MINOR__ - 0 >= 2))
#  define Q_DECL_DEPRECATED __attribute__ ((__deprecated__))
#elif defined(Q_CC_MSVC) && (_MSC_VER >= 1300)
#  define Q_DECL_DEPRECATED __declspec(deprecated)
#  if defined (Q_CC_INTEL)
#    define Q_DECL_VARIABLE_DEPRECATED
#  else
#  endif
#else
#  define Q_DECL_DEPRECATED
#endif


my problem was that kdemacros.h does not include qglobal.h so all
all the qt macros are unknown and the disabling in case of msvc
does not work:

# ifndef Q_CC_MSVC
#  define KDE_DEPRECATED Q_DECL_DEPRECATED
# else
#  define KDE_DEPRECATED
# endif

Could I add
#include <qglobal.h>
to kdemacros.h, the functionality of this file should not
be depended on files including qglobal.h

> It'll only use them if you #define QT3_SUPPORT_WARNINGS.
> 
> So I think we should say: *before* the return type and people who have 
> compilers that don't understand that must have it off (configure check?)





More information about the kde-core-devel mailing list