diff options
Diffstat (limited to 'sal')
-rw-r--r-- | sal/Library_sal.mk | 5 | ||||
-rw-r--r-- | sal/osl/unx/file_error_transl.cxx | 2 | ||||
-rw-r--r-- | sal/osl/unx/system.cxx | 2 | ||||
-rw-r--r-- | sal/osl/unx/system.hxx | 35 | ||||
-rw-r--r-- | sal/qa/osl/file/osl_File_Const.h | 6 |
5 files changed, 45 insertions, 5 deletions
diff --git a/sal/Library_sal.mk b/sal/Library_sal.mk index 01948f4c4465..0489e10a0e52 100644 --- a/sal/Library_sal.mk +++ b/sal/Library_sal.mk @@ -57,7 +57,7 @@ $(eval $(call gb_Library_use_system_win32_libs,sal,\ )) $(eval $(call gb_Library_add_libs,sal,\ - $(if $(filter-out $(OS),WNT), \ + $(if $(filter-out $(OS),WNT HAIKU), \ $(if $(filter $(OS),ANDROID),, \ -lpthread \ ) \ @@ -70,6 +70,9 @@ $(eval $(call gb_Library_add_libs,sal,\ -lnsl \ -lsocket \ ) \ + $(if $(filter $(OS),HAIKU), \ + -lnetwork \ + ) \ )) ifeq ($(OS),MACOSX) diff --git a/sal/osl/unx/file_error_transl.cxx b/sal/osl/unx/file_error_transl.cxx index 54b19ce10a9f..f8910289456b 100644 --- a/sal/osl/unx/file_error_transl.cxx +++ b/sal/osl/unx/file_error_transl.cxx @@ -155,8 +155,10 @@ oslFileError oslTranslateFileError(int Errno) return osl_File_E_MULTIHOP; #endif /* MACOSX */ +#if !defined(HAIKU) case EUSERS: return osl_File_E_USERS; +#endif case EOVERFLOW: return osl_File_E_OVERFLOW; diff --git a/sal/osl/unx/system.cxx b/sal/osl/unx/system.cxx index 7003b4ff5a41..aacd91a1290a 100644 --- a/sal/osl/unx/system.cxx +++ b/sal/osl/unx/system.cxx @@ -28,7 +28,7 @@ /* struct passwd differs on some platforms */ -#if defined(MACOSX) || defined(IOS) || defined(OPENBSD) || defined(NETBSD) +#if defined(MACOSX) || defined(IOS) || defined(OPENBSD) || defined(NETBSD) || defined(HAIKU) //No mutex needed on Mac OS X, gethostbyname is thread safe diff --git a/sal/osl/unx/system.hxx b/sal/osl/unx/system.hxx index a822b0a83a10..6a92f291e833 100644 --- a/sal/osl/unx/system.hxx +++ b/sal/osl/unx/system.hxx @@ -85,6 +85,38 @@ #endif +#ifdef HAIKU +# include <shadow.h> +# include <pthread.h> +# include <sys/file.h> +# include <sys/ioctl.h> +# include <sys/uio.h> +# include <sys/un.h> +# include <netinet/tcp.h> +# include <dlfcn.h> +# include <endian.h> +# include <sys/time.h> +# define IORESOURCE_TRANSFER_BSD +# define IOCHANNEL_TRANSFER_BSD_RENO +# define pthread_testcancel() +# define NO_PTHREAD_PRIORITY +# define NO_PTHREAD_RTL +# define PTHREAD_SIGACTION pthread_sigaction + +# ifndef ETIME +# define ETIME ETIMEDOUT +# endif +# define SIGIOT SIGABRT +# define ESOCKTNOSUPPORT ENOTSUP +# define ETOOMANYREFS EOPNOTSUPP +# define SOCK_RDM 0 +// hack: Haiku defines SOL_SOCKET as -1, but this makes GCC complain about +// narrowing conversion +# undef SOL_SOCKET +# define SOL_SOCKET (sal_uInt32) -1 + +#endif + #if defined(ANDROID) # include <pthread.h> # include <sys/file.h> @@ -242,7 +274,8 @@ int macxp_resolveAlias(char *path, int buflen); !defined(AIX) && \ !defined(__sun) && !defined(MACOSX) && \ !defined(OPENBSD) && !defined(DRAGONFLY) && \ - !defined(IOS) && !defined(ANDROID) + !defined(IOS) && !defined(ANDROID) && \ + !defined(HAIKU) # error "Target platform not specified!" #endif diff --git a/sal/qa/osl/file/osl_File_Const.h b/sal/qa/osl/file/osl_File_Const.h index ac9c7aab0a52..ed77b6d4484e 100644 --- a/sal/qa/osl/file/osl_File_Const.h +++ b/sal/qa/osl/file/osl_File_Const.h @@ -65,11 +65,13 @@ const sal_Char pBuffer_Blank[] = ""; # include <errno.h> # include <fcntl.h> # include <sys/stat.h> -# if !defined(MACOSX) && !defined(IOS) && !defined(__OpenBSD__) && !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined (DRAGONFLY) +# if !defined(MACOSX) && !defined(IOS) && !defined(__OpenBSD__) && !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined (DRAGONFLY) && !defined(HAIKU) # include <sys/statfs.h> # else # include <sys/param.h> -# include <sys/mount.h> +# ifndef HAIKU +# include <sys/mount.h> +# endif # endif # if !defined(ANDROID) # include <sys/statvfs.h> |