Commit b3029c67 authored by Pavel Vainerman's avatar Pavel Vainerman

Добавил "грубое" определение версии libpoco, для возможности

компилировать в ubuntu со старой версией libpoco (<1.7.4). (Нужно для компиляции в travis-ci.org)
parent 46a4232c
......@@ -489,6 +489,7 @@ mv -f %buildroot%python_sitelibdir_noarch/* %buildroot%python_sitelibdir/%oname
* Thu Sep 08 2016 Pavel Vainerman <pv@altlinux.ru> 2.5-alt11
- DebugStream: added support format: level1,level2,-level3
for set or delete debug levels.
- add support old version of libpoco (version < 1.7.4)
* Wed Sep 07 2016 Pavel Vainerman <pv@altlinux.ru> 2.5-alt10
- fixed bug in millisecToPoco() function
......
......@@ -63,6 +63,11 @@ POCO_LIBS="-lPocoFoundation -lPocoNet"
POCO_CFLAGS="-IPoco"
AC_SUBST(POCO_LIBS)
AC_SUBST(POCO_CFLAGS)
poco_old=
AC_CHECK_HEADERS([Poco/Version.h],,poco_old=1)
if test -n "$poco_old"; then
POCO_CFLAGS="${POCO_CFLAGS} -DPOCO_OLD_VERSION"
fi
#check sqlite support
AC_MSG_CHECKING([sqlite support])
......
......@@ -113,8 +113,13 @@ void UniSetTimer::stop()
//------------------------------------------------------------------------------
const Poco::Timespan UniSetTimer::millisecToPoco( const timeout_t msec )
{
#ifdef POCO_OLD_VERSION
if( msec == WaitUpTime )
return Poco::Timespan(std::numeric_limits<long>::max(),0);
#else
if( msec == WaitUpTime )
return Poco::Timespan(Poco::Timestamp::TIMEVAL_MAX,0);
#endif
// msec --> usec
return Poco::Timespan( long(msec/1000), long((msec*1000)%1000000) );
......@@ -122,8 +127,13 @@ const Poco::Timespan UniSetTimer::millisecToPoco( const timeout_t msec )
//------------------------------------------------------------------------------
const Poco::Timespan UniSetTimer::microsecToPoco( const timeout_t usec )
{
#ifdef POCO_OLD_VERSION
if( usec == WaitUpTime )
return Poco::Timespan(std::numeric_limits<long>::max(),0);
#else
if( usec == WaitUpTime )
return Poco::Timespan(Poco::Timestamp::TIMEVAL_MAX,0);
#endif
return Poco::Timespan( long(usec/1000000), long(usec%1000000) );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment