• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KDECore

kdemacros.h.cmake

Go to the documentation of this file.
00001 /* This file is part of the KDE libraries
00002     Copyright (c) 2002-2003 KDE Team
00003 
00004     This library is free software; you can redistribute it and/or
00005     modify it under the terms of the GNU Library General Public
00006     License as published by the Free Software Foundation; either
00007     version 2 of the License, or (at your option) any later version.
00008 
00009     This library is distributed in the hope that it will be useful,
00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012     Library General Public License for more details.
00013 
00014     You should have received a copy of the GNU Library General Public License
00015     along with this library; see the file COPYING.LIB.  If not, write to
00016     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017     Boston, MA 02110-1301, USA.
00018 */
00019 
00028 #ifndef _KDE_MACROS_H_
00029 #define _KDE_MACROS_H_
00030 
00031 #cmakedefine __KDE_HAVE_GCC_VISIBILITY
00032 
00072 #ifdef __KDE_HAVE_GCC_VISIBILITY
00073 #define KDE_NO_EXPORT __attribute__ ((visibility("hidden")))
00074 #define KDE_EXPORT __attribute__ ((visibility("default")))
00075 #define KDE_IMPORT __attribute__ ((visibility("default")))
00076 #elif defined(_WIN32) || defined(_WIN64)
00077 #define KDE_NO_EXPORT
00078 #define KDE_EXPORT __declspec(dllexport)
00079 #define KDE_IMPORT __declspec(dllimport)
00080 #else
00081 #define KDE_NO_EXPORT
00082 #define KDE_EXPORT
00083 #define KDE_IMPORT
00084 #endif
00085 
00094 #ifdef __GNUC__
00095 #define KDE_PACKED __attribute__((__packed__))
00096 #else
00097 #define KDE_PACKED
00098 #endif
00099 
00161 #ifdef __cplusplus
00162 # include <QtCore/qglobal.h>
00163 # ifndef KDE_DEPRECATED
00164 #  ifdef KDE_DEPRECATED_WARNINGS
00165 #   define KDE_DEPRECATED Q_DECL_DEPRECATED
00166 #  else
00167 #   define KDE_DEPRECATED
00168 #  endif
00169 # endif
00170 #endif
00171 
00198 #ifndef KDE_CONSTRUCTOR_DEPRECATED
00199 # ifdef __GNUC__
00200 #  if __GNUC__ == 3 && __GNUC_MINOR__ <= 3 
00201     /* GCC 3.3.x cannot handle Qt 4.1.2's definition of Q_DECL_CONSTRUCTOR_DEPRECATED */
00202 #   define KDE_CONSTRUCTOR_DEPRECATED
00203 #  else
00204 #   define KDE_CONSTRUCTOR_DEPRECATED Q_DECL_CONSTRUCTOR_DEPRECATED
00205 #  endif
00206 # else
00207 #  define KDE_CONSTRUCTOR_DEPRECATED Q_DECL_CONSTRUCTOR_DEPRECATED
00208 # endif
00209 #endif
00210 
00271 #if defined(__GNUC__) && __GNUC__ - 0 >= 3
00272 # define KDE_ISLIKELY( x )    __builtin_expect(!!(x),1)
00273 # define KDE_ISUNLIKELY( x )  __builtin_expect(!!(x),0)
00274 #else
00275 # define KDE_ISLIKELY( x )   ( x )
00276 # define KDE_ISUNLIKELY( x )  ( x )
00277 #endif
00278 
00279 
00292 #define RESERVE_VIRTUAL_1 \
00293     virtual void reservedVirtual1() {}
00294 
00297 #define RESERVE_VIRTUAL_2 \
00298     virtual void reservedVirtual2() {} \
00299     RESERVE_VIRTUAL_1
00300 
00303 #define RESERVE_VIRTUAL_3 \
00304     virtual void reservedVirtual3() {} \
00305     RESERVE_VIRTUAL_2
00306 
00309 #define RESERVE_VIRTUAL_4 \
00310     virtual void reservedVirtual4() {} \
00311     RESERVE_VIRTUAL_3
00312 
00315 #define RESERVE_VIRTUAL_5 \
00316     virtual void reservedVirtual5() {} \
00317     RESERVE_VIRTUAL_4
00318 
00321 #define RESERVE_VIRTUAL_6 \
00322     virtual void reservedVirtual6() {} \
00323     RESERVE_VIRTUAL_5
00324 
00327 #define RESERVE_VIRTUAL_7 \
00328     virtual void reservedVirtual7() {} \
00329     RESERVE_VIRTUAL_6
00330 
00333 #define RESERVE_VIRTUAL_8 \
00334     virtual void reservedVirtual8() {} \
00335     RESERVE_VIRTUAL_7
00336 
00339 #define RESERVE_VIRTUAL_9 \
00340     virtual void reservedVirtual9() {} \
00341     RESERVE_VIRTUAL_8
00342 #define RESERVE_VIRTUAL_10 \
00343     virtual void reservedVirtual10() {} \
00344     RESERVE_VIRTUAL_9
00345 
00387 #ifdef KDE_FULL_TEMPLATE_EXPORT_INSTANTIATION
00388 # define KDE_DUMMY_COMPARISON_OPERATOR(C) \
00389     bool operator==(const C&) const { \
00390         qWarning(#C"::operator==(const "#C"&) was called"); \
00391         return false; \
00392     }
00393 # define KDE_DUMMY_QHASH_FUNCTION(C) \
00394     inline uint qHash(const C) { \
00395         qWarning("inline uint qHash(const "#C") was called"); \
00396         return 0; \
00397     }
00398 #else
00399 # define KDE_DUMMY_COMPARISON_OPERATOR(C)
00400 # define KDE_DUMMY_QHASH_FUNCTION(C)
00401 #endif
00402 
00425 #ifdef Q_CC_MSVC
00426 # define KDE_BF_ENUM(a) unsigned int
00427 # define KDE_CAST_BF_ENUM(a,b) static_cast<a>(b)
00428 #else
00429 # define KDE_BF_ENUM(a) a
00430 # define KDE_CAST_BF_ENUM(a,b) b
00431 #endif
00432 
00442 #ifdef __GNUC__
00443 #define KDE_WEAK_SYMBOL __attribute__((__weak__))
00444 #else
00445 #define KDE_WEAK_SYMBOL
00446 #endif
00447 
00448 
00457 #ifdef __GNUC__
00458 #define KDE_MUST_USE_RESULT __attribute__((__warn_unused_result__))
00459 #else
00460 #define KDE_MUST_USE_RESULT
00461 #endif
00462 
00463 
00464 
00465 #endif /* _KDE_MACROS_H_ */

KDECore

Skip menu "KDECore"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.7
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal