usage of KDE_DEPRECATED

Nicolas Goutte nicolasg at snafu.de
Wed Mar 1 11:52:06 GMT 2006


On Wednesday 01 March 2006 11:52, Thiago Macieira wrote:
> Nicolas Goutte wrote:
> >On Wednesday 01 March 2006 10:44, Luciano Montanaro wrote:
> >> On Wednesday 01 March 2006 07:46, Christian Ehrlicher wrote:
> >> > Hi,
> >> >
> >> > Can someone tell me why I need to place KDE_DEPRECATED behind the
> >> > deprecated function and why it won't work when it's written before?
> >> > Qt's deprecated-macro is placed before the function and works fine.
> >> > The problem is that msvc only allows it in front of the function and
> >> > therefore we can't use KDE_DEPRECATED for msvc...
> >>
> >> KDE_DEPRECATED expands to __attribute__((deprecated)) with gcc, which
> >> should be put after the function declaration to work. I think this
> >> limitation has been lifted for newer gcc versions, so maybe it can be
> >> put before the function declaration as for the inline function.
> >
> >If you do so, then check the gcc version and disable it for older gcc
> >versions, a gcc 3.3.1 does not allow it.
>
> #define KDE_DEPRECATED Q_DECL_DEPRECATED

If we choose to modify the KDE_DEPRECATED #define in that way, then we could 
use the attached patch (for kdemacros.h.in)

>
> and always use it in the before position. That macro already does the gcc
> 3.3 checking.
>
> If your compiler doesn't support that, you can't build Qt4 anyways, so
> it's not a problem.



Have a nice day!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kdemacros.diff
Type: text/x-diff
Size: 2582 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20060301/3ff6907d/attachment.diff>


More information about the kde-core-devel mailing list