Subject: | ODBC for cygwin using iodbc, fix wrong types |
See ChangeLog in patch.
* ODBC/ODBC.xs: use iodbcinst.h with CYGWIN
helps if the MSVC includes are not pulled in
* ODBC/ODBC.xs (_NT_ODBC_Error): use the correct
SQLINTEGER, ... types in SQLError and not the wrong from MSVC.
checked against MSVC6. cygwin with iodbcinst.h complains about not being able to convert from (long *) to (SQLINTEGER *)
TODO: It would be fine to check in Makefile.PL which odbc header
to use, the MS or the iodbc one.
All tests passed.
2005-09-18 11:15:17 rurban@x-ray.at
* ODBC/ODBC.xs: use iodbcinst.h with CYGWIN
* ODBC/ODBC.xs (_NT_ODBC_Error): use the correct
SQLINTEGER, ... types in SQLError and not the wrong from MSVC.
--- ODBC/ODBC.xs.orig 2005-09-17 20:36:36.000000000 +0000
+++ ODBC/ODBC.xs 2005-09-18 09:07:47.686000000 +0000
@@ -30,9 +30,13 @@
#include <stdio.h>
// ODBC Stuff
+#ifdef __CYGWIN__
+#include <iodbcinst.h>
+#else
#include <sql.h>
#include <sqlext.h>
#include <odbcinst.h>
+#endif
// Win32 Perl Stuff
#if defined(__cplusplus)
@@ -366,7 +370,7 @@
}
strcpy((char *)h->Error->szSqlState, "");
strcpy(h->Error->szError, "");
- SQLError(h->henv, h->hdbc->hdbc, h->hstmt, (UCHAR *)h->Error->szSqlState, (long *)&(h->Error->ErrNum), (unsigned char *)h->Error->szError, ODBC_BUFF_SIZE, (short *)&cbErrorMsg);
+ SQLError(h->henv, h->hdbc->hdbc, h->hstmt, (SQLCHAR *)h->Error->szSqlState, (SQLINTEGER *)&(h->Error->ErrNum), (SQLCHAR *)h->Error->szError, ODBC_BUFF_SIZE, (SQLSMALLINT *)&cbErrorMsg);
// Next couple of lines should be NOT needed. If there is no error, then
// we should not have come here in the first place. If, however, there