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

KDECore

  • sources
  • kde-4.12
  • kdelibs
kdemacros.h.cmake
Go to the documentation of this file.
1 /* This file is part of the KDE libraries
2  Copyright (c) 2002-2003 KDE Team
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License as published by the Free Software Foundation; either
7  version 2 of the License, or (at your option) any later version.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Library General Public License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 */
19 
28 #ifndef _KDE_MACROS_H_
29 #define _KDE_MACROS_H_
30 
31 #cmakedefine __KDE_HAVE_GCC_VISIBILITY
32 
72 #ifdef __KDE_HAVE_GCC_VISIBILITY
73 #define KDE_NO_EXPORT __attribute__ ((visibility("hidden")))
74 #define KDE_EXPORT __attribute__ ((visibility("default")))
75 #define KDE_IMPORT __attribute__ ((visibility("default")))
76 #elif defined(_WIN32) || defined(_WIN64)
77 #define KDE_NO_EXPORT
78 #define KDE_EXPORT __declspec(dllexport)
79 #define KDE_IMPORT __declspec(dllimport)
80 #else
81 #define KDE_NO_EXPORT
82 #define KDE_EXPORT
83 #define KDE_IMPORT
84 #endif
85 
94 #ifdef __GNUC__
95 #define KDE_PACKED __attribute__((__packed__))
96 #else
97 #define KDE_PACKED
98 #endif
99 
161 #ifdef __cplusplus
162 # include <QtCore/qglobal.h>
163 # ifndef KDE_DEPRECATED
164 # ifdef KDE_DEPRECATED_WARNINGS
165 # define KDE_DEPRECATED Q_DECL_DEPRECATED
166 # else
167 # define KDE_DEPRECATED
168 # endif
169 # endif
170 #endif
171 
198 #ifndef KDE_CONSTRUCTOR_DEPRECATED
199 # ifdef __GNUC__
200 # if __GNUC__ == 3 && __GNUC_MINOR__ <= 3
201  /* GCC 3.3.x cannot handle Qt 4.1.2's definition of Q_DECL_CONSTRUCTOR_DEPRECATED */
202 # define KDE_CONSTRUCTOR_DEPRECATED
203 # else
204 # define KDE_CONSTRUCTOR_DEPRECATED Q_DECL_CONSTRUCTOR_DEPRECATED
205 # endif
206 # else
207 # define KDE_CONSTRUCTOR_DEPRECATED Q_DECL_CONSTRUCTOR_DEPRECATED
208 # endif
209 #endif
210 
218 #cmakedefine KDE_NO_DEPRECATED
219 
280 #if defined(__GNUC__) && __GNUC__ - 0 >= 3
281 # define KDE_ISLIKELY( x ) __builtin_expect(!!(x),1)
282 # define KDE_ISUNLIKELY( x ) __builtin_expect(!!(x),0)
283 #else
284 # define KDE_ISLIKELY( x ) ( x )
285 # define KDE_ISUNLIKELY( x ) ( x )
286 #endif
287 
288 
301 #define RESERVE_VIRTUAL_1 \
302  virtual void reservedVirtual1() {}
303 
306 #define RESERVE_VIRTUAL_2 \
307  virtual void reservedVirtual2() {} \
308  RESERVE_VIRTUAL_1
309 
312 #define RESERVE_VIRTUAL_3 \
313  virtual void reservedVirtual3() {} \
314  RESERVE_VIRTUAL_2
315 
318 #define RESERVE_VIRTUAL_4 \
319  virtual void reservedVirtual4() {} \
320  RESERVE_VIRTUAL_3
321 
324 #define RESERVE_VIRTUAL_5 \
325  virtual void reservedVirtual5() {} \
326  RESERVE_VIRTUAL_4
327 
330 #define RESERVE_VIRTUAL_6 \
331  virtual void reservedVirtual6() {} \
332  RESERVE_VIRTUAL_5
333 
336 #define RESERVE_VIRTUAL_7 \
337  virtual void reservedVirtual7() {} \
338  RESERVE_VIRTUAL_6
339 
342 #define RESERVE_VIRTUAL_8 \
343  virtual void reservedVirtual8() {} \
344  RESERVE_VIRTUAL_7
345 
348 #define RESERVE_VIRTUAL_9 \
349  virtual void reservedVirtual9() {} \
350  RESERVE_VIRTUAL_8
351 #define RESERVE_VIRTUAL_10 \
352  virtual void reservedVirtual10() {} \
353  RESERVE_VIRTUAL_9
354 
396 #ifdef KDE_FULL_TEMPLATE_EXPORT_INSTANTIATION
397 # define KDE_DUMMY_COMPARISON_OPERATOR(C) \
398  bool operator==(const C&) const { \
399  qWarning(#C"::operator==(const "#C"&) was called"); \
400  return false; \
401  }
402 # define KDE_DUMMY_QHASH_FUNCTION(C) \
403  inline uint qHash(const C) { \
404  qWarning("inline uint qHash(const "#C") was called"); \
405  return 0; \
406  }
407 #else
408 # define KDE_DUMMY_COMPARISON_OPERATOR(C)
409 # define KDE_DUMMY_QHASH_FUNCTION(C)
410 #endif
411 
434 #ifdef Q_CC_MSVC
435 # define KDE_BF_ENUM(a) unsigned int
436 # define KDE_CAST_BF_ENUM(a,b) static_cast<a>(b)
437 #else
438 # define KDE_BF_ENUM(a) a
439 # define KDE_CAST_BF_ENUM(a,b) b
440 #endif
441 
451 #ifdef __GNUC__
452 #define KDE_WEAK_SYMBOL __attribute__((__weak__))
453 #else
454 #define KDE_WEAK_SYMBOL
455 #endif
456 
457 
466 #ifdef __GNUC__
467 #define KDE_MUST_USE_RESULT __attribute__((__warn_unused_result__))
468 #else
469 #define KDE_MUST_USE_RESULT
470 #endif
471 
472 
473 
474 #endif /* _KDE_MACROS_H_ */
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:47:08 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDECore

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

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal