check of the SQLLEN definition by the unixODBC version by SQLColAttribute.
authorHiroshi Saito <hiroshi@winpg.jp>
Tue, 1 Sep 2009 14:33:07 +0000 (14:33 +0000)
committerHiroshi Saito <hiroshi@winpg.jp>
Tue, 1 Sep 2009 14:33:07 +0000 (14:33 +0000)
per report Devrim GUNDUZ.

configure.ac
odbcapi30.c
odbcapi30w.c

index efac22d268fdb77dba371ad4c92137d6e3150802..bc9e9a52e61afb0370119ca9345765780f71c0fc 100644 (file)
@@ -71,6 +71,18 @@ if test "$with_unixodbc" = yes; then
             [Define to use wchar_t as SQLWCHAR in unixODBC])
 fi
 
+#
+# SQLCOLATTRIBUTE_SQLLEN check
+#
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+   [[#include <sql.h>>
+   SQLRETURN  SQL_API SQLColAttribute
+   (SQLHSTMT StatementHandle,SQLUSMALLINT ColumnNumber,
+   SQLUSMALLINT FieldIdentifier, SQLPOINTER CharacterAttribute,
+   SQLSMALLINT BufferLength, SQLSMALLINT *StringLength, 
+   SQLLEN *NumercAttribute);]],[[]])],[],
+   AC_DEFINE(SQLCOLATTRIBUTE_SQLLEN, 1,
+   [Define to 1 if SQLColAttribute use SQLLEN]))
 
 #
 # ODBC include and library
index 2ace530810f0f86f60ce99aa609079b2349031ae..58a9da2ab5f07558e72f6667772fdd73968ac6a1 100644 (file)
@@ -118,12 +118,10 @@ SQLColAttribute(SQLHSTMT StatementHandle,
            SQLPOINTER CharacterAttribute,
            SQLSMALLINT BufferLength,
            SQLSMALLINT *StringLength,
-#if defined(_WIN64)
+#if defined(_WIN64) || defined(SQLCOLATTRIBUTE_SQLLEN)
            SQLLEN *NumericAttribute
-#elif defined(WITH_UNIXODBC) || defined(WIN32)
-           SQLPOINTER NumericAttribute
 #else
-           SQLLEN *NumericAttribute
+           SQLPOINTER NumericAttribute
 #endif
            )
 {
index def8cb5962bba8eb7c9581cede06a5ca3cbcad18..0728f9815aaebc3a4e2f1ac9fcbf3554886dca47 100644 (file)
@@ -262,10 +262,10 @@ SQLRETURN SQL_API SQLColAttributeW(
    SQLPOINTER  pCharAttr,
    SQLSMALLINT cbCharAttrMax,  
    SQLSMALLINT *pcbCharAttr,
-#if defined(WITH_UNIXODBC) || (defined(WIN32) && ! defined(_WIN64))
-   SQLPOINTER  pNumAttr
-#else
+#if defined(_WIN64) || defined(SQLCOLATTRIBUTE_SQLLEN)
    SQLLEN      *pNumAttr
+#else
+   SQLPOINTER  pNumAttr
 #endif
    )
 {