Skip to content

Commit

Permalink
mingw: use GetSystemInfo to retrieve page size
Browse files Browse the repository at this point in the history
  • Loading branch information
theodelrieu committed Oct 16, 2019
1 parent dfbea03 commit cceb155
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion include/boost/thread/pthread/thread_data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
# endif
#endif

#ifdef __MINGW32__
#include <sysinfoapi.h>
#endif

#include <pthread.h>
#include <unistd.h>

Expand All @@ -52,7 +56,11 @@ namespace boost
// stack
void set_stack_size(std::size_t size) BOOST_NOEXCEPT {
if (size==0) return;
#ifdef BOOST_THREAD_USES_GETPAGESIZE
#ifdef __MINGW32__
SYSTEM_INFO si;
GetSystemInfo(&si);
std::size_t page_size = si.dwPageSize;
#elif defined(BOOST_THREAD_USES_GETPAGESIZE)
std::size_t page_size = getpagesize();
#else
std::size_t page_size = ::sysconf( _SC_PAGESIZE);
Expand Down

0 comments on commit cceb155

Please sign in to comment.