mirror of
https://github.com/pocoproject/poco.git
synced 2024-12-12 18:20:26 +01:00
Fix for 64bit linux - size_t isn't always Poco::UInt32
This commit is contained in:
parent
c4f6084c25
commit
aaa3b1b274
@ -3,6 +3,7 @@ set(LIBNAMED "${LIBNAME}d")
|
||||
|
||||
set(SRCS "")
|
||||
aux_source_directory(src SRCS)
|
||||
include_directories( SQLite/include )
|
||||
|
||||
add_library( ${LIBNAME} ${LIB_MODE} ${SRCS} )
|
||||
set_target_properties( ${LIBNAME}
|
||||
@ -36,9 +37,11 @@ endif(MYSQL_FOUND)
|
||||
|
||||
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 )
|
||||
endif(ODBC_CONFIG)
|
||||
endif(${ODBC_CONFIG} MATCHES "ODBC_CONFIG-NOTFOUND")
|
||||
|
||||
add_subdirectory( samples )
|
||||
add_subdirectory( testsuite )
|
||||
|
@ -73,7 +73,7 @@ namespace Data {
|
||||
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;
|
||||
#else
|
||||
typedef SQLPOINTER NumAttrPtrType;
|
||||
|
@ -272,7 +272,7 @@ public:
|
||||
Statement& operator , (Poco::Int16 value);
|
||||
/// 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.
|
||||
|
||||
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);
|
||||
}
|
||||
|
@ -86,13 +86,13 @@ void TestStatementImpl::bindImpl()
|
||||
}
|
||||
|
||||
|
||||
Poco::UInt32 TestStatementImpl::columnsReturned() const
|
||||
std::size_t TestStatementImpl::columnsReturned() const
|
||||
{
|
||||
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);
|
||||
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 itEnd = extractions().end();
|
||||
|
@ -63,20 +63,20 @@ public:
|
||||
/// Destroys the TestStatementImpl.
|
||||
|
||||
protected:
|
||||
Poco::UInt32 columnsReturned() const;
|
||||
std::size_t columnsReturned() const;
|
||||
/// Returns number of columns returned by query.
|
||||
|
||||
Poco::UInt32 affectedRowCount() const;
|
||||
std::size_t affectedRowCount() const;
|
||||
/// Returns the number of affected rows.
|
||||
/// 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.
|
||||
|
||||
bool hasNext();
|
||||
/// 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.
|
||||
/// 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;
|
||||
}
|
||||
|
@ -5,33 +5,33 @@ find_program(ODBC_CONFIG odbc_config
|
||||
/usr/local/bin
|
||||
PATHS)
|
||||
|
||||
if(ODBC_CONFIG-NOT_FOUND)
|
||||
if(${ODBC_CONFIG} MATCHES "ODBC_CONFIG-NOTFOUND")
|
||||
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}")
|
||||
exec_program(${ODBC_CONFIG} ARGS "--include-prefix" OUTPUT_VARIABLE ODBC_INCLUDE_DIR)
|
||||
include_directories(${ODBC_INCLUDE_DIR})
|
||||
exec_program(${ODBC_CONFIG} ARGS "--libs" OUTPUT_VARIABLE ODBC_LINK_FLAGS)
|
||||
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
|
||||
$ENV{ODBC_PATH}/bin
|
||||
/usr/bin
|
||||
/usr/local/bin
|
||||
PATHS)
|
||||
if(ODBC_CONFIG-NOT_FOUND)
|
||||
if(${ODBC_CONFIG} MATCHES "ODBC_CONFIG-NOTFOUND")
|
||||
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}")
|
||||
exec_program(${ODBC_CONFIG} ARGS "--cflags" OUTPUT_VARIABLE ODBC_CFLAGS)
|
||||
add_definitions( ${ODBC_CFLAGS} )
|
||||
exec_program(${ODBC_CONFIG} ARGS "--libs" OUTPUT_VARIABLE ODBC_LINK_FLAGS)
|
||||
add_definitions(-DPOCO_IODBC)
|
||||
endif(ODBC_CONFIG-NOT_FOUND)
|
||||
endif(ODBC_CONFIG-NOT_FOUND)
|
||||
endif(${ODBC_CONFIG} MATCHES "ODBC_CONFIG-NOTFOUND")
|
||||
endif(${ODBC_CONFIG} MATCHES "ODBC_CONFIG-NOTFOUND")
|
||||
|
||||
if(ODBC_CONFIG-NOT_FOUND)
|
||||
if(${ODBC_CONFIG} MATCHES "ODBC_CONFIG-NOTFOUND")
|
||||
#try odbc32.lib on windows
|
||||
endif(ODBC_CONFIG-NOT_FOUND)
|
||||
endif(${ODBC_CONFIG} MATCHES "ODBC_CONFIG-NOTFOUND")
|
||||
|
Loading…
Reference in New Issue
Block a user