]> pd.if.org Git - pdclib/blobdiff - platform/example/functions/_PDCLIB/_PDCLIB_allocpages.c
Inlined some of the Cygwin patches. Not nice, but useful as I keep switching platforms.
[pdclib] / platform / example / functions / _PDCLIB / _PDCLIB_allocpages.c
index 9de9314ea64cc733de4ec3c02dbb73167902e158..c24a6c0a2ac226900bb42ce558a10a677a72d491 100644 (file)
@@ -42,7 +42,11 @@ void * _PDCLIB_allocpages( int const n )
     /* increasing or decreasing heap - standard operation */
     void * oldbreak = membreak;
     membreak = (void *)( (char *)membreak + ( n * _PDCLIB_PAGESIZE ) );
+#ifdef __CYGWIN__
+    if ( sbrk( (char*)membreak - (char*)oldbreak ) == membreak )
+#else
     if ( brk( membreak ) == 0 )
+#endif
     {
         /* successful */
         return oldbreak;