Fedora Core9/g++ 4.3.0 compilations fixes

This commit is contained in:
Aleksandar Fabijanic
2008-06-03 20:51:10 +00:00
parent e2fafc6404
commit cb234f14ac
4 changed files with 10 additions and 6 deletions

View File

@@ -42,6 +42,7 @@
#include "Poco/NotificationStrategy.h"
#include <map>
#include <list>
#include <memory>
namespace Poco {

View File

@@ -153,14 +153,14 @@ int ThreadImpl::getMaxOSPriorityImpl()
void ThreadImpl::setStackSizeImpl(int size)
{
#if (POCO_OS == POCO_OS_CYGWIN)
#ifndef PTHREAD_STACK_MIN
_pData->stackSize = 0;
#else
if (size !=0 && size < PTHREAD_STACK_MIN)
size = PTHREAD_STACK_MIN;
_pData->stackSize = size;
#endif // (POCO_OS == POCO_OS_CYGWIN)
#endif // PTHREAD_STACK_MIN
}

View File

@@ -40,7 +40,7 @@
#include "Poco/Buffer.h"
#include <iostream>
#include <vector>
#include <memory.h>
#include <cstring>
using Poco::Bugcheck;

View File

@@ -269,9 +269,12 @@ void ThreadTest::testThreadFunction()
void ThreadTest::testThreadStackSize()
{
int stackSize = 50000000;
// some platforms (e.g. Fedora Core9/g++ 4.3.0) ignore set stack size value
// so some asserts will fail here
int stackSize = 50000000;
Thread thread;
assert (0 == thread.getStackSize());
thread.setStackSize(stackSize);
assert (stackSize == thread.getStackSize());
@@ -282,11 +285,11 @@ void ThreadTest::testThreadStackSize()
stackSize = 1;
thread.setStackSize(stackSize);
#if defined(POCO_OS_FAMILY_UNIX) && !(POCO_OS == POCO_OS_CYGWIN)
#ifdef PTHREAD_STACK_MIN
assert (PTHREAD_STACK_MIN == thread.getStackSize());
#else
assert (stackSize == thread.getStackSize());
#endif
#endif // PTHREAD_STACK_MIN
tmp = MyRunnable::_staticVar;
thread.start(freeFunc, &tmp);
thread.join();