Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members  

odbc++/setup.h

00001 /* 
00002    This file is part of libodbc++.
00003    
00004    Copyright (C) 1999-2000 Manush Dodunekov <manush@stendahls.net>
00005    
00006    This library is free software; you can redistribute it and/or
00007    modify it under the terms of the GNU Library General Public
00008    License as published by the Free Software Foundation; either
00009    version 2 of the License, or (at your option) any later version.
00010    
00011    This library is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014    Library General Public License for more details.
00015    
00016    You should have received a copy of the GNU Library General Public License
00017    along with this library; see the file COPYING.  If not, write to
00018    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00019    Boston, MA 02111-1307, USA.
00020 */
00021 
00022 #ifndef __ODBCXX_SETUP_H
00023 #define __ODBCXX_SETUP_H
00024 
00025 #if !defined(WIN32)
00026 # include <odbc++/config.h>
00027 #else
00028 # include <odbc++/config-win32.h>
00029 #endif
00030 
00031 
00032 #if defined(IN_ODBCXX) && defined(ODBCXX_ENABLE_THREADS)
00033 # if !defined(_REENTRANT)
00034 #  define _REENTRANT 1
00035 # endif
00036 # if !defined(_THREAD_SAFE)
00037 #  define _THREAD_SAFE 1
00038 # endif
00039 #endif
00040 
00041 // check if ODBCVER is forced to something
00042 #if defined(ODBCXX_ODBCVER)
00043 # define ODBCVER ODBCXX_ODBCVER
00044 #endif
00045 
00046 // this can confuse our Types::CHAR
00047 #ifdef CHAR
00048 #undef CHAR
00049 #endif
00050 
00051 // NDEBUG and cassert
00052 #if defined(IN_ODBCXX) 
00053 # if !defined(ODBCXX_DEBUG)
00054 #  define NDEBUG
00055 # endif
00056 # include <cassert>
00057 #endif
00058 
00059 // this should do the trick
00060 #if defined(__GNUC__) && __GNUC__>=3
00061 # define ODBCXX_HAVE_ISO_CXXLIB
00062 #endif
00063 
00064 
00065 #if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__MINGW32__)
00066 # if defined(ODBCXX_DLL)
00067 #  if defined(IN_ODBCXX)
00068 #   define ODBCXX_EXPORT __declspec(dllexport)
00069 #  else
00070 #   define ODBCXX_EXPORT __declspec(dllimport)
00071 #  endif
00072 # endif
00073 #endif
00074 
00075 #if !defined(ODBCXX_EXPORT)
00076 # define ODBCXX_EXPORT
00077 #endif
00078 
00079 #if defined(_MSC_VER) || defined(__MINGW32__)
00080 # define ODBCXX_DUMMY_RETURN(x) return (x)
00081 #else
00082 # define ODBCXX_DUMMY_RETURN(x) ((void)0)
00083 #endif
00084 
00085 
00086 // environment abstractions
00087 
00088 #if defined(ODBCXX_QT)
00089 
00090 # define ODBCXX_STRING QString
00091 # define ODBCXX_STRING_C(s) QString::fromLocal8Bit(s)
00092 # define ODBCXX_STRING_CL(s,l) QString::fromLocal8Bit(s,l)
00093 # define ODBCXX_STRING_LEN(s) s.length()
00094 # define ODBCXX_STRING_DATA(s) s.local8Bit().data()
00095 # define ODBCXX_STRING_CSTR(s) s.local8Bit().data()
00096 
00097 # define ODBCXX_STREAM QIODevice
00098 
00099 # define ODBCXX_BYTES QByteArray
00100 # define ODBCXX_BYTES_SIZE(b) b.size()
00101 # define ODBCXX_BYTES_DATA(b) b.data()
00102 # define ODBCXX_BYTES_C(buf,len) QByteArray().duplicate(buf,len)
00103 
00104 #else
00105 
00106 # define ODBCXX_STRING std::string
00107 # define ODBCXX_STRING_C(s) std::string(s)
00108 # define ODBCXX_STRING_CL(s,l) std::string(s,l)
00109 # define ODBCXX_STRING_LEN(s) s.length()
00110 # define ODBCXX_STRING_DATA(s) s.data()
00111 # define ODBCXX_STRING_CSTR(s) s.c_str()
00112 
00113 # define ODBCXX_STREAM std::istream
00114 
00115 # define ODBCXX_BYTES odbc::Bytes
00116 # define ODBCXX_BYTES_SIZE(b) b.getSize()
00117 # define ODBCXX_BYTES_DATA(b) b.getData()
00118 # define ODBCXX_BYTES_C(buf,len) odbc::Bytes((signed char*)buf,(size_t)len)
00119 
00120 #endif // ODBCXX_QT
00121 
00122 
00123 #endif // __ODBCXX_SETUP_H

Go back to the freeodbc++ homepage