Index: Singular/gmalloc.c
===================================================================
--- Singular/gmalloc.c	(revision bc4605bbb4d385f31d7d577505aff5628d795356)
+++ Singular/gmalloc.c	(revision 3932494a14100776dd25479d8a30fd56fb8ea293)
@@ -16,5 +16,6 @@
 #if 1
 
-
+#define __USE_XOPEN
+#define __USE_XOPEN_EXTENDED
 #define _MALLOC_INTERNAL
 
Index: Singular/mmcheck.c
===================================================================
--- Singular/mmcheck.c	(revision bc4605bbb4d385f31d7d577505aff5628d795356)
+++ Singular/mmcheck.c	(revision 3932494a14100776dd25479d8a30fd56fb8ea293)
@@ -2,5 +2,5 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-/* $Id: mmcheck.c,v 1.6 1999-03-19 17:42:29 obachman Exp $ */
+/* $Id: mmcheck.c,v 1.7 1999-06-30 14:54:11 Singular Exp $ */
 
 /*
@@ -82,5 +82,5 @@
   {
     DBMCB *what = (DBMCB*) (((char*) pages) + SIZE_OF_HEAP_PAGE_HEADER);
-    
+
     for (i=0; i<nblocks; i++)
     {
@@ -97,5 +97,5 @@
   DBMCB* prev = NULL;
   size_t size = SizeFromRealSize(heap->size);
-  
+
   if (mm_minAddr == 0 || mm_minAddr > (void*) what)
     mm_minAddr = (void*) what;
@@ -103,10 +103,10 @@
   while (what != NULL)
   {
-    mmFillDBMCB(what, size, heap, MM_FREEFLAG, __FILE__, __LINE__);    
+    mmFillDBMCB(what, size, heap, MM_FREEFLAG, __FILE__, __LINE__);
     mmMoveDBMCBInto(&mm_theDBfree, what);
     prev = what;
     what = *((void**) what);
   }
-  
+
   if (mm_maxAddr == 0 || mm_maxAddr < (void*) prev)
     mm_maxAddr = (void*) prev;
@@ -116,6 +116,6 @@
 {
   (void)fprintf( stderr, "warning: %s\n", msg );
-  (void)fprintf( stderr, "block %x %s in: %s:%d",
-                 (int)&(what->data), 
+  (void)fprintf( stderr, "block %lx %s in: %s:%d",
+                 (long)&(what->data),
                  (what->flags & MM_FREEFLAG ? "freed" : "allocated" ),
                  what->fname, what->lineno );
@@ -124,5 +124,5 @@
 #else
   fprintf( stderr,"\n");
-#endif  
+#endif
   if (strcmp(msg,"size")==0)
     (void)fprintf( stderr, "size is: %d, but check said %d \n",
@@ -145,5 +145,5 @@
   }
 }
-    
+
 void mmPrintFL( const char* fname, const int lineno )
 {
@@ -162,5 +162,5 @@
 #define MM_BACK_PATTERN  249
 
-void mmFillDBMCB(DBMCB* what, size_t size, memHeap heap, 
+void mmFillDBMCB(DBMCB* what, size_t size, memHeap heap,
                  int flags, char* fname, int lineno)
 {
@@ -173,5 +173,5 @@
   what->flags = flags;
   what->init = 0;
-  
+
   if (flags & MM_FREEFLAG)
     memset(addr, MM_FREE_PATTERN, size);
@@ -200,5 +200,5 @@
 {
   int i;
-  
+
   for (i = 0; i<size; i++)
     if (ptr[i] != pattern) return 0;
@@ -215,5 +215,5 @@
   int ok=1;
 
-  if ( ((int)what % 4 ) != 0 )
+  if ( ((long)what % 4 ) != 0 )
   {
     fprintf( stderr, "warning: odd address\n" );
@@ -239,8 +239,8 @@
     return 0;
   }
-  
+
   if ( ((long)what->fname<1000)
   #ifdef unix
-       ||((long)what->fname>(int)&(_end))
+       ||((long)what->fname>(long)&(_end))
   #endif
   )
@@ -296,8 +296,8 @@
                        MM_NUMBER_OF_FRONT_PATTERNS))
     return mmPrintDBMCB(what , "front pattern", 0);
-  if ((what->flags & MM_FREEFLAG)  && 
+  if ((what->flags & MM_FREEFLAG)  &&
       ! mmCheckPattern((char*)&(what->data), MM_FREE_PATTERN, 0))
     return mmPrintDBMCB(what, "free pattern", 0);
-  if (! mmCheckPattern((char*) &(what->data) + size, 
+  if (! mmCheckPattern((char*) &(what->data) + size,
                        MM_BACK_PATTERN, DebugOffsetBack))
     return mmPrintDBMCB(what, "back pattern", 0);
@@ -371,5 +371,5 @@
   return 1;
 }
- 
+
 static int   mmIsAddrOnDList(DBMCB *what, DBMCB* list, int s)
 {
@@ -396,5 +396,5 @@
       return mmPrintDBMCB(what, "Used flag but not in used list", 0);
   }
-  
+
   if ( mmIsAddrOnDList((void*) what, mm_theDBfree.next,
                        (void*) &(mm_theDBfree.next) -
@@ -411,5 +411,5 @@
   return 1;
 }
-  
+
 int mmCheckDBMCB ( DBMCB * what, int size , int flags)
 {
@@ -420,5 +420,5 @@
 
   if (mm_MDEBUG > 1 && ! mmTestMemory()) return 0;
-  
+
   if (mm_MDEBUG > 0 && ! mmCheckListContainment(what, flags)) return 0;
 
@@ -437,5 +437,5 @@
   DBMCB * what;
 
-  if ( adr == NULL || size == 0) 
+  if ( adr == NULL || size == 0)
     return TRUE;
 
@@ -445,5 +445,5 @@
     return FALSE;
   }
-    
+
   what = (DBMCB*)((char*)(adr) - DebugOffsetFront);
 
@@ -476,11 +476,11 @@
                             fname, lineno);
 }
-                            
-BOOLEAN mmDBTestBlock(const void* adr, const size_t size, 
+
+BOOLEAN mmDBTestBlock(const void* adr, const size_t size,
                       const char * fname, const int lineno)
 {
   int i;
   DBMCB * what;
-  
+
   if ( ( adr == NULL ) || ( size == 0 ) ) return TRUE;
 
@@ -489,5 +489,5 @@
   {
     what = (DBMCB*)((char*)(adr) - DebugOffsetFront);
-    if ( ! mmCheckDBMCB( what, size, MM_USEDFLAG) ) 
+    if ( ! mmCheckDBMCB( what, size, MM_USEDFLAG) )
     {
       mmPrintFL( fname, lineno );
@@ -510,7 +510,7 @@
     adr = (size_t*)adr-1;
 #ifdef ALIGN_8
-    l= (adr<=mm_maxAddr) ? (*(size_t*)((int)adr&(~7))) :0;
+    l= (adr<=mm_maxAddr) ? (*(size_t*)((long)adr&(~((long)7)))) :0;
 #else
-    l= (adr<=mm_maxAddr) ? (*(size_t*)((int)adr&(~3))) :0;
+    l= (adr<=mm_maxAddr) ? (*(size_t*)((long)adr&(~((long)3)))) :0;
 #endif
     return mmDBTestBlock( adr,l, fname, lineno );
