[Libreoffice-commits] .: sal/inc sal/osl sal/rtl
Tor Lillqvist
tml at kemper.freedesktop.org
Thu Jun 9 11:42:52 PDT 2011
sal/inc/osl/endian.h | 17 ++++++++++++++++-
sal/inc/sal/alloca.h | 2 +-
sal/inc/sal/config.h | 2 +-
sal/osl/unx/file_volume.cxx | 14 +++++++-------
sal/osl/unx/security.c | 5 +++++
sal/osl/unx/signal.c | 6 ++++--
sal/osl/unx/socket.c | 2 +-
sal/osl/unx/system.h | 17 +++++++++++++++++
sal/rtl/source/macro.hxx | 2 ++
9 files changed, 54 insertions(+), 13 deletions(-)
New commits:
commit 04a97047aea7117e14bcb6889e839457e5ef5f2a
Author: Tor Lillqvist <tlillqvist at novell.com>
Date: Thu Jun 9 21:41:35 2011 +0300
First attempt at Android support
diff --git a/sal/inc/osl/endian.h b/sal/inc/osl/endian.h
index 9abf8cf..3d9bba8 100644
--- a/sal/inc/osl/endian.h
+++ b/sal/inc/osl/endian.h
@@ -66,6 +66,21 @@ extern "C" {
# endif
#endif
+#ifdef ANDROID
+# include <endian.h>
+# if __BYTE_ORDER == __LITTLE_ENDIAN
+# ifndef _LITTLE_ENDIAN
+# define _LITTLE_ENDIAN
+# endif
+# elif __BYTE_ORDER == __BIG_ENDIAN
+# ifndef _BIG_ENDIAN
+# define _BIG_ENDIAN
+# endif
+# elif __BYTE_ORDER == __PDP_ENDIAN
+# define _PDP_ENDIAN
+# endif
+#endif
+
#ifdef NETBSD
# include <machine/endian.h>
# if BYTE_ORDER == LITTLE_ENDIAN
@@ -154,7 +169,7 @@ extern "C" {
!defined(AIX) && !defined(OPENBSD) && \
!defined(SOLARIS) && !defined(MACOSX) && !defined(FREEBSD) && \
!defined(DRAGONFLY) && \
- !defined(IOS)
+ !defined(IOS) && !defined(ANDROID)
# error "Target platform not specified !"
#endif
diff --git a/sal/inc/sal/alloca.h b/sal/inc/sal/alloca.h
index eb31ad5..087746f 100644
--- a/sal/inc/sal/alloca.h
+++ b/sal/inc/sal/alloca.h
@@ -29,7 +29,7 @@
#ifndef INCLUDED_SAL_ALLOCA_H
#define INCLUDED_SAL_ALLOCA_H
-#if defined (SOLARIS) || defined (LINUX) || defined(__EMX__) || defined(AIX)
+#if defined (SOLARIS) || defined (LINUX) || defined(__EMX__) || defined(AIX) || defined(ANDROID)
#ifndef INCLUDED_ALLOCA_H
#include <alloca.h>
diff --git a/sal/inc/sal/config.h b/sal/inc/sal/config.h
index 599a8bc..9da307a 100644
--- a/sal/inc/sal/config.h
+++ b/sal/inc/sal/config.h
@@ -75,7 +75,7 @@
#endif /* defined WIN32 */
#if defined(SOLARIS) || defined(LINUX) || defined(NETBSD) || defined(FREEBSD) || \
- defined(AIX) || defined(OPENBSD) || defined(DRAGONFLY)
+ defined(AIX) || defined(OPENBSD) || defined(DRAGONFLY) || defined(ANDROID)
#define SAL_UNX
#define SAL_DLLEXTENSION ".so"
#define SAL_DLLPREFIX "lib"
diff --git a/sal/osl/unx/file_volume.cxx b/sal/osl/unx/file_volume.cxx
index 4a941ff..cc30089 100644
--- a/sal/osl/unx/file_volume.cxx
+++ b/sal/osl/unx/file_volume.cxx
@@ -1114,36 +1114,36 @@ osl_isFloppyMounted (oslVolumeDeviceHandleImpl* pDevice)
/******************************************************************************
*
- * MAC OS X AND IOS FLOPPY FUNCTIONS: NO FLOPPIES
+ * Dummy floppy functions: no stinking floppies
*
*****************************************************************************/
-#if (defined(MACOSX) || defined(IOS) || defined(NETBSD) || defined(FREEBSD) || \
+#if (defined(MACOSX) || defined(IOS) || defined(ANDROID) || defined(NETBSD) || defined(FREEBSD) || \
defined(AIX) || defined(OPENBSD) || defined(DRAGONFLY))
static oslVolumeDeviceHandle osl_isFloppyDrive(const sal_Char* pszPath)
{
(void)pszPath;
return NULL;
}
-#endif /* MACOSX */
+#endif
-#if ( defined(MACOSX) || defined(IOS) || defined(NETBSD) || defined(FREEBSD) || \
+#if ( defined(MACOSX) || defined(IOS) || defined(ANDROID) || defined(NETBSD) || defined(FREEBSD) || \
defined(AIX) || defined(OPENBSD) || defined(DRAGONFLY))
static oslFileError osl_mountFloppy(oslVolumeDeviceHandle hFloppy)
{
(void)hFloppy;
return osl_File_E_BUSY;
}
-#endif /* MACOSX */
+#endif
-#if ( defined(MACOSX) || defined(IOS) || defined(NETBSD) || defined(FREEBSD) || \
+#if ( defined(MACOSX) || defined(IOS) || defined(ANDROID) || defined(NETBSD) || defined(FREEBSD) || \
defined(AIX) || defined(OPENBSD) || defined(DRAGONFLY))
static oslFileError osl_unmountFloppy(oslVolumeDeviceHandle hFloppy)
{
(void)hFloppy;
return osl_File_E_BUSY;
}
-#endif /* MACOSX */
+#endif
#if ( defined(NETBSD) || defined(IOS) || defined(FREEBSD) || defined(OPENBSD) || defined(DRAGONFLY) )
static sal_Bool osl_getFloppyMountEntry(const sal_Char* pszPath, oslVolumeDeviceHandleImpl* pItem)
diff --git a/sal/osl/unx/security.c b/sal/osl/unx/security.c
index f0f82ec..3a42b66 100644
--- a/sal/osl/unx/security.c
+++ b/sal/osl/unx/security.c
@@ -48,6 +48,11 @@
#include "secimpl.h"
+#ifdef ANDROID
+#define getpwuid_r(uid, pwd, buf, buflen, result) (*(result) = getpwuid(uid), (*(result) ? (memcpy (buf, *(result), sizeof (struct passwd)), 0) : errno))
+#endif
+
+
static oslSecurityError SAL_CALL
osl_psz_loginUser(const sal_Char* pszUserName, const sal_Char* pszPasswd,
oslSecurity* pSecurity);
diff --git a/sal/osl/unx/signal.c b/sal/osl/unx/signal.c
index 71eefca..360e25c 100644
--- a/sal/osl/unx/signal.c
+++ b/sal/osl/unx/signal.c
@@ -820,22 +820,24 @@ static int ReportCrash( int Signal )
static void PrintStack( int sig )
{
-#if ! defined(MACOSX) || defined(INCLUDE_BACKTRACE)
+#ifdef INCLUDE_BACKTRACE
void *buffer[MAX_STACK_FRAMES];
int size = backtrace( buffer, SAL_N_ELEMENTS(buffer) );
#endif
fprintf( stderr, "\n\nFatal exception: Signal %d\n", sig );
-#if defined(MACOSX) && ! defined(INCLUDE_BACKTRACE)
+#ifdef MACOSX
fprintf( stderr, "Please turn on Enable Crash Reporting and\nAutomatic Display of Crashlogs in the Console application\n" );
#else
+#ifdef INCLUDE_BACKTRACE
if ( size > 0 )
{
fputs( "Stack:\n", stderr );
backtrace_symbols_fd( buffer, size, fileno(stderr) );
}
#endif
+#endif
}
static oslSignalAction CallSignalHandler(oslSignalInfo *pInfo)
diff --git a/sal/osl/unx/socket.c b/sal/osl/unx/socket.c
index b9fb92e..bcf5a72 100644
--- a/sal/osl/unx/socket.c
+++ b/sal/osl/unx/socket.c
@@ -791,7 +791,7 @@ static struct hostent* _osl_gethostbyname_r (
const char *name, struct hostent *result,
char *buffer, int buflen, int *h_errnop)
{
-#if defined(LINUX) || (defined(FREEBSD) && (__FreeBSD_version >= 601103)) || defined(DRAGONFLY)
+#if defined(LINUX) || defined(ANDROID) || (defined(FREEBSD) && (__FreeBSD_version >= 601103)) || defined(DRAGONFLY)
struct hostent *__result; /* will be the same as result */
int __error;
__error = gethostbyname_r (name, result, buffer, buflen,
diff --git a/sal/osl/unx/system.h b/sal/osl/unx/system.h
index 9ff6cc4..d9c90d2 100644
--- a/sal/osl/unx/system.h
+++ b/sal/osl/unx/system.h
@@ -135,6 +135,23 @@
#endif
+#ifdef ANDROID
+# 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>
+# include <semaphore.h>
+# define IORESOURCE_TRANSFER_BSD
+# define IOCHANNEL_TRANSFER_BSD_RENO
+# define pthread_testcancel()
+# define NO_PTHREAD_PRIORITY
+#endif
+
#ifdef NETBSD
# include <sys/param.h>
# ifndef ETIME
diff --git a/sal/rtl/source/macro.hxx b/sal/rtl/source/macro.hxx
index 2567451..b07c770 100644
--- a/sal/rtl/source/macro.hxx
+++ b/sal/rtl/source/macro.hxx
@@ -43,6 +43,8 @@
#else
#define THIS_OS "Linux"
#endif
+#elif defined ANDROID
+#define THIS_OS "Android"
#elif defined MACOSX
#define THIS_OS "MacOSX"
#elif defined IOS
More information about the Libreoffice-commits
mailing list