Skip to content

Commit e5d50b4

Browse files
committed
mingw: use GetSystemInfo to retrieve page size
1 parent c0874b6 commit e5d50b4

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

include/boost/thread/pthread/thread_data.hpp

+9-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@
3232
# endif
3333
#endif
3434

35+
#ifdef __MINGW32__
36+
#include <sysinfoapi.h>
37+
#endif
38+
3539
#include <pthread.h>
3640
#include <unistd.h>
3741

@@ -52,7 +56,11 @@ namespace boost
5256
// stack
5357
void set_stack_size(std::size_t size) BOOST_NOEXCEPT {
5458
if (size==0) return;
55-
#ifdef BOOST_THREAD_USES_GETPAGESIZE
59+
#ifdef __MINGW32__
60+
SYSTEM_INFO si;
61+
GetSystemInfo(&si);
62+
std::size_t page_size = si.dwPageSize;
63+
#elif defined(BOOST_THREAD_USES_GETPAGESIZE)
5664
std::size_t page_size = getpagesize();
5765
#else
5866
std::size_t page_size = ::sysconf( _SC_PAGESIZE);

0 commit comments

Comments
 (0)