- compile fixes for Haiku

svn path=/trunk/boinc/; revision=18214
This commit is contained in:
David Anderson 2009-05-28 03:54:47 +00:00
parent 97d50e12b9
commit e31927218a
2 changed files with 32 additions and 2 deletions

View File

@ -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

View File

@ -43,8 +43,6 @@ extern "C" int debug_printf(const char *fmt, ...);
#include <sys/param.h>
#endif
#include <sys/shm.h>
#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$";