changeset 3008:8687599be101

#ifdef HAVE_SHM
author alex
date Mon, 19 Nov 2001 16:57:40 +0000
parents fff5d8446467
children e22bba6cb6a6
files linux/shmem.c
diffstat 1 files changed, 16 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/linux/shmem.c	Mon Nov 19 16:42:01 2001 +0000
+++ b/linux/shmem.c	Mon Nov 19 16:57:40 2001 +0000
@@ -6,6 +6,8 @@
  *   Sun Apr  6 02:26:26 MET DST 1997
  */
 
+#include "../config.h"
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -22,6 +24,7 @@
 #include <sys/select.h>
 #endif
 
+#ifdef HAVE_SHM
 #include <sys/ipc.h>
 #include <sys/shm.h>
 
@@ -72,7 +75,7 @@
     return p;
 	}
   default:
-    printf("FATAL: Cannot alloate %d bytes shared memory :(\n",size);
+    printf("FATAL: Cannot allocate %d bytes of shared memory :(\n",size);
     return NULL;
   }
   ++shmem_type;
@@ -86,3 +89,15 @@
       break;
   }
 }
+#else /* HAVE_SHM */
+void *shmem_alloc(int size)
+{
+    printf("FATAL: no SHM support was compiled in!\n");
+    return(NULL);
+}
+
+void shmem_free(void *p)
+{
+    printf("FATAL: no SHM support was compiled in!\n");    
+}
+#endif /* HAVE_SHM */