00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
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
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
00055 #if defined(ODBCXX_ODBCVER)
00056 # define ODBCVER ODBCXX_ODBCVER
00057 #endif
00058
00059
00060 #ifdef CHAR
00061 #undef CHAR
00062 #endif
00063
00064
00065 #if defined(IN_ODBCXX)
00066 # if !defined(ODBCXX_DEBUG)
00067 # define NDEBUG
00068 # endif
00069 # include <cassert>
00070 #endif
00071
00072
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
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