Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
setup.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file setup.h
1 /*
2  This file is part of libodbc++.
3 
4  Copyright (C) 1999-2000 Manush Dodunekov <manush@stendahls.net>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License as published by the Free Software Foundation; either
9  version 2 of the License, or (at your option) any later version.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Library General Public License for more details.
15 
16  You should have received a copy of the GNU Library General Public License
17  along with this library; see the file COPYING. If not, write to
18  the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19  Boston, MA 02111-1307, USA.
20 */
21 
22 #ifndef __ODBCXX_SETUP_H
23 #define __ODBCXX_SETUP_H
24 
25 #if !defined(WIN32)
26 # include <RDBC/odbc++/config.h>
27 #else
29 #endif
30 
31 
32 #if defined(IN_ODBCXX) && defined(ODBCXX_ENABLE_THREADS)
33 # if !defined(_REENTRANT)
34 # define _REENTRANT 1
35 # endif
36 # if !defined(_THREAD_SAFE)
37 # define _THREAD_SAFE 1
38 # endif
39 #endif
40 
41 // check if ODBCVER is forced to something
42 #if defined(ODBCXX_ODBCVER)
43 # define ODBCVER ODBCXX_ODBCVER
44 #endif
45 
46 // this can confuse our Types::CHAR
47 #ifdef CHAR
48 #undef CHAR
49 #endif
50 
51 // NDEBUG and cassert
52 #if defined(IN_ODBCXX)
53 # if !defined(ODBCXX_DEBUG)
54 # define NDEBUG
55 # endif
56 # include <cassert>
57 #endif
58 
59 // this should do the trick
60 #if defined(__GNUC__) && __GNUC__>=3
61 # define ODBCXX_HAVE_ISO_CXXLIB
62 #endif
63 
64 
65 #if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__MINGW32__)
66 # if defined(ODBCXX_DLL)
67 # if defined(IN_ODBCXX)
68 # define ODBCXX_EXPORT __declspec(dllexport)
69 # else
70 # define ODBCXX_EXPORT __declspec(dllimport)
71 # endif
72 # endif
73 #endif
74 
75 #if !defined(ODBCXX_EXPORT)
76 # define ODBCXX_EXPORT
77 #endif
78 
79 #if defined(_MSC_VER) || defined(__MINGW32__)
80 # define ODBCXX_DUMMY_RETURN(x) return (x)
81 #else
82 # define ODBCXX_DUMMY_RETURN(x) ((void)0)
83 #endif
84 
85 
86 // environment abstractions
87 
88 #if defined(ODBCXX_QT)
89 
90 # define ODBCXX_STRING QString
91 # define ODBCXX_STRING_C(s) QString::fromLocal8Bit(s)
92 # define ODBCXX_STRING_CL(s,l) QString::fromLocal8Bit(s,l)
93 # define ODBCXX_STRING_LEN(s) s.length()
94 # define ODBCXX_STRING_DATA(s) s.local8Bit().data()
95 # define ODBCXX_STRING_CSTR(s) s.local8Bit().data()
96 
97 # define ODBCXX_STREAM QIODevice
98 
99 # define ODBCXX_BYTES QByteArray
100 # define ODBCXX_BYTES_SIZE(b) b.size()
101 # define ODBCXX_BYTES_DATA(b) b.data()
102 # define ODBCXX_BYTES_C(buf,len) QByteArray().duplicate(buf,len)
103 
104 #else
105 
106 # define ODBCXX_STRING std::string
107 # define ODBCXX_STRING_C(s) std::string(s)
108 # define ODBCXX_STRING_CL(s,l) std::string(s,l)
109 # define ODBCXX_STRING_LEN(s) s.length()
110 # define ODBCXX_STRING_DATA(s) s.data()
111 # define ODBCXX_STRING_CSTR(s) s.c_str()
112 
113 # define ODBCXX_STREAM std::istream
114 
115 # define ODBCXX_BYTES odbc::Bytes
116 # define ODBCXX_BYTES_SIZE(b) b.getSize()
117 # define ODBCXX_BYTES_DATA(b) b.getData()
118 # define ODBCXX_BYTES_C(buf,len) odbc::Bytes((signed char*)buf,(size_t)len)
119 
120 #endif // ODBCXX_QT
121 
122 
123 #endif // __ODBCXX_SETUP_H