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

/trees/alex/src/libodbc++/include/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__) && !defined(WIN32)
00026 # define WIN32 1
00027 #endif
00028 
00029 #if !defined(WIN32)
00030 # include <odbc++/config.h>
00031 #else
00032 # include <odbc++/config-win32.h>
00033 #endif
00034 
00035 
00036 #if defined(IN_ODBCXX) && defined(ODBCXX_ENABLE_THREADS)
00037 # if !defined(_REENTRANT)
00038 #  define _REENTRANT 1
00039 # endif
00040 # if !defined(_THREAD_SAFE)
00041 #  define _THREAD_SAFE 1
00042 # endif
00043 #endif
00044 
00045 // check whether we use strstream or stringstream
00046 #if defined(IN_ODBCXX)
00047 # if defined(ODBCXX_HAVE_SSTREAM)
00048 #  define ODBCXX_SSTREAM std::stringstream
00049 # else
00050 #  define ODBCXX_SSTREAM std::strstream
00051 # endif
00052 #endif
00053 
00054 // check if ODBCVER is forced to something
00055 #if defined(ODBCXX_ODBCVER)
00056 # define ODBCVER ODBCXX_ODBCVER
00057 #endif
00058 
00059 // this can confuse our Types::CHAR
00060 #ifdef CHAR
00061 #undef CHAR
00062 #endif
00063 
00064 // NDEBUG and cassert
00065 #if defined(IN_ODBCXX) 
00066 # if !defined(ODBCXX_DEBUG)
00067 #  define NDEBUG
00068 # endif
00069 # include <cassert>
00070 #endif
00071 
00072 // this should do the trick
00073 #if defined(__GNUC__) && __GNUC__>=3
00074 # define ODBCXX_HAVE_ISO_CXXLIB
00075 #endif
00076 
00077 
00078 #if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__MINGW32__)
00079 # if defined(ODBCXX_DLL)
00080 #  if defined(IN_ODBCXX)
00081 #   define ODBCXX_EXPORT __declspec(dllexport)
00082 #  else
00083 #   define ODBCXX_EXPORT __declspec(dllimport)
00084 #  endif
00085 # endif
00086 #endif
00087 
00088 #if !defined(ODBCXX_EXPORT)
00089 # define ODBCXX_EXPORT
00090 #endif
00091 
00092 #if defined(_MSC_VER) || defined(__MINGW32__)
00093 # define ODBCXX_DUMMY_RETURN(x) return (x)
00094 #else
00095 # define ODBCXX_DUMMY_RETURN(x) ((void)0)
00096 #endif
00097 
00098 
00099 // environment abstractions
00100 
00101 #if defined(ODBCXX_QT)
00102 
00103 # define ODBCXX_STRING QString
00104 # define ODBCXX_STRING_C(s) QString::fromLocal8Bit(s)
00105 # define ODBCXX_STRING_CL(s,l) QString::fromLocal8Bit(s,l)
00106 # define ODBCXX_STRING_LEN(s) s.length()
00107 # define ODBCXX_STRING_DATA(s) s.local8Bit().data()
00108 # define ODBCXX_STRING_CSTR(s) s.local8Bit().data()
00109 
00110 # define ODBCXX_STREAM QIODevice
00111 
00112 # define ODBCXX_BYTES QByteArray
00113 # define ODBCXX_BYTES_SIZE(b) b.size()
00114 # define ODBCXX_BYTES_DATA(b) b.data()
00115 # define ODBCXX_BYTES_C(buf,len) QByteArray().duplicate(buf,len)
00116 
00117 #else
00118 
00119 # define ODBCXX_STRING std::string
00120 # define ODBCXX_STRING_C(s) std::string(s)
00121 # define ODBCXX_STRING_CL(s,l) std::string(s,l)
00122 # define ODBCXX_STRING_LEN(s) s.length()
00123 # define ODBCXX_STRING_DATA(s) s.data()
00124 # define ODBCXX_STRING_CSTR(s) s.c_str()
00125 
00126 # define ODBCXX_STREAM std::istream
00127 
00128 # define ODBCXX_BYTES odbc::Bytes
00129 # define ODBCXX_BYTES_SIZE(b) b.getSize()
00130 # define ODBCXX_BYTES_DATA(b) b.getData()
00131 # define ODBCXX_BYTES_C(buf,len) odbc::Bytes((signed char*)buf,(size_t)len)
00132 
00133 #endif // ODBCXX_QT
00134 
00135 
00136 #endif // __ODBCXX_SETUP_H

Go back to the freeodbc++ homepage