TCDefines.h

Go to the documentation of this file.
00001 //*******************************************************************************
00002 //
00003 // *******   ***   ***               *
00004 //    *     *     *                  *
00005 //    *    *      *                *****
00006 //    *    *       ***  *   *   **   *    **    ***
00007 //    *    *          *  * *   *     *   ****  * * *
00008 //    *     *         *   *      *   * * *     * * *
00009 //    *      ***   ***    *     **   **   **   *   *
00010 //                        *
00011 //*******************************************************************************
00012 // see http://sourceforge.net/projects/tcsystem/ for details.
00013 // Copyright (C) 2003 - 2008 Thomas Goessler. All Rights Reserved. 
00014 //*******************************************************************************
00015 //
00016 // TCSystem is the legal property of its developers.
00017 // Please refer to the COPYRIGHT file distributed with this source distribution.
00018 // 
00019 // This library is free software; you can redistribute it and/or             
00020 // modify it under the terms of the GNU Lesser General Public                
00021 // License as published by the Free Software Foundation; either              
00022 // version 2.1 of the License, or (at your option) any later version.        
00023 //                                                                           
00024 // This library is distributed in the hope that it will be useful,           
00025 // but WITHOUT ANY WARRANTY; without even the implied warranty of            
00026 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU         
00027 // Lesser General Public License for more details.                           
00028 //                                                                           
00029 // You should have received a copy of the GNU Lesser General Public          
00030 // License along with this library; if not, write to the Free Software       
00031 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
00032 //*******************************************************************************
00033 //  $Id: TCDefines.h 859 2008-07-01 12:14:15Z the_____tiger $
00034 //*******************************************************************************
00035 #ifndef _TC_DEFINES_H_
00036 #define _TC_DEFINES_H_
00037 
00038 #ifdef _DEBUG
00039 #   ifndef DEBUG
00040 #       define DEBUG
00041 #   endif
00042 #endif
00043 
00056 // define TCOS_WINDOWS if WIN32
00057 #ifdef _WIN32
00058 
00059 #ifndef TCOS_WINDOWS
00060 #  define TCOS_WINDOWS 1
00061 #endif
00062 #define NOMINMAX
00063 #endif
00064 
00065 // We only support windows ce 4.*
00066 // define TCOS_WINCE_40 if _WIN32_WCE
00067 #ifdef _WIN32_WCE
00068 
00069 #define TCOS_WINCE_40 1
00070 #define TCOS_WINDOWS 1
00071 #endif
00072 
00073 // we define TCOS_POSIX
00074 #ifndef TCOS_WINDOWS
00075 
00076 #  define TCOS_POSIX 1
00077 #else
00078 #  ifndef _WIN32_WINNT
00079 #     define _WIN32_WINNT 0x0500
00080 #     define WINVER 0x0500
00081 #  endif
00082 #endif
00083 
00084 // ---------------------------------------------------------------
00085 // Version and build numbers
00086 // ---------------------------------------------------------------
00088 #define TCVERSION_STR   "1.4.0"
00089 
00090 #define TCPRODUCT_STR   "TCSystem"
00091 
00092 #define TCPRODUCT_ID_STR TCPRODUCT_STR "(" TCVERSION_STR ")"
00093 
00094 // ---------------------------------------------------------------
00095 // For DLL´s
00096 // ---------------------------------------------------------------
00097 #ifdef _MSC_VER
00098 #  define TC_EXPORT_DLL __declspec(dllexport)
00099 #  define TC_IMPORT_DLL __declspec(dllimport)
00100 #  define TC_DLL_LOCAL
00101 #elif defined _GNUC_
00102 #  if _GNUC_ > 3
00103 #     define TC_EXPORT_DLL __attribute__ ((visibility("default")))
00104 #  endif
00105 #  if _GNUC_ > 4
00106 #     define TC_DLL_LOCAL  __attribute__ ((visibility("hidden")))
00107 #  endif
00108 #else
00109 #endif
00110 
00111 #ifndef TC_DLL_LOCAL
00112 #  define TC_DLL_LOCAL
00113 #endif
00114 #ifndef TC_EXPORT_DLL
00115 #  define TC_EXPORT_DLL
00116 #endif
00117 #ifndef TC_IMPORT_DLL
00118 #  define TC_IMPORT_DLL
00119 #endif
00120 
00134 #ifdef TCBASE_EXPORTS
00135 #  define TCBASE_API TC_EXPORT_DLL
00136 #else
00137 
00138 #  define TCBASE_API TC_IMPORT_DLL
00139 #endif
00140 
00141 // ---------------------------------------------------------------
00142 // string formats
00143 // ---------------------------------------------------------------
00144 #ifdef TCOS_WINDOWS
00145 
00146 #  define TC_SINT64_FORMAT   "I64d"
00147 #  define TC_SINT64_WFORMAT L"I64d"
00148 
00149 #  define TC_UINT64_FORMAT   "I64u"
00150 #  define TC_UINT64_WFORMAT L"I64u"
00151 
00170 #  define TC_UINT64_VAL(val) (val##ui64)
00171 #  define TC_SINT64_VAL(val) (val##i64)
00172 
00173 #else
00174 #  define TC_SINT64_FORMAT   "lld"
00175 #  define TC_SINT64_WFORMAT L"lld"
00176 #  define TC_UINT64_FORMAT   "llu"
00177 #  define TC_UINT64_WFORMAT L"llu"
00178 
00179 #  define TC_UINT64_VAL(val) (val##ull)
00180 #  define TC_SINT64_VAL(val) (val##ll)
00181 #endif
00182 
00183 #if TCOS_WINDOWS 
00184 #  define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h
00185 
00186 #  ifdef _MSC_VER
00187 #     if _MSC_VER < 1300
00188 #        define TC_NO_FRIEND_TEMPLATES
00189 #     endif
00190       // 'stdext::_Unchecked_uninitialized_move' : decorated name length exceeded, name was truncated
00191 #     pragma warning (disable: 4503)
00192       // warning C4251: 'AnyClass::m_member' : class 'std::vector<_Ty>' needs to have dll-interface to be used by clients of class 'AnyClass'
00193 #     pragma warning (disable: 4251)
00194       // warning C4127: conditional expression is constant
00195 #     pragma warning (disable: 4127)
00196       // warning C4275: non dll-interface class 'AnyClass' used as base for dll-interface class 'AnyClass'
00197 #     pragma warning (disable: 4275)
00198 #   endif
00199 
00200 #endif
00201 
00206 #endif // _TC_DEFINES_H_
00207 

Copyright (c) Thomas Goessler 2003 - 2008