diff --git a/checkin_notes b/checkin_notes index 0e27bf4f91..47f4b61b06 100644 --- a/checkin_notes +++ b/checkin_notes @@ -4768,3 +4768,9 @@ David 27 May 2009 shmem.cpp,h zip/unzip/unix/ unix.c + +David 27 May 2009 + - compile fixes for Haiku + + lib/ + shmem.cpp diff --git a/lib/shmem.cpp b/lib/shmem.cpp index d5463b72be..afd70ac926 100644 --- a/lib/shmem.cpp +++ b/lib/shmem.cpp @@ -43,8 +43,6 @@ extern "C" int debug_printf(const char *fmt, ...); #include #endif #include -#else - you need to implement your own shmem functions #endif #endif @@ -384,6 +382,8 @@ int detach_shmem_mmap(void* p, size_t size) { return munmap((char *)p, size); } +#if HAVE_SYS_SHM_H + // Compatibility routines for Unix/Linux/Mac V5 applications // int create_shmem(key_t key, int size, gid_t gid, void** pp) { @@ -500,6 +500,30 @@ int print_shmem_info(key_t key) { return 0; } +#else // HAVE_SYS_SHM_H + +// Platforms that don't have sys/shm.h will need stubs, +// or alternate implementations + +int create_shmem(key_t, int size, gid_t gid, void**) { + perror("create_shmem: not supported on this platform"); + return ERR_SHMGET; +} +int attach_shmem(key_t, void**) { + perror("attach_shmem: not supported on this platform"); + return ERR_SHMGET; +} +int detach_shmem(void*) { + perror("detach_shmem: not supported on this platform"); + return ERR_SHMGET; +} +int destroy_shmem(key_t) { + perror("destroy_shmem: not supported on this platform"); + return ERR_SHMCTL; +} + +#endif // !HAVE_SYS_SHM_H + #endif // !defined(_WIN32) && !defined(__EMX__) const char *BOINC_RCSID_f835f078de = "$Id$";