Fix for 64bit linux - size_t isn't always Poco::UInt32

This commit is contained in:
Marian Krivos 2009-03-08 18:57:55 +00:00
parent c4f6084c25
commit aaa3b1b274
6 changed files with 26 additions and 23 deletions

View File

@ -3,6 +3,7 @@ set(LIBNAMED "${LIBNAME}d")
set(SRCS "") set(SRCS "")
aux_source_directory(src SRCS) aux_source_directory(src SRCS)
include_directories( SQLite/include )
add_library( ${LIBNAME} ${LIB_MODE} ${SRCS} ) add_library( ${LIBNAME} ${LIB_MODE} ${SRCS} )
set_target_properties( ${LIBNAME} set_target_properties( ${LIBNAME}
@ -36,9 +37,11 @@ endif(MYSQL_FOUND)
include(../contrib/cmake/FindODBC.cmake) include(../contrib/cmake/FindODBC.cmake)
if(NOT ODBC_CONFIG-NOT_FOUND) if(${ODBC_CONFIG} MATCHES "ODBC_CONFIG-NOTFOUND")
message("ODBC Support Disabled - no ODBC runtime")
else(${ODBC_CONFIG} MATCHES "ODBC_CONFIG-NOTFOUND")
add_subdirectory( ODBC ) add_subdirectory( ODBC )
endif(ODBC_CONFIG) endif(${ODBC_CONFIG} MATCHES "ODBC_CONFIG-NOTFOUND")
add_subdirectory( samples ) add_subdirectory( samples )
add_subdirectory( testsuite ) add_subdirectory( testsuite )

View File

@ -73,7 +73,7 @@ namespace Data {
namespace ODBC { namespace ODBC {
#if defined(POCO_PTR_IS_64_BIT) || defined(POCO_UNIXODBC) // mkrivos - unixodbc+linux32 doesn't compile with SQLPOINTER & SQLColAttribute() #if defined(POCO_PTR_IS_64_BIT) || defined(POCO_OS_FAMILY_UNIX) // mkrivos - POCO_OS_FAMILY_UNIX doesn't compile with SQLPOINTER & SQLColAttribute()
typedef SQLLEN* NumAttrPtrType; typedef SQLLEN* NumAttrPtrType;
#else #else
typedef SQLPOINTER NumAttrPtrType; typedef SQLPOINTER NumAttrPtrType;

View File

@ -272,7 +272,7 @@ public:
Statement& operator , (Poco::Int16 value); Statement& operator , (Poco::Int16 value);
/// Adds the value to the list of values to be supplied to the SQL string formatting function. /// Adds the value to the list of values to be supplied to the SQL string formatting function.
Statement& operator , (std::size_t value); Statement& operator , (Poco::UInt32 value);
/// Adds the value to the list of values to be supplied to the SQL string formatting function. /// Adds the value to the list of values to be supplied to the SQL string formatting function.
Statement& operator , (Poco::Int32 value); Statement& operator , (Poco::Int32 value);
@ -563,7 +563,7 @@ inline Statement& Statement::operator , (Poco::Int16 value)
} }
inline Statement& Statement::operator , (std::size_t value) inline Statement& Statement::operator , (Poco::UInt32 value)
{ {
return commaPODImpl(value); return commaPODImpl(value);
} }

View File

@ -86,13 +86,13 @@ void TestStatementImpl::bindImpl()
} }
Poco::UInt32 TestStatementImpl::columnsReturned() const std::size_t TestStatementImpl::columnsReturned() const
{ {
return 0; return 0;
} }
const MetaColumn& TestStatementImpl::metaColumn(Poco::UInt32 pos) const const MetaColumn& TestStatementImpl::metaColumn(std::size_t pos) const
{ {
static MetaColumn c(pos, "", MetaColumn::FDT_BOOL, 0); static MetaColumn c(pos, "", MetaColumn::FDT_BOOL, 0);
return c; return c;
@ -105,7 +105,7 @@ bool TestStatementImpl::hasNext()
} }
Poco::UInt32 TestStatementImpl::next() std::size_t TestStatementImpl::next()
{ {
Poco::Data::AbstractExtractionVec::iterator it = extractions().begin(); Poco::Data::AbstractExtractionVec::iterator it = extractions().begin();
Poco::Data::AbstractExtractionVec::iterator itEnd = extractions().end(); Poco::Data::AbstractExtractionVec::iterator itEnd = extractions().end();

View File

@ -63,20 +63,20 @@ public:
/// Destroys the TestStatementImpl. /// Destroys the TestStatementImpl.
protected: protected:
Poco::UInt32 columnsReturned() const; std::size_t columnsReturned() const;
/// Returns number of columns returned by query. /// Returns number of columns returned by query.
Poco::UInt32 affectedRowCount() const; std::size_t affectedRowCount() const;
/// Returns the number of affected rows. /// Returns the number of affected rows.
/// Used to find out the number of rows affected by insert or update. /// Used to find out the number of rows affected by insert or update.
const MetaColumn& metaColumn(Poco::UInt32 pos) const; const MetaColumn& metaColumn(std::size_t pos) const;
/// Returns column meta data. /// Returns column meta data.
bool hasNext(); bool hasNext();
/// Returns true if a call to next() will return data. /// Returns true if a call to next() will return data.
Poco::UInt32 next(); std::size_t next();
/// Retrieves the next row or set of rows from the resultset. /// Retrieves the next row or set of rows from the resultset.
/// Will throw, if the resultset is empty. /// Will throw, if the resultset is empty.
@ -121,7 +121,7 @@ inline AbstractBinder& TestStatementImpl::binder()
} }
inline Poco::UInt32 TestStatementImpl::affectedRowCount() const inline std::size_t TestStatementImpl::affectedRowCount() const
{ {
return 0; return 0;
} }

View File

@ -5,33 +5,33 @@ find_program(ODBC_CONFIG odbc_config
/usr/local/bin /usr/local/bin
PATHS) PATHS)
if(ODBC_CONFIG-NOT_FOUND) if(${ODBC_CONFIG} MATCHES "ODBC_CONFIG-NOTFOUND")
message(STATUS "Couldn't find unixODBC") message(STATUS "Couldn't find unixODBC")
else(NOT ODBC_CONFIG) else(${ODBC_CONFIG} MATCHES "ODBC_CONFIG-NOTFOUND")
message(STATUS "Found unixODBC: odbc_config in ${ODBC_CONFIG}") message(STATUS "Found unixODBC: odbc_config in ${ODBC_CONFIG}")
exec_program(${ODBC_CONFIG} ARGS "--include-prefix" OUTPUT_VARIABLE ODBC_INCLUDE_DIR) exec_program(${ODBC_CONFIG} ARGS "--include-prefix" OUTPUT_VARIABLE ODBC_INCLUDE_DIR)
include_directories(${ODBC_INCLUDE_DIR}) include_directories(${ODBC_INCLUDE_DIR})
exec_program(${ODBC_CONFIG} ARGS "--libs" OUTPUT_VARIABLE ODBC_LINK_FLAGS) exec_program(${ODBC_CONFIG} ARGS "--libs" OUTPUT_VARIABLE ODBC_LINK_FLAGS)
add_definitions(-DPOCO_UNIXODBC) add_definitions(-DPOCO_UNIXODBC)
endif(ODBC_CONFIG-NOT_FOUND) endif(${ODBC_CONFIG} MATCHES "ODBC_CONFIG-NOTFOUND")
if(ODBC_CONFIG-NOT_FOUND) if(${ODBC_CONFIG} MATCHES "ODBC_CONFIG-NOTFOUND")
find_program(ODBC_CONFIG iodbc-config find_program(ODBC_CONFIG iodbc-config
$ENV{ODBC_PATH}/bin $ENV{ODBC_PATH}/bin
/usr/bin /usr/bin
/usr/local/bin /usr/local/bin
PATHS) PATHS)
if(ODBC_CONFIG-NOT_FOUND) if(${ODBC_CONFIG} MATCHES "ODBC_CONFIG-NOTFOUND")
message(STATUS "Couldn't find iODBC") message(STATUS "Couldn't find iODBC")
else(ODBC_CONFIG-NOT_FOUND) else(${ODBC_CONFIG} MATCHES "ODBC_CONFIG-NOTFOUND")
message(STATUS "Found iODBC: iodbc-config in ${ODBC_CONFIG}") message(STATUS "Found iODBC: iodbc-config in ${ODBC_CONFIG}")
exec_program(${ODBC_CONFIG} ARGS "--cflags" OUTPUT_VARIABLE ODBC_CFLAGS) exec_program(${ODBC_CONFIG} ARGS "--cflags" OUTPUT_VARIABLE ODBC_CFLAGS)
add_definitions( ${ODBC_CFLAGS} ) add_definitions( ${ODBC_CFLAGS} )
exec_program(${ODBC_CONFIG} ARGS "--libs" OUTPUT_VARIABLE ODBC_LINK_FLAGS) exec_program(${ODBC_CONFIG} ARGS "--libs" OUTPUT_VARIABLE ODBC_LINK_FLAGS)
add_definitions(-DPOCO_IODBC) add_definitions(-DPOCO_IODBC)
endif(ODBC_CONFIG-NOT_FOUND) endif(${ODBC_CONFIG} MATCHES "ODBC_CONFIG-NOTFOUND")
endif(ODBC_CONFIG-NOT_FOUND) endif(${ODBC_CONFIG} MATCHES "ODBC_CONFIG-NOTFOUND")
if(ODBC_CONFIG-NOT_FOUND) if(${ODBC_CONFIG} MATCHES "ODBC_CONFIG-NOTFOUND")
#try odbc32.lib on windows #try odbc32.lib on windows
endif(ODBC_CONFIG-NOT_FOUND) endif(${ODBC_CONFIG} MATCHES "ODBC_CONFIG-NOTFOUND")