From 417373531b083515e27868c9baa13282463beffa Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Sun, 30 Jun 2024 19:08:44 +0900 Subject: Rename kdemacros.* files to tdemacros.* A dummy 'kdemacros.h' has been added to allow TDE to built till renaming is carried out across the whole code base. It will then be removed. Signed-off-by: Michele Calgaro (cherry picked from commit 1307964495cdc9a74f7b4aabab14ad9ffaa93dd6) --- CMakeLists.txt | 2 +- interfaces/tdescript/scriptinterface.h | 2 +- interfaces/terminal/kde_terminal_interface.h | 2 +- kimgio/psd.h | 2 +- libtdemid/player.h | 2 +- networkstatus/networkstatus.cpp | 2 +- networkstatus/networkstatusindicator.h | 2 +- tdeabc/resourceselectdialog.h | 2 +- tdecore/CMakeLists.txt | 2 +- tdecore/Mainpage.dox | 2 +- tdecore/Makefile.am | 2 +- tdecore/configure.in.in | 2 +- tdecore/kdemacros.h | 1 + tdecore/kdemacros.h.cmake | 186 --------------------------- tdecore/kdemacros.h.in | 185 -------------------------- tdecore/netsupp.cpp | 2 +- tdecore/tdehw/tdestoragedevice.h | 2 +- tdecore/tdelibs_export.h | 2 +- tdecore/tdemacros.h.cmake | 186 +++++++++++++++++++++++++++ tdecore/tdemacros.h.in | 185 ++++++++++++++++++++++++++ tdehtml/css/css_base.h | 2 +- tdehtml/dom/css_value.h | 2 +- tdehtml/dom/html_form.h | 2 +- tdehtml/dom/html_image.h | 2 +- tdehtml/dom/html_object.h | 2 +- tdehtml/misc/htmlattrs.h | 2 +- tdehtml/misc/makeattrs | 2 +- tdehtml/tdehtml_part.h | 2 +- tdeio/bookmarks/kbookmarkimporter_crash.h | 2 +- tdeio/bookmarks/kbookmarkimporter_ie.h | 2 +- tdeio/bookmarks/kbookmarkimporter_ns.h | 2 +- tdeio/kssl/ksslcertchain.h | 2 +- tdeio/kssl/ksslutils.h | 2 +- tdeio/tdefile/kpropertiesdialog.h | 2 +- tdeio/tdeio/posixacladdons.cpp | 2 +- tdenewstuff/knewstuff.h | 2 +- tdeprint/kprinter.h | 2 +- tdeprint/tools/escputil/escpwidget.cpp | 2 +- tdestyles/plastik/config/plastikconf.cpp | 2 +- win/kdemacros.h | 1 - win/tdemacros.h | 1 + 41 files changed, 407 insertions(+), 406 deletions(-) create mode 100644 tdecore/kdemacros.h delete mode 100644 tdecore/kdemacros.h.cmake delete mode 100644 tdecore/kdemacros.h.in create mode 100644 tdecore/tdemacros.h.cmake create mode 100644 tdecore/tdemacros.h.in delete mode 100644 win/kdemacros.h create mode 100644 win/tdemacros.h diff --git a/CMakeLists.txt b/CMakeLists.txt index d03faf8aa..d01650535 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1400,7 +1400,7 @@ endif() ##### write configure files ##################### configure_file( config.h.cmake config.h ) -configure_file( tdecore/kdemacros.h.cmake tdecore/kdemacros.h ) +configure_file( tdecore/tdemacros.h.cmake tdecore/tdemacros.h ) configure_file( kjs/global.h.in kjs/global.h ) configure_file( tdeio/kssl/ksslconfig.h.cmake tdeio/kssl/ksslconfig.h ) configure_file( kdoctools/checkXML.cmake kdoctools/checkXML ) diff --git a/interfaces/tdescript/scriptinterface.h b/interfaces/tdescript/scriptinterface.h index 1d5ce6b97..d52c0f85a 100644 --- a/interfaces/tdescript/scriptinterface.h +++ b/interfaces/tdescript/scriptinterface.h @@ -29,7 +29,7 @@ #define __scriptinterface_h__ #include #include -#include +#include //#include class TQString; diff --git a/interfaces/terminal/kde_terminal_interface.h b/interfaces/terminal/kde_terminal_interface.h index 6b6c465b1..ff0dcb80c 100644 --- a/interfaces/terminal/kde_terminal_interface.h +++ b/interfaces/terminal/kde_terminal_interface.h @@ -22,7 +22,7 @@ class TQString; class TQStrList; -#include +#include /** * TerminalInterface is an interface implemented by KonsolePart to diff --git a/kimgio/psd.h b/kimgio/psd.h index 14733ad68..fa21bf081 100644 --- a/kimgio/psd.h +++ b/kimgio/psd.h @@ -10,7 +10,7 @@ #ifndef KIMG_PSD_H #define KIMG_PSD_H -#include +#include class TQImageIO; diff --git a/libtdemid/player.h b/libtdemid/player.h index 5a6a46a95..c0ada8b1c 100644 --- a/libtdemid/player.h +++ b/libtdemid/player.h @@ -29,7 +29,7 @@ #include #include #include -#include +#include /** * This struct stores text, lyrics and change tempo events among others. diff --git a/networkstatus/networkstatus.cpp b/networkstatus/networkstatus.cpp index 98ea086b6..7937a52d6 100644 --- a/networkstatus/networkstatus.cpp +++ b/networkstatus/networkstatus.cpp @@ -34,7 +34,7 @@ #include "network.h" #include -#include +#include extern "C" { TDE_EXPORT KDEDModule* create_networkstatus( const TQCString& obj ) diff --git a/networkstatus/networkstatusindicator.h b/networkstatus/networkstatusindicator.h index e88a41f17..e7778027e 100644 --- a/networkstatus/networkstatusindicator.h +++ b/networkstatus/networkstatusindicator.h @@ -24,7 +24,7 @@ #define KDE_NETWORKSTATUS_INDICATOR_H #include -#include +#include #include class StatusBarNetworkStatusIndicator : public TQHBox diff --git a/tdeabc/resourceselectdialog.h b/tdeabc/resourceselectdialog.h index b8df436ac..4536c7ece 100644 --- a/tdeabc/resourceselectdialog.h +++ b/tdeabc/resourceselectdialog.h @@ -24,7 +24,7 @@ #include #include -#include +#include class TDEListBox; diff --git a/tdecore/CMakeLists.txt b/tdecore/CMakeLists.txt index c794a8039..7fb7cdccf 100644 --- a/tdecore/CMakeLists.txt +++ b/tdecore/CMakeLists.txt @@ -73,7 +73,7 @@ install( FILES kmanagerselection.h kmountpoint.h kuser.h klockfile.h kidna.h ktempdir.h kshell.h fixx11h.h kxerrorhandler.h tdelibs_export.h kde_file.h ktimezones.h - ${CMAKE_CURRENT_BINARY_DIR}/kdemacros.h + ${CMAKE_CURRENT_BINARY_DIR}/tdemacros.h kdemacros.h DESTINATION ${INCLUDE_INSTALL_DIR} ) diff --git a/tdecore/Mainpage.dox b/tdecore/Mainpage.dox index c275aa84e..4a74d242a 100644 --- a/tdecore/Mainpage.dox +++ b/tdecore/Mainpage.dox @@ -37,5 +37,5 @@ Some helper utilities: @gpl */ // DOXYGEN_EXCLUDE = malloc kde_file.h -// DOXYGEN_SET_INPUT += @topdir@/kdemacros.h.cmake +// DOXYGEN_SET_INPUT += @topdir@/tdemacros.h.cmake // DOXYGEN_SET_PROJECT_NAME = TrinityCore diff --git a/tdecore/Makefile.am b/tdecore/Makefile.am index 58e74a010..1bc47e379 100644 --- a/tdecore/Makefile.am +++ b/tdecore/Makefile.am @@ -59,7 +59,7 @@ include_HEADERS = tdeconfig.h tdeconfigskeleton.h \ kcalendarsystem.h kcalendarsystemfactory.h kmacroexpander.h \ kmanagerselection.h kmountpoint.h kuser.h klockfile.h \ kidna.h ktempdir.h kshell.h fixx11h.h kxerrorhandler.h tdelibs_export.h \ - kdemacros.h kde_file.h ktimezones.h + tdemacros.h kde_file.h ktimezones.h libtdefakes_la_SOURCES = fakes.c vsnprintf.c libtdefakes_la_LDFLAGS = -version-info 6:0:2 diff --git a/tdecore/configure.in.in b/tdecore/configure.in.in index d7ef1cd08..7ecda35e7 100644 --- a/tdecore/configure.in.in +++ b/tdecore/configure.in.in @@ -169,7 +169,7 @@ AC_CHECK_HEADERS(sys/mount.h) dnl AC_OUTPUT(tdecore/tde-config.cpp) -AM_CONFIG_HEADER(tdecore/kdemacros.h) +AM_CONFIG_HEADER(tdecore/tdemacros.h) SVGICONS= diff --git a/tdecore/kdemacros.h b/tdecore/kdemacros.h new file mode 100644 index 000000000..73808c60d --- /dev/null +++ b/tdecore/kdemacros.h @@ -0,0 +1 @@ +#include diff --git a/tdecore/kdemacros.h.cmake b/tdecore/kdemacros.h.cmake deleted file mode 100644 index 1c652176a..000000000 --- a/tdecore/kdemacros.h.cmake +++ /dev/null @@ -1,186 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (c) 2002-2003 KDE Team - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef _KDE_MACROS_H_ -#define _KDE_MACROS_H_ - -/* Set by configure */ -#cmakedefine __TDE_HAVE_TDEHWLIB 1 -#cmakedefine __KDE_HAVE_GCC_VISIBILITY 1 - -/** - * The TDE_NO_EXPORT macro marks the symbol of the given variable - * to be hidden. A hidden symbol is stripped during the linking step, - * so it can't be used from outside the resulting library, which is similar - * to static. However, static limits the visibility to the current - * compilation unit. hidden symbols can still be used in multiple compilation - * units. - * - * \code - * int TDE_NO_EXPORT foo; - * int TDE_EXPORT bar; - * \end - */ - -#ifdef __KDE_HAVE_GCC_VISIBILITY -#define TDE_NO_EXPORT __attribute__ ((visibility("hidden"))) -#define TDE_EXPORT __attribute__ ((visibility("default"))) -#elif defined(TQ_WS_WIN) -#define TDE_NO_EXPORT -#define TDE_EXPORT __declspec(dllexport) -#else -#define TDE_NO_EXPORT -#define TDE_EXPORT -#endif - -/** - * TDE_EXPORT_PLUGIN is a workaround for Qt not being able to - * cope with symbol visibility. - */ -#define TDE_EXPORT_PLUGIN(PLUGIN) \ - TQ_EXTERN_C TDE_EXPORT const char* qt_ucm_query_verification_data(); \ - TQ_EXTERN_C TDE_EXPORT TQUnknownInterface* ucm_instantiate(); \ - TQ_EXPORT_PLUGIN(PLUGIN) - -/** - * The TDE_PACKED can be used to hint the compiler that a particular - * structure or class should not contain unnecessary paddings. - */ - -#ifdef __GNUC__ -#define TDE_PACKED __attribute__((__packed__)) -#else -#define TDE_PACKED -#endif - -/** - * The TDE_DEPRECATED macro can be used to trigger compile-time warnings - * with newer compilers when deprecated functions are used. - * - * For non-inline functions, the macro gets inserted at the very end of the - * function declaration, right before the semicolon: - * - * \code - * DeprecatedConstructor() TDE_DEPRECATED; - * void deprecatedFunctionA() TDE_DEPRECATED; - * int deprecatedFunctionB() const TDE_DEPRECATED; - * \endcode - * - * Functions which are implemented inline are handled differently: for them, - * the TDE_DEPRECATED macro is inserted at the front, right before the return - * type, but after "static" or "virtual": - * - * \code - * TDE_DEPRECATED void deprecatedInlineFunctionA() { .. } - * virtual TDE_DEPRECATED int deprecatedInlineFunctionB() { .. } - * static TDE_DEPRECATED bool deprecatedInlineFunctionC() { .. } - * \end - * - * You can also mark whole structs or classes as deprecated, by inserting the - * TDE_DEPRECATED macro after the struct/class keyword, but before the - * name of the struct/class: - * - * \code - * class TDE_DEPRECATED DeprecatedClass { }; - * struct TDE_DEPRECATED DeprecatedStruct { }; - * \endcode - * - * \note - * It does not make much sense to use the TDE_DEPRECATED keyword for a TQt signal; - * this is because usually get called by the class which they belong to, - * and one'd assume that a class author doesn't use deprecated methods of his - * own class. The only exception to this are signals which are connected to - * other signals; they get invoked from moc-generated code. In any case, - * printing a warning message in either case is not useful. - * For slots, it can make sense (since slots can be invoked directly) but be - * aware that if the slots get triggered by a signal, it will get called from - * moc code as well and thus the warnings are useless. - * - * \par - * Also note that it is not possible to use TDE_DEPRECATED for classes which - * use the k_dcop keyword (to indicate a DCOP interface declaration); this is - * because the dcopidl program would choke on the unexpected declaration - * syntax. - */ - -#ifndef TDE_DEPRECATED - #ifdef __GNUC__ - #define TDE_DEPRECATED __attribute__ ((deprecated)) - #elif defined(_MSC_VER) - #define TDE_DEPRECATED __declspec(deprecated) - #else - #define TDE_DEPRECATED - #endif -#endif - -/** - * This macro, and it's friends going up to 10 reserve a fixed number of virtual - * functions in a class. Because adding virtual functions to a class changes the - * size of the vtable, adding virtual functions to a class breaks binary - * compatibility. However, by using this macro, and decrementing it as new - * virtual methods are added, binary compatibility can still be preserved. - * - * \note The added functions must be added to the header at the same location - * as the macro; changing the order of virtual functions in a header is also - * binary incompatible as it breaks the layout of the vtable. - */ - -#define RESERVE_VIRTUAL_1 \ - virtual void reservedVirtual1() {} -#define RESERVE_VIRTUAL_2 \ - virtual void reservedVirtual2() {} \ - RESERVE_VIRTUAL_1 -#define RESERVE_VIRTUAL_3 \ - virtual void reservedVirtual3() {} \ - RESERVE_VIRTUAL_2 -#define RESERVE_VIRTUAL_4 \ - virtual void reservedVirtual4() {} \ - RESERVE_VIRTUAL_3 -#define RESERVE_VIRTUAL_5 \ - virtual void reservedVirtual5() {} \ - RESERVE_VIRTUAL_4 -#define RESERVE_VIRTUAL_6 \ - virtual void reservedVirtual6() {} \ - RESERVE_VIRTUAL_5 -#define RESERVE_VIRTUAL_7 \ - virtual void reservedVirtual7() {} \ - RESERVE_VIRTUAL_6 -#define RESERVE_VIRTUAL_8 \ - virtual void reservedVirtual8() {} \ - RESERVE_VIRTUAL_7 -#define RESERVE_VIRTUAL_9 \ - virtual void reservedVirtual9() {} \ - RESERVE_VIRTUAL_8 -#define RESERVE_VIRTUAL_10 \ - virtual void reservedVirtual10() {} \ - RESERVE_VIRTUAL_9 - -/** - * The TDE_WEAK_SYMBOL macro can be used to tell the compiler that - * a particular function should be a weak symbol (that e.g. may be overriden - * in another library, -Bdirect will not bind this symbol directly) - */ - -#ifdef __GNUC__ -#define TDE_WEAK_SYMBOL __attribute__((__weak__)) -#else -#define TDE_WEAK_SYMBOL -#endif - -#endif /* _KDE_MACROS_H_ */ diff --git a/tdecore/kdemacros.h.in b/tdecore/kdemacros.h.in deleted file mode 100644 index 571d5fafe..000000000 --- a/tdecore/kdemacros.h.in +++ /dev/null @@ -1,185 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (c) 2002-2003 KDE Team - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef _KDE_MACROS_H_ -#define _KDE_MACROS_H_ - -/* Set by configure */ -#undef __KDE_HAVE_GCC_VISIBILITY - -/** - * The TDE_NO_EXPORT macro marks the symbol of the given variable - * to be hidden. A hidden symbol is stripped during the linking step, - * so it can't be used from outside the resulting library, which is similar - * to static. However, static limits the visibility to the current - * compilation unit. hidden symbols can still be used in multiple compilation - * units. - * - * \code - * int TDE_NO_EXPORT foo; - * int TDE_EXPORT bar; - * \end - */ - -#ifdef __KDE_HAVE_GCC_VISIBILITY -#define TDE_NO_EXPORT __attribute__ ((visibility("hidden"))) -#define TDE_EXPORT __attribute__ ((visibility("default"))) -#elif defined(TQ_WS_WIN) -#define TDE_NO_EXPORT -#define TDE_EXPORT __declspec(dllexport) -#else -#define TDE_NO_EXPORT -#define TDE_EXPORT -#endif - -/** - * TDE_EXPORT_PLUGIN is a workaround for Qt not being able to - * cope with symbol visibility. - */ -#define TDE_EXPORT_PLUGIN(PLUGIN) \ - TQ_EXTERN_C TDE_EXPORT const char* qt_ucm_query_verification_data(); \ - TQ_EXTERN_C TDE_EXPORT TQUnknownInterface* ucm_instantiate(); \ - TQ_EXPORT_PLUGIN(PLUGIN) - -/** - * The TDE_PACKED can be used to hint the compiler that a particular - * structure or class should not contain unnecessary paddings. - */ - -#ifdef __GNUC__ -#define TDE_PACKED __attribute__((__packed__)) -#else -#define TDE_PACKED -#endif - -/** - * The TDE_DEPRECATED macro can be used to trigger compile-time warnings - * with newer compilers when deprecated functions are used. - * - * For non-inline functions, the macro gets inserted at the very end of the - * function declaration, right before the semicolon: - * - * \code - * DeprecatedConstructor() TDE_DEPRECATED; - * void deprecatedFunctionA() TDE_DEPRECATED; - * int deprecatedFunctionB() const TDE_DEPRECATED; - * \endcode - * - * Functions which are implemented inline are handled differently: for them, - * the TDE_DEPRECATED macro is inserted at the front, right before the return - * type, but after "static" or "virtual": - * - * \code - * TDE_DEPRECATED void deprecatedInlineFunctionA() { .. } - * virtual TDE_DEPRECATED int deprecatedInlineFunctionB() { .. } - * static TDE_DEPRECATED bool deprecatedInlineFunctionC() { .. } - * \end - * - * You can also mark whole structs or classes as deprecated, by inserting the - * TDE_DEPRECATED macro after the struct/class keyword, but before the - * name of the struct/class: - * - * \code - * class TDE_DEPRECATED DeprecatedClass { }; - * struct TDE_DEPRECATED DeprecatedStruct { }; - * \endcode - * - * \note - * It does not make much sense to use the TDE_DEPRECATED keyword for a TQt signal; - * this is because usually get called by the class which they belong to, - * and one'd assume that a class author doesn't use deprecated methods of his - * own class. The only exception to this are signals which are connected to - * other signals; they get invoked from moc-generated code. In any case, - * printing a warning message in either case is not useful. - * For slots, it can make sense (since slots can be invoked directly) but be - * aware that if the slots get triggered by a signal, it will get called from - * moc code as well and thus the warnings are useless. - * - * \par - * Also note that it is not possible to use TDE_DEPRECATED for classes which - * use the k_dcop keyword (to indicate a DCOP interface declaration); this is - * because the dcopidl program would choke on the unexpected declaration - * syntax. - */ - -#ifndef TDE_DEPRECATED - #ifdef __GNUC__ - #define TDE_DEPRECATED __attribute__ ((deprecated)) - #elif defined(_MSC_VER) - #define TDE_DEPRECATED __declspec(deprecated) - #else - #define TDE_DEPRECATED - #endif -#endif - -/** - * This macro, and it's friends going up to 10 reserve a fixed number of virtual - * functions in a class. Because adding virtual functions to a class changes the - * size of the vtable, adding virtual functions to a class breaks binary - * compatibility. However, by using this macro, and decrementing it as new - * virtual methods are added, binary compatibility can still be preserved. - * - * \note The added functions must be added to the header at the same location - * as the macro; changing the order of virtual functions in a header is also - * binary incompatible as it breaks the layout of the vtable. - */ - -#define RESERVE_VIRTUAL_1 \ - virtual void reservedVirtual1() {} -#define RESERVE_VIRTUAL_2 \ - virtual void reservedVirtual2() {} \ - RESERVE_VIRTUAL_1 -#define RESERVE_VIRTUAL_3 \ - virtual void reservedVirtual3() {} \ - RESERVE_VIRTUAL_2 -#define RESERVE_VIRTUAL_4 \ - virtual void reservedVirtual4() {} \ - RESERVE_VIRTUAL_3 -#define RESERVE_VIRTUAL_5 \ - virtual void reservedVirtual5() {} \ - RESERVE_VIRTUAL_4 -#define RESERVE_VIRTUAL_6 \ - virtual void reservedVirtual6() {} \ - RESERVE_VIRTUAL_5 -#define RESERVE_VIRTUAL_7 \ - virtual void reservedVirtual7() {} \ - RESERVE_VIRTUAL_6 -#define RESERVE_VIRTUAL_8 \ - virtual void reservedVirtual8() {} \ - RESERVE_VIRTUAL_7 -#define RESERVE_VIRTUAL_9 \ - virtual void reservedVirtual9() {} \ - RESERVE_VIRTUAL_8 -#define RESERVE_VIRTUAL_10 \ - virtual void reservedVirtual10() {} \ - RESERVE_VIRTUAL_9 - -/** - * The TDE_WEAK_SYMBOL macro can be used to tell the compiler that - * a particular function should be a weak symbol (that e.g. may be overriden - * in another library, -Bdirect will not bind this symbol directly) - */ - -#ifdef __GNUC__ -#define TDE_WEAK_SYMBOL __attribute__((__weak__)) -#else -#define TDE_WEAK_SYMBOL -#endif - -#endif /* _KDE_MACROS_H_ */ diff --git a/tdecore/netsupp.cpp b/tdecore/netsupp.cpp index 397005183..0ea43178d 100644 --- a/tdecore/netsupp.cpp +++ b/tdecore/netsupp.cpp @@ -49,7 +49,7 @@ extern int h_errno; #endif -#include +#include #if !defined(kde_sockaddr_in6) /* diff --git a/tdecore/tdehw/tdestoragedevice.h b/tdecore/tdehw/tdestoragedevice.h index 0c3aba844..bcbcbacbc 100644 --- a/tdecore/tdehw/tdestoragedevice.h +++ b/tdecore/tdehw/tdestoragedevice.h @@ -22,7 +22,7 @@ #include "tdegenericdevice.h" #include "tqvariant.h" -#include "kdemacros.h" +#include "tdemacros.h" struct crypt_device; diff --git a/tdecore/tdelibs_export.h b/tdecore/tdelibs_export.h index bfe07b0e3..78f129f89 100644 --- a/tdecore/tdelibs_export.h +++ b/tdecore/tdelibs_export.h @@ -21,7 +21,7 @@ #define _TDELIBS_EXPORT_H /* needed for TDE_EXPORT macros */ -#include +#include /* needed, because e.g. Q_OS_UNIX is so frequently used */ #include diff --git a/tdecore/tdemacros.h.cmake b/tdecore/tdemacros.h.cmake new file mode 100644 index 000000000..b8d5abd43 --- /dev/null +++ b/tdecore/tdemacros.h.cmake @@ -0,0 +1,186 @@ +/* This file is part of the KDE libraries + Copyright (c) 2002-2003 KDE Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef _TDE_MACROS_H_ +#define _TDE_MACROS_H_ + +/* Set by configure */ +#cmakedefine __TDE_HAVE_TDEHWLIB 1 +#cmakedefine __KDE_HAVE_GCC_VISIBILITY 1 + +/** + * The TDE_NO_EXPORT macro marks the symbol of the given variable + * to be hidden. A hidden symbol is stripped during the linking step, + * so it can't be used from outside the resulting library, which is similar + * to static. However, static limits the visibility to the current + * compilation unit. hidden symbols can still be used in multiple compilation + * units. + * + * \code + * int TDE_NO_EXPORT foo; + * int TDE_EXPORT bar; + * \end + */ + +#ifdef __KDE_HAVE_GCC_VISIBILITY +#define TDE_NO_EXPORT __attribute__ ((visibility("hidden"))) +#define TDE_EXPORT __attribute__ ((visibility("default"))) +#elif defined(TQ_WS_WIN) +#define TDE_NO_EXPORT +#define TDE_EXPORT __declspec(dllexport) +#else +#define TDE_NO_EXPORT +#define TDE_EXPORT +#endif + +/** + * TDE_EXPORT_PLUGIN is a workaround for Qt not being able to + * cope with symbol visibility. + */ +#define TDE_EXPORT_PLUGIN(PLUGIN) \ + TQ_EXTERN_C TDE_EXPORT const char* qt_ucm_query_verification_data(); \ + TQ_EXTERN_C TDE_EXPORT TQUnknownInterface* ucm_instantiate(); \ + TQ_EXPORT_PLUGIN(PLUGIN) + +/** + * The TDE_PACKED can be used to hint the compiler that a particular + * structure or class should not contain unnecessary paddings. + */ + +#ifdef __GNUC__ +#define TDE_PACKED __attribute__((__packed__)) +#else +#define TDE_PACKED +#endif + +/** + * The TDE_DEPRECATED macro can be used to trigger compile-time warnings + * with newer compilers when deprecated functions are used. + * + * For non-inline functions, the macro gets inserted at the very end of the + * function declaration, right before the semicolon: + * + * \code + * DeprecatedConstructor() TDE_DEPRECATED; + * void deprecatedFunctionA() TDE_DEPRECATED; + * int deprecatedFunctionB() const TDE_DEPRECATED; + * \endcode + * + * Functions which are implemented inline are handled differently: for them, + * the TDE_DEPRECATED macro is inserted at the front, right before the return + * type, but after "static" or "virtual": + * + * \code + * TDE_DEPRECATED void deprecatedInlineFunctionA() { .. } + * virtual TDE_DEPRECATED int deprecatedInlineFunctionB() { .. } + * static TDE_DEPRECATED bool deprecatedInlineFunctionC() { .. } + * \end + * + * You can also mark whole structs or classes as deprecated, by inserting the + * TDE_DEPRECATED macro after the struct/class keyword, but before the + * name of the struct/class: + * + * \code + * class TDE_DEPRECATED DeprecatedClass { }; + * struct TDE_DEPRECATED DeprecatedStruct { }; + * \endcode + * + * \note + * It does not make much sense to use the TDE_DEPRECATED keyword for a TQt signal; + * this is because usually get called by the class which they belong to, + * and one'd assume that a class author doesn't use deprecated methods of his + * own class. The only exception to this are signals which are connected to + * other signals; they get invoked from moc-generated code. In any case, + * printing a warning message in either case is not useful. + * For slots, it can make sense (since slots can be invoked directly) but be + * aware that if the slots get triggered by a signal, it will get called from + * moc code as well and thus the warnings are useless. + * + * \par + * Also note that it is not possible to use TDE_DEPRECATED for classes which + * use the k_dcop keyword (to indicate a DCOP interface declaration); this is + * because the dcopidl program would choke on the unexpected declaration + * syntax. + */ + +#ifndef TDE_DEPRECATED + #ifdef __GNUC__ + #define TDE_DEPRECATED __attribute__ ((deprecated)) + #elif defined(_MSC_VER) + #define TDE_DEPRECATED __declspec(deprecated) + #else + #define TDE_DEPRECATED + #endif +#endif + +/** + * This macro, and it's friends going up to 10 reserve a fixed number of virtual + * functions in a class. Because adding virtual functions to a class changes the + * size of the vtable, adding virtual functions to a class breaks binary + * compatibility. However, by using this macro, and decrementing it as new + * virtual methods are added, binary compatibility can still be preserved. + * + * \note The added functions must be added to the header at the same location + * as the macro; changing the order of virtual functions in a header is also + * binary incompatible as it breaks the layout of the vtable. + */ + +#define RESERVE_VIRTUAL_1 \ + virtual void reservedVirtual1() {} +#define RESERVE_VIRTUAL_2 \ + virtual void reservedVirtual2() {} \ + RESERVE_VIRTUAL_1 +#define RESERVE_VIRTUAL_3 \ + virtual void reservedVirtual3() {} \ + RESERVE_VIRTUAL_2 +#define RESERVE_VIRTUAL_4 \ + virtual void reservedVirtual4() {} \ + RESERVE_VIRTUAL_3 +#define RESERVE_VIRTUAL_5 \ + virtual void reservedVirtual5() {} \ + RESERVE_VIRTUAL_4 +#define RESERVE_VIRTUAL_6 \ + virtual void reservedVirtual6() {} \ + RESERVE_VIRTUAL_5 +#define RESERVE_VIRTUAL_7 \ + virtual void reservedVirtual7() {} \ + RESERVE_VIRTUAL_6 +#define RESERVE_VIRTUAL_8 \ + virtual void reservedVirtual8() {} \ + RESERVE_VIRTUAL_7 +#define RESERVE_VIRTUAL_9 \ + virtual void reservedVirtual9() {} \ + RESERVE_VIRTUAL_8 +#define RESERVE_VIRTUAL_10 \ + virtual void reservedVirtual10() {} \ + RESERVE_VIRTUAL_9 + +/** + * The TDE_WEAK_SYMBOL macro can be used to tell the compiler that + * a particular function should be a weak symbol (that e.g. may be overriden + * in another library, -Bdirect will not bind this symbol directly) + */ + +#ifdef __GNUC__ +#define TDE_WEAK_SYMBOL __attribute__((__weak__)) +#else +#define TDE_WEAK_SYMBOL +#endif + +#endif /* _TDE_MACROS_H_ */ diff --git a/tdecore/tdemacros.h.in b/tdecore/tdemacros.h.in new file mode 100644 index 000000000..721b6849b --- /dev/null +++ b/tdecore/tdemacros.h.in @@ -0,0 +1,185 @@ +/* This file is part of the KDE libraries + Copyright (c) 2002-2003 KDE Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef _TDE_MACROS_H_ +#define _TDE_MACROS_H_ + +/* Set by configure */ +#undef __KDE_HAVE_GCC_VISIBILITY + +/** + * The TDE_NO_EXPORT macro marks the symbol of the given variable + * to be hidden. A hidden symbol is stripped during the linking step, + * so it can't be used from outside the resulting library, which is similar + * to static. However, static limits the visibility to the current + * compilation unit. hidden symbols can still be used in multiple compilation + * units. + * + * \code + * int TDE_NO_EXPORT foo; + * int TDE_EXPORT bar; + * \end + */ + +#ifdef __KDE_HAVE_GCC_VISIBILITY +#define TDE_NO_EXPORT __attribute__ ((visibility("hidden"))) +#define TDE_EXPORT __attribute__ ((visibility("default"))) +#elif defined(TQ_WS_WIN) +#define TDE_NO_EXPORT +#define TDE_EXPORT __declspec(dllexport) +#else +#define TDE_NO_EXPORT +#define TDE_EXPORT +#endif + +/** + * TDE_EXPORT_PLUGIN is a workaround for Qt not being able to + * cope with symbol visibility. + */ +#define TDE_EXPORT_PLUGIN(PLUGIN) \ + TQ_EXTERN_C TDE_EXPORT const char* qt_ucm_query_verification_data(); \ + TQ_EXTERN_C TDE_EXPORT TQUnknownInterface* ucm_instantiate(); \ + TQ_EXPORT_PLUGIN(PLUGIN) + +/** + * The TDE_PACKED can be used to hint the compiler that a particular + * structure or class should not contain unnecessary paddings. + */ + +#ifdef __GNUC__ +#define TDE_PACKED __attribute__((__packed__)) +#else +#define TDE_PACKED +#endif + +/** + * The TDE_DEPRECATED macro can be used to trigger compile-time warnings + * with newer compilers when deprecated functions are used. + * + * For non-inline functions, the macro gets inserted at the very end of the + * function declaration, right before the semicolon: + * + * \code + * DeprecatedConstructor() TDE_DEPRECATED; + * void deprecatedFunctionA() TDE_DEPRECATED; + * int deprecatedFunctionB() const TDE_DEPRECATED; + * \endcode + * + * Functions which are implemented inline are handled differently: for them, + * the TDE_DEPRECATED macro is inserted at the front, right before the return + * type, but after "static" or "virtual": + * + * \code + * TDE_DEPRECATED void deprecatedInlineFunctionA() { .. } + * virtual TDE_DEPRECATED int deprecatedInlineFunctionB() { .. } + * static TDE_DEPRECATED bool deprecatedInlineFunctionC() { .. } + * \end + * + * You can also mark whole structs or classes as deprecated, by inserting the + * TDE_DEPRECATED macro after the struct/class keyword, but before the + * name of the struct/class: + * + * \code + * class TDE_DEPRECATED DeprecatedClass { }; + * struct TDE_DEPRECATED DeprecatedStruct { }; + * \endcode + * + * \note + * It does not make much sense to use the TDE_DEPRECATED keyword for a TQt signal; + * this is because usually get called by the class which they belong to, + * and one'd assume that a class author doesn't use deprecated methods of his + * own class. The only exception to this are signals which are connected to + * other signals; they get invoked from moc-generated code. In any case, + * printing a warning message in either case is not useful. + * For slots, it can make sense (since slots can be invoked directly) but be + * aware that if the slots get triggered by a signal, it will get called from + * moc code as well and thus the warnings are useless. + * + * \par + * Also note that it is not possible to use TDE_DEPRECATED for classes which + * use the k_dcop keyword (to indicate a DCOP interface declaration); this is + * because the dcopidl program would choke on the unexpected declaration + * syntax. + */ + +#ifndef TDE_DEPRECATED + #ifdef __GNUC__ + #define TDE_DEPRECATED __attribute__ ((deprecated)) + #elif defined(_MSC_VER) + #define TDE_DEPRECATED __declspec(deprecated) + #else + #define TDE_DEPRECATED + #endif +#endif + +/** + * This macro, and it's friends going up to 10 reserve a fixed number of virtual + * functions in a class. Because adding virtual functions to a class changes the + * size of the vtable, adding virtual functions to a class breaks binary + * compatibility. However, by using this macro, and decrementing it as new + * virtual methods are added, binary compatibility can still be preserved. + * + * \note The added functions must be added to the header at the same location + * as the macro; changing the order of virtual functions in a header is also + * binary incompatible as it breaks the layout of the vtable. + */ + +#define RESERVE_VIRTUAL_1 \ + virtual void reservedVirtual1() {} +#define RESERVE_VIRTUAL_2 \ + virtual void reservedVirtual2() {} \ + RESERVE_VIRTUAL_1 +#define RESERVE_VIRTUAL_3 \ + virtual void reservedVirtual3() {} \ + RESERVE_VIRTUAL_2 +#define RESERVE_VIRTUAL_4 \ + virtual void reservedVirtual4() {} \ + RESERVE_VIRTUAL_3 +#define RESERVE_VIRTUAL_5 \ + virtual void reservedVirtual5() {} \ + RESERVE_VIRTUAL_4 +#define RESERVE_VIRTUAL_6 \ + virtual void reservedVirtual6() {} \ + RESERVE_VIRTUAL_5 +#define RESERVE_VIRTUAL_7 \ + virtual void reservedVirtual7() {} \ + RESERVE_VIRTUAL_6 +#define RESERVE_VIRTUAL_8 \ + virtual void reservedVirtual8() {} \ + RESERVE_VIRTUAL_7 +#define RESERVE_VIRTUAL_9 \ + virtual void reservedVirtual9() {} \ + RESERVE_VIRTUAL_8 +#define RESERVE_VIRTUAL_10 \ + virtual void reservedVirtual10() {} \ + RESERVE_VIRTUAL_9 + +/** + * The TDE_WEAK_SYMBOL macro can be used to tell the compiler that + * a particular function should be a weak symbol (that e.g. may be overriden + * in another library, -Bdirect will not bind this symbol directly) + */ + +#ifdef __GNUC__ +#define TDE_WEAK_SYMBOL __attribute__((__weak__)) +#else +#define TDE_WEAK_SYMBOL +#endif + +#endif /* _TDE_MACROS_H_ */ diff --git a/tdehtml/css/css_base.h b/tdehtml/css/css_base.h index db0700a35..d39d5e94d 100644 --- a/tdehtml/css/css_base.h +++ b/tdehtml/css/css_base.h @@ -29,7 +29,7 @@ #include "dom/dom_misc.h" #include "xml/dom_nodeimpl.h" #include "misc/shared.h" -#include +#include #include #include diff --git a/tdehtml/dom/css_value.h b/tdehtml/dom/css_value.h index 6e3d89717..563d09cd1 100644 --- a/tdehtml/dom/css_value.h +++ b/tdehtml/dom/css_value.h @@ -31,7 +31,7 @@ #include -#include +#include namespace DOM { diff --git a/tdehtml/dom/html_form.h b/tdehtml/dom/html_form.h index 63c626356..7533a29de 100644 --- a/tdehtml/dom/html_form.h +++ b/tdehtml/dom/html_form.h @@ -33,7 +33,7 @@ #include #include -#include +#include namespace DOM { diff --git a/tdehtml/dom/html_image.h b/tdehtml/dom/html_image.h index f6f25b0d6..ec2ab819e 100644 --- a/tdehtml/dom/html_image.h +++ b/tdehtml/dom/html_image.h @@ -31,7 +31,7 @@ #include -#include +#include namespace DOM { diff --git a/tdehtml/dom/html_object.h b/tdehtml/dom/html_object.h index 6161f8ef2..22d5b002b 100644 --- a/tdehtml/dom/html_object.h +++ b/tdehtml/dom/html_object.h @@ -34,7 +34,7 @@ #include #include -#include +#include namespace DOM { diff --git a/tdehtml/misc/htmlattrs.h b/tdehtml/misc/htmlattrs.h index 7f28a5081..eabe89cd2 100644 --- a/tdehtml/misc/htmlattrs.h +++ b/tdehtml/misc/htmlattrs.h @@ -6,7 +6,7 @@ htmlattrs.in by makeattrs, do not edit */ #define HTML_ATTRS_H #include "dom/dom_string.h" -#include +#include using namespace DOM; #define ATTR_ACCEPT_CHARSET 1 diff --git a/tdehtml/misc/makeattrs b/tdehtml/misc/makeattrs index 1ed890c2c..b981b285f 100644 --- a/tdehtml/misc/makeattrs +++ b/tdehtml/misc/makeattrs @@ -36,7 +36,7 @@ print out "%{\n/* This file is automatically generated from print out "struct attrs {\n int name;\n int id;\n};\n%%\n"; print header "/* This file is automatically generated from -htmlattrs.in by makeattrs, do not edit */\n/* Copyright 1999 Lars Knoll */\n\n#ifndef HTML_ATTRS_H\n#define HTML_ATTRS_H\n\n#include \"dom/dom_string.h\"\n#include \nusing namespace DOM;\n\n"; +htmlattrs.in by makeattrs, do not edit */\n/* Copyright 1999 Lars Knoll */\n\n#ifndef HTML_ATTRS_H\n#define HTML_ATTRS_H\n\n#include \"dom/dom_string.h\"\n#include \nusing namespace DOM;\n\n"; my %amap = (); my $last_ci_attr = 0; diff --git a/tdehtml/tdehtml_part.h b/tdehtml/tdehtml_part.h index 7d3f01312..a67cb28ab 100644 --- a/tdehtml/tdehtml_part.h +++ b/tdehtml/tdehtml_part.h @@ -30,7 +30,7 @@ #include #include -#include +#include #include #include diff --git a/tdeio/bookmarks/kbookmarkimporter_crash.h b/tdeio/bookmarks/kbookmarkimporter_crash.h index 007dcf86a..d6bc81a12 100644 --- a/tdeio/bookmarks/kbookmarkimporter_crash.h +++ b/tdeio/bookmarks/kbookmarkimporter_crash.h @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include "kbookmarkimporter.h" diff --git a/tdeio/bookmarks/kbookmarkimporter_ie.h b/tdeio/bookmarks/kbookmarkimporter_ie.h index d0707cefb..70f4ee0b6 100644 --- a/tdeio/bookmarks/kbookmarkimporter_ie.h +++ b/tdeio/bookmarks/kbookmarkimporter_ie.h @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include diff --git a/tdeio/bookmarks/kbookmarkimporter_ns.h b/tdeio/bookmarks/kbookmarkimporter_ns.h index 4ccee6fa3..d765bd7db 100644 --- a/tdeio/bookmarks/kbookmarkimporter_ns.h +++ b/tdeio/bookmarks/kbookmarkimporter_ns.h @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include "kbookmarkimporter.h" #include "kbookmarkexporter.h" diff --git a/tdeio/kssl/ksslcertchain.h b/tdeio/kssl/ksslcertchain.h index bf9c66cc3..960bcfbb4 100644 --- a/tdeio/kssl/ksslcertchain.h +++ b/tdeio/kssl/ksslcertchain.h @@ -23,7 +23,7 @@ #include #include -#include +#include class TQString; class TQCString; diff --git a/tdeio/kssl/ksslutils.h b/tdeio/kssl/ksslutils.h index eca012b9b..5fa05a023 100644 --- a/tdeio/kssl/ksslutils.h +++ b/tdeio/kssl/ksslutils.h @@ -20,7 +20,7 @@ #ifndef _INCLUDE_KSSLUTILS_H #define _INCLUDE_KSSLUTILS_H -#include +#include #ifdef TQ_WS_WIN #include "ksslconfig_win.h" diff --git a/tdeio/tdefile/kpropertiesdialog.h b/tdeio/tdefile/kpropertiesdialog.h index 61fc22a6b..8fa1a5880 100644 --- a/tdeio/tdefile/kpropertiesdialog.h +++ b/tdeio/tdefile/kpropertiesdialog.h @@ -31,7 +31,7 @@ #include #include -#include +#include #include #include #include diff --git a/tdeio/tdeio/posixacladdons.cpp b/tdeio/tdeio/posixacladdons.cpp index 1e4d9bec0..c4d4ca555 100644 --- a/tdeio/tdeio/posixacladdons.cpp +++ b/tdeio/tdeio/posixacladdons.cpp @@ -21,7 +21,7 @@ #if defined(USE_POSIX_ACL) && !defined(HAVE_NON_POSIX_ACL_EXTENSIONS) -#include +#include #include #include diff --git a/tdenewstuff/knewstuff.h b/tdenewstuff/knewstuff.h index e76b6603b..9477a593d 100644 --- a/tdenewstuff/knewstuff.h +++ b/tdenewstuff/knewstuff.h @@ -22,7 +22,7 @@ #include -#include +#include class TQObject; class TQWidget; diff --git a/tdeprint/kprinter.h b/tdeprint/kprinter.h index 695025aab..3b31666a5 100644 --- a/tdeprint/kprinter.h +++ b/tdeprint/kprinter.h @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include diff --git a/tdeprint/tools/escputil/escpwidget.cpp b/tdeprint/tools/escputil/escpwidget.cpp index e2d899e3c..8d51332e4 100644 --- a/tdeprint/tools/escputil/escpwidget.cpp +++ b/tdeprint/tools/escputil/escpwidget.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tdestyles/plastik/config/plastikconf.cpp b/tdestyles/plastik/config/plastikconf.cpp index 5da07beb1..6fbeb74a1 100644 --- a/tdestyles/plastik/config/plastikconf.cpp +++ b/tdestyles/plastik/config/plastikconf.cpp @@ -33,7 +33,7 @@ DEALINGS IN THE SOFTWARE. #include #include #include -#include +#include #include "plastikconf.h" diff --git a/win/kdemacros.h b/win/kdemacros.h deleted file mode 100644 index c8c017b02..000000000 --- a/win/kdemacros.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/win/tdemacros.h b/win/tdemacros.h new file mode 100644 index 000000000..da23cd9b4 --- /dev/null +++ b/win/tdemacros.h @@ -0,0 +1 @@ +#include -- cgit v1.2.1