@@ -18,12 +18,15 @@ #import "OFDataArray.h" #import "OFExceptions.h" #import "OFMacros.h" -static size_t lastpagebyte = 0; -extern int getpagesize(void); +#ifdef _WIN32 +#include +#endif + +static int lastpagebyte = 0; @implementation OFDataArray + dataArrayWithItemSize: (size_t)is { return [[[self alloc] initWithItemSize: is] autorelease]; @@ -185,12 +188,21 @@ @implementation OFBigDataArray - initWithItemSize: (size_t)is { self = [super initWithItemSize: is]; - if (lastpagebyte == 0) - lastpagebyte = getpagesize() - 1; + if (lastpagebyte == 0) { +#ifndef _WIN32 + if ((lastpagebyte = sysconf(_SC_PAGESIZE)) == -1) + lastpagebyte = 4096; + lastpagebyte--; +#else + SYSTEM_INFO si; + GetSystemInfo(&si); + lastpagebyte = si.dwPageSize - 1; +#endif + } return self; } - addItem: (void*)item