| QxOrm 1.2.1 C++ Object Relational Mapping library

- Main Page
- Modules
- Namespaces
- Classes
- Files
- Directories

- File List
- File Members

QxMacro.h
Go to the documentation of this file.

    00001 /****************************************************************************
    00002 **
    00003 ** http://www.qxorm.com/
    00004 ** http://sourceforge.net/projects/qxorm/
    00005 ** Original file by Lionel Marty
    00006 **
    00007 ** This file is part of the QxOrm library
    00008 **
    00009 ** This software is provided 'as-is', without any express or implied
    00010 ** warranty. In no event will the authors be held liable for any
    00011 ** damages arising from the use of this software.
    00012 **
    00013 ** GNU Lesser General Public License Usage
    00014 ** This file must be used under the terms of the GNU Lesser
    00015 ** General Public License version 2.1 as published by the Free Software
    00016 ** Foundation and appearing in the file 'license.lgpl.txt' included in the
    00017 ** packaging of this file.  Please review the following information to
    00018 ** ensure the GNU Lesser General Public License version 2.1 requirements
    00019 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    00020 **
    00021 ** If you have questions regarding the use of this file, please contact :
    00022 ** contact@qxorm.com
    00023 **
    00024 ****************************************************************************/
    00025
    00026 #ifndef _QX_MACRO_H_
    00027 #define _QX_MACRO_H_
    00028
    00029 #ifdef _MSC_VER
    00030 #pragma once
    00031 #endif
    00032
    00040 #include <QxCommon/QxConfig.h>
    00041
    00042 #ifndef qAssert
    00043 #if _QX_USE_ASSERT
    00044 #define qAssert Q_ASSERT
    00045 #else // _QX_USE_ASSERT
    00046 #define qAssert(x) /* Nothing */
    00047 #endif // _QX_USE_ASSERT
    00048 #endif // qAssert
    00049
    00050 #ifndef QX_PRAGMA
    00051 #ifdef __GNUC__
    00052 #define QX_PRAGMA(x) _Pragma( #x )
    00053 #endif // __GNUC__
    00054 #ifdef _MSC_VER
    00055 #define QX_PRAGMA(x) __pragma( x )
    00056 #endif // _MSC_VER
    00057 #ifndef QX_PRAGMA
    00058 #define QX_PRAGMA(x) /* Nothing */
    00059 #endif // QX_PRAGMA
    00060 #endif // QX_PRAGMA
    00061
    00062 #ifndef QX_DLL_EXPORT_HELPER
    00063 #ifdef Q_OS_WIN
    00064 #define QX_DLL_EXPORT_HELPER __declspec(dllexport)
    00065 #elif (_QX_USE_GCC_VISIBILITY && (__GNUC__ >= 4))
    00066 #define QX_DLL_EXPORT_HELPER __attribute__ ((visibility("default")))
    00067 #else
    00068 #define QX_DLL_EXPORT_HELPER /* Nothing */
    00069 #endif // Q_OS_WIN
    00070 #endif // QX_DLL_EXPORT_HELPER
    00071
    00072 #ifndef QX_DLL_IMPORT_HELPER
    00073 #ifdef Q_OS_WIN
    00074 #define QX_DLL_IMPORT_HELPER __declspec(dllimport)
    00075 #elif (_QX_USE_GCC_VISIBILITY && (__GNUC__ >= 4))
    00076 #define QX_DLL_IMPORT_HELPER __attribute__ ((visibility("default")))
    00077 #else
    00078 #define QX_DLL_IMPORT_HELPER /* Nothing */
    00079 #endif // Q_OS_WIN
    00080 #endif // QX_DLL_IMPORT_HELPER
    00081
    00082 #ifdef __GNUC__
    00083 #if _QX_USE_GCC_EXPORT_ALL_SYMBOLS
    00084 #undef QX_DLL_EXPORT_HELPER
    00085 #undef QX_DLL_IMPORT_HELPER
    00086 #define QX_DLL_EXPORT_HELPER /* Nothing */
    00087 #define QX_DLL_IMPORT_HELPER /* Nothing */
    00088 #endif // _QX_USE_GCC_EXPORT_ALL_SYMBOLS
    00089 #endif // __GNUC__
    00090
    00091 #ifndef QX_DLL_INTERNAL_HELPER
    00092 #if (_QX_USE_GCC_VISIBILITY && (__GNUC__ >= 4))
    00093 #define QX_DLL_INTERNAL_HELPER __attribute__ ((visibility("hidden")))
    00094 #else
    00095 #define QX_DLL_INTERNAL_HELPER /* Nothing */
    00096 #endif // (_QX_USE_GCC_VISIBILITY && (__GNUC__ >= 4))
    00097 #endif // QX_DLL_INTERNAL_HELPER
    00098
    00099 #ifndef QX_DLL_EXPORT_TEMPLATE_HELPER
    00100 #ifdef _MSC_VER
    00101 #define QX_DLL_EXPORT_TEMPLATE_HELPER QX_DLL_EXPORT_HELPER
    00102 #else // _MSC_VER
    00103 #define QX_DLL_EXPORT_TEMPLATE_HELPER /* Nothing */
    00104 #endif // _MSC_VER
    00105 #endif // QX_DLL_EXPORT_TEMPLATE_HELPER
    00106
    00107 #ifndef QX_DLL_IMPORT_TEMPLATE_HELPER
    00108 #ifdef _MSC_VER
    00109 #define QX_DLL_IMPORT_TEMPLATE_HELPER QX_DLL_IMPORT_HELPER
    00110 #else // _MSC_VER
    00111 #define QX_DLL_IMPORT_TEMPLATE_HELPER /* Nothing */
    00112 #endif // _MSC_VER
    00113 #endif // QX_DLL_IMPORT_TEMPLATE_HELPER
    00114
    00115 #ifndef QX_PRAGMA_VISIBILITY_BEGIN
    00116 #ifndef Q_OS_WIN
    00117 #if (_QX_USE_GCC_VISIBILITY && (__GNUC__ >= 4))
    00118 #define QX_PRAGMA_VISIBILITY_BEGIN QX_PRAGMA(GCC visibility push( default ))
    00119 #endif // (_QX_USE_GCC_VISIBILITY && (__GNUC__ >= 4))
    00120 #endif // Q_OS_WIN
    00121 #ifndef QX_PRAGMA_VISIBILITY_BEGIN
    00122 #define QX_PRAGMA_VISIBILITY_BEGIN /* Nothing */
    00123 #endif // QX_PRAGMA_VISIBILITY_BEGIN
    00124 #endif // QX_PRAGMA_VISIBILITY_BEGIN
    00125
    00126 #ifndef QX_PRAGMA_VISIBILITY_END
    00127 #ifndef Q_OS_WIN
    00128 #if (_QX_USE_GCC_VISIBILITY && (__GNUC__ >= 4))
    00129 #define QX_PRAGMA_VISIBILITY_END QX_PRAGMA(GCC visibility pop)
    00130 #endif // (_QX_USE_GCC_VISIBILITY && (__GNUC__ >= 4))
    00131 #endif // Q_OS_WIN
    00132 #ifndef QX_PRAGMA_VISIBILITY_END
    00133 #define QX_PRAGMA_VISIBILITY_END /* Nothing */
    00134 #endif // QX_PRAGMA_VISIBILITY_END
    00135 #endif // QX_PRAGMA_VISIBILITY_END
    00136
    00137 #define QX_DLL_EXPORT_TEMPLATE_HPP(CL, T) QX_PRAGMA_VISIBILITY_BEGIN extern template CL QX_DLL_IMPORT_TEMPLATE_HELPER T; QX_PRAGMA_VISIBILITY_END
    00138 #define QX_DLL_EXPORT_TEMPLATE_T_P1_HPP(CL, T, P1) QX_PRAGMA_VISIBILITY_BEGIN extern template CL QX_DLL_IMPORT_TEMPLATE_HELPER T< P1 >; QX_PRAGMA_VISIBILITY_END
    00139 #define QX_DLL_EXPORT_TEMPLATE_T_U_P1_HPP(CL, T, U, P1) QX_PRAGMA_VISIBILITY_BEGIN extern template CL QX_DLL_IMPORT_TEMPLATE_HELPER T< U< P1 > >; QX_PRAGMA_VISIBILITY_END
    00140 #define QX_DLL_EXPORT_TEMPLATE_T_P1_P2_HPP(CL, T, P1, P2) QX_PRAGMA_VISIBILITY_BEGIN extern template CL QX_DLL_IMPORT_TEMPLATE_HELPER T< P1, P2 >; QX_PRAGMA_VISIBILITY_END
    00141 #define QX_DLL_EXPORT_TEMPLATE_T_U_P1_P2_HPP(CL, T, U, P1, P2) QX_PRAGMA_VISIBILITY_BEGIN extern template CL QX_DLL_IMPORT_TEMPLATE_HELPER T< U< P1, P2 > >; QX_PRAGMA_VISIBILITY_END
    00142
    00143 #define QX_DLL_EXPORT_TEMPLATE_CPP(CL, T) QX_PRAGMA_VISIBILITY_BEGIN template CL QX_DLL_EXPORT_TEMPLATE_HELPER T; QX_PRAGMA_VISIBILITY_END
    00144 #define QX_DLL_EXPORT_TEMPLATE_T_P1_CPP(CL, T, P1) QX_PRAGMA_VISIBILITY_BEGIN template CL QX_DLL_EXPORT_TEMPLATE_HELPER T< P1 >; QX_PRAGMA_VISIBILITY_END
    00145 #define QX_DLL_EXPORT_TEMPLATE_T_U_P1_CPP(CL, T, U, P1) QX_PRAGMA_VISIBILITY_BEGIN template CL QX_DLL_EXPORT_TEMPLATE_HELPER T< U< P1 > >; QX_PRAGMA_VISIBILITY_END
    00146 #define QX_DLL_EXPORT_TEMPLATE_T_P1_P2_CPP(CL, T, P1, P2) QX_PRAGMA_VISIBILITY_BEGIN template CL QX_DLL_EXPORT_TEMPLATE_HELPER T< P1, P2 >; QX_PRAGMA_VISIBILITY_END
    00147 #define QX_DLL_EXPORT_TEMPLATE_T_U_P1_P2_CPP(CL, T, U, P1, P2) QX_PRAGMA_VISIBILITY_BEGIN template CL QX_DLL_EXPORT_TEMPLATE_HELPER T< U< P1, P2 > >; QX_PRAGMA_VISIBILITY_END
    00148
    00149 #define QX_TEMPLATE_T(T) T<>
    00150 #define QX_TEMPLATE_T_P1(T, P1) T< P1 >
    00151 #define QX_TEMPLATE_T_P1_P2(T, P1, P2) T< P1, P2 >
    00152 #define QX_TEMPLATE_T_P1_P2_P3(T, P1, P2, P3) T< P1, P2, P3 >
    00153 #define QX_TEMPLATE_T_U_P1(T, U, P1) T< U< P1 > >
    00154 #define QX_TEMPLATE_T_U_P1_P2(T, U, P1, P2) T< U< P1, P2 > >
    00155 #define QX_TEMPLATE_T_U_P1_P2_P3(T, U, P1, P2, P3) T< U< P1, P2, P3 > >
    00156
    00157 #ifndef QX_DLL_EXPORT
    00158 #ifdef _QX_BUILDING_QX_ORM
    00159 #define QX_DLL_EXPORT QX_DLL_EXPORT_HELPER
    00160 #else // _QX_BUILDING_QX_ORM
    00161 #define QX_DLL_EXPORT QX_DLL_IMPORT_HELPER
    00162 #endif // _QX_BUILDING_QX_ORM
    00163 #endif // QX_DLL_EXPORT
    00164
    00165 #ifndef QX_DLL_EXPORT_QX_SINGLETON_HPP
    00166 #ifdef _QX_BUILDING_QX_ORM
    00167 #define QX_DLL_EXPORT_QX_SINGLETON_HPP(x) /* Nothing */
    00168 #else // _QX_BUILDING_QX_ORM
    00169 #define QX_DLL_EXPORT_QX_SINGLETON_HPP(x) QX_DLL_EXPORT_TEMPLATE_HPP(class, qx::QxSingleton< x >)
    00170 #endif // _QX_BUILDING_QX_ORM
    00171 #endif // QX_DLL_EXPORT_QX_SINGLETON_HPP
    00172
    00173 #ifndef QX_DLL_EXPORT_QX_SINGLETON_CPP
    00174 #ifdef _QX_BUILDING_QX_ORM
    00175 #define QX_DLL_EXPORT_QX_SINGLETON_CPP(x) QX_DLL_EXPORT_TEMPLATE_CPP(class, qx::QxSingleton< x >)
    00176 #else // _QX_BUILDING_QX_ORM
    00177 #define QX_DLL_EXPORT_QX_SINGLETON_CPP(x) /* Nothing */
    00178 #endif // _QX_BUILDING_QX_ORM
    00179 #endif // QX_DLL_EXPORT_QX_SINGLETON_CPP
    00180
    00181 #ifndef QX_DLL_EXPORT_INLINE_FCT
    00182 #ifdef _MSC_VER
    00183 #define QX_DLL_EXPORT_INLINE_FCT QX_DLL_EXPORT
    00184 #else // _MSC_VER
    00185 #define QX_DLL_EXPORT_INLINE_FCT /* Nothing */
    00186 #endif // _MSC_VER
    00187 #endif // QX_DLL_EXPORT_INLINE_FCT
    00188
    00189 #ifdef __GNUC__
    00190 #define QX_GCC_WORKAROUND_TEMPLATE_SPEC_INLINE inline
    00191 #else
    00192 #define QX_GCC_WORKAROUND_TEMPLATE_SPEC_INLINE /* Nothing */
    00193 #endif // __GNUC__
    00194
    00195 #ifdef _MSC_VER
    00196 #define QX_STRNCPY strncpy_s
    00197 #define QX_VSPRINTF vsprintf_s
    00198 #else // _MSC_VER
    00199 #define QX_STRNCPY strncpy
    00200 #define QX_VSPRINTF vsprintf
    00201 #endif // _MSC_VER
    00202
    00203 #endif // _QX_MACRO_H_

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines