libdballe  6.8
odbcworkarounds.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005--2010 ARPA-SIM <urpsim@smr.arpa.emr.it>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
16  *
17  * Author: Enrico Zini <enrico@enricozini.com>
18  */
19 
20 #ifndef DBALLE_DB_ODBC_WORKAROUNDS_H
21 #define DBALLE_DB_ODBC_WORKAROUNDS_H
22 
23 #include <bits/wordsize.h>
24 
33 // This does not seem to be needed anymore, and it causes problems with
34 // oracle's ODBC driver. See:
35 // http://stackoverflow.com/questions/338609/binding-int64-sql-bigint-as-query-parameter-causes-error-during-execution-in-o
36 
37 // It is needed on Debian, though. TODO: check unixodbc versions
38 
39 #if __WORDSIZE == 64
40 #define DBALLE_SQL_C_SINT_TYPE long
41 #define DBALLE_SQL_C_UINT_TYPE unsigned long
42 #define DBALLE_SQL_C_SINT SQL_C_SBIGINT
43 #define DBALLE_SQL_C_UINT SQL_C_UBIGINT
44 #else
45 #define DBALLE_SQL_C_SINT_TYPE long
46 #define DBALLE_SQL_C_UINT_TYPE unsigned long
47 #define DBALLE_SQL_C_SINT SQL_C_SLONG
48 #define DBALLE_SQL_C_UINT SQL_C_ULONG
49 #endif
50 
51 #endif