summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2008-10-01 08:19:55 +0000
committerVladimir Glazounov <vg@openoffice.org>2008-10-01 08:19:55 +0000
commit257b3205cae2665a96492b806df10faf884a4e99 (patch)
treea62a9ec17d2421eace78ae757479a20b31b45efd
parent4ca5c503bc36f0300bb3f3ec1577ed41df098ab2 (diff)
CWS-TOOLING: integrate CWS cloph11
-rw-r--r--sal/osl/os2/socket.c10
-rw-r--r--sal/osl/os2/system.h5
-rw-r--r--sal/osl/unx/file.cxx4
-rw-r--r--sal/osl/unx/socket.c10
-rw-r--r--sal/osl/unx/system.c137
-rw-r--r--sal/osl/unx/system.h5
6 files changed, 11 insertions, 160 deletions
diff --git a/sal/osl/os2/socket.c b/sal/osl/os2/socket.c
index b7a598d20cdd..de70e5b8885a 100644
--- a/sal/osl/os2/socket.c
+++ b/sal/osl/os2/socket.c
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: socket.c,v $
- * $Revision: 1.5 $
+ * $Revision: 1.5.60.1 $
*
* This file is part of OpenOffice.org.
*
@@ -48,7 +48,7 @@
#undef HAVE_POLL_H
#endif
-#if defined(LINUX) || defined (IRIX) || defined(NETBSD) || defined ( FREEBSD )
+#if defined(LINUX) || defined (IRIX) || defined(NETBSD) || defined ( FREEBSD ) || defined (MACOSX)
#include <sys/poll.h>
#define HAVE_POLL_H
#endif /* HAVE_POLL_H */
@@ -58,12 +58,6 @@
#define HAVE_POLL_H
#endif /* SOLARIS */
-#if defined(MACOSX)
-/* Include our own poll.h because OS X doesn't implement one */
-#include "poll.h"
-#define HAVE_POLL_H
-#endif
-
#ifndef HAVE_POLL_H
#define POLLIN 0x0001
#define POLLOUT 0x0002
diff --git a/sal/osl/os2/system.h b/sal/osl/os2/system.h
index 5dc36e1afae2..565dfe3ea9c6 100644
--- a/sal/osl/os2/system.h
+++ b/sal/osl/os2/system.h
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: system.h,v $
- * $Revision: 1.5 $
+ * $Revision: 1.5.60.1 $
*
* This file is part of OpenOffice.org.
*
@@ -379,10 +379,7 @@ extern char *strdup(const char *);
# define NO_PTHREAD_RTL
/* for NSGetArgc/Argv/Environ */
# include <crt_externs.h>
-int readdir_r( DIR *dirp, struct dirent *entry, struct dirent **result );
-char *asctime_r( const struct tm *tm, char *buffer );
char *macxp_tempnam( const char *tmpdir, const char *prefix );
-void macxp_getSystemVersion( unsigned int *isDarwin, unsigned int *majorVersion, unsigned int *minorVersion, unsigned int *minorMinorVersion );
#endif
#ifdef OS2
diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx
index 0f58b02c8e1f..b4d92ccdbc3f 100644
--- a/sal/osl/unx/file.cxx
+++ b/sal/osl/unx/file.cxx
@@ -439,7 +439,7 @@ oslFileError SAL_CALL osl_getNextDirectoryItem(oslDirectory Directory, oslDirect
return osl_File_E_NOENT;
-#if defined(MACOSX) && (BUILD_OS_MAJOR==10) && (BUILD_OS_MINOR>=2)
+#if defined(MACOSX)
// convert decomposed filename to precomposed unicode
char composed_name[BUFSIZ];
@@ -1438,7 +1438,7 @@ oslFileError SAL_CALL osl_syncFile(oslFileHandle Handle)
of the target platforms fix it!!!! */
# define __OSL_STATFS_IS_CASE_SENSITIVE_FS(a) (1)
# define __OSL_STATFS_IS_CASE_PRESERVING_FS(a) (1)
-#endif /* FREEBSD || NETBSD */
+#endif /* FREEBSD || NETBSD || MACOSX */
#if defined(LINUX)
# define __OSL_NFS_SUPER_MAGIC 0x6969
diff --git a/sal/osl/unx/socket.c b/sal/osl/unx/socket.c
index 4c436f08d499..310dd57592f5 100644
--- a/sal/osl/unx/socket.c
+++ b/sal/osl/unx/socket.c
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: socket.c,v $
- * $Revision: 1.29 $
+ * $Revision: 1.29.60.1 $
*
* This file is part of OpenOffice.org.
*
@@ -48,7 +48,7 @@
#undef HAVE_POLL_H
#endif
-#if defined(LINUX) || defined (IRIX) || defined(NETBSD) || defined ( FREEBSD )
+#if defined(LINUX) || defined (IRIX) || defined(NETBSD) || defined ( FREEBSD ) || defined (MACOSX)
#include <sys/poll.h>
#define HAVE_POLL_H
#endif /* HAVE_POLL_H */
@@ -58,12 +58,6 @@
#define HAVE_POLL_H
#endif /* SOLARIS */
-#if defined(MACOSX)
-/* Include our own poll.h because OS X doesn't implement one */
-#include "poll.h"
-#define HAVE_POLL_H
-#endif
-
#ifndef HAVE_POLL_H
#define POLLIN 0x0001
#define POLLOUT 0x0002
diff --git a/sal/osl/unx/system.c b/sal/osl/unx/system.c
index ccce5c7ef1cd..3810e86b4efb 100644
--- a/sal/osl/unx/system.c
+++ b/sal/osl/unx/system.c
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: system.c,v $
- * $Revision: 1.16 $
+ * $Revision: 1.16.60.2 $
*
* This file is part of OpenOffice.org.
*
@@ -30,44 +30,13 @@
#include "system.h"
-#ifdef MACOSX
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/stat.h>
-#include <sys/errno.h>
-#include <string.h>
-#endif
-
#ifdef NO_PTHREAD_RTL
static pthread_mutex_t getrtl_mutex = PTHREAD_MUTEX_INITIALIZER;
/* struct passwd differs on some platforms */
-#if defined NETBSD || defined MACOSX
-#include <pwd.h>
-#include <sys/types.h>
-
-/* [ed] 9/1/02 On OS 10.2 and higher, the OS headers define this function slightly differently.
- A fourth argument is expected, a struct passwd **. We still want to make our own definition,
- however, so when we run on 10.1 we can still locate the symbol in our own libraries. So
- if we're building on 10.2, simply change the prototype to match the expected system
- prototype and provide the duplicate symbol.
- */
-#ifdef MACOSX
-#ifdef BUILD_OS_APPLEOSX
-#if (BUILD_OS_MAJOR >= 10) && (BUILD_OS_MINOR >= 2)
-int getpwnam_r(const char* name, struct passwd* s, char* buffer, size_t size, struct passwd **ignore )
-#else /* BUILD_OS_MAJOR && BUILD_OS_MINOR */
-/* previous versions of MacOS X...10.0/1. Use old prototype */
-struct passwd *getpwnam_r(const char* name, struct passwd* s, char* buffer, int size )
-#endif /* BUILD_OS_MAJOR && BUILD_OS_MINOR */
-#else /* BUILD_OS_APPLE_OSX */
-/* configure didn't take, or we're building on darwin. Fallback on old prototype */
+#if defined NETBSD
struct passwd *getpwnam_r(const char* name, struct passwd* s, char* buffer, int size )
-#endif /* BUILD_OS_APPLEOSX */
-#else /* MACOSX */
-struct passwd *getpwnam_r(const char* name, struct passwd* s, char* buffer, int size )
-#endif /* MACOSX */
{
struct passwd* res;
@@ -119,22 +88,9 @@ struct passwd *getpwnam_r(const char* name, struct passwd* s, char* buffer, int
pthread_mutex_unlock(&getrtl_mutex);
-#ifdef MACOSX
-#ifdef BUILD_OS_APPLEOSX
-#if (BUILD_OS_MAJOR >= 10) && (BUILD_OS_MINOR >= 2)
- return((int)res);
-#else
- return(res);
-#endif /* BUILD_OS_MAJOR && BUILD_OS_MINOR */
-#else /* BUILD_OS_APPLEOSX */
- return(res);
-#endif /* BUILD_OS_APPLEOSX */
-#else /* MACOSX */
return(res);
-#endif /* MACOSX */
}
-#if defined(NETBSD) || defined(MACOSX)
int getpwuid_r(uid_t uid, struct passwd *pwd, char *buffer,
size_t buflen, struct passwd **result)
{
@@ -197,7 +153,6 @@ int getpwuid_r(uid_t uid, struct passwd *pwd, char *buffer,
return retval;
}
-#endif
struct tm *localtime_r(const time_t *timep, struct tm *buffer)
{
@@ -232,7 +187,7 @@ struct tm *gmtime_r(const time_t *timep, struct tm *buffer)
return res;
}
-#endif /* defined NETBSD || defined MACOSX */
+#endif /* defined NETBSD */
#ifdef SCO
#include <pwd.h>
@@ -429,92 +384,6 @@ struct hostent *gethostbyname_r(const char *name, struct hostent *result,
#if defined(MACOSX)
/*
- * This section works around calls that are missing or broken
- * in MacOS X 10.1.x and earlier.
- */
-
-/* MacOS X doesn't have readdir_r() standard, plus readdir() isn't threadsafe. */
-
-/*******************************************************************************/
-int readdir_r( DIR *dirp, struct dirent *entry, struct dirent **result )
-{
- struct dirent* pDirEntry;
- int nRet;
- int nSavedErrno;
-
- pthread_mutex_lock(&getrtl_mutex);
-
- nSavedErrno = errno;
- errno = 0;
- pDirEntry = readdir(dirp);
-
- if ( pDirEntry ) {
- memcpy(entry, pDirEntry, sizeof(struct dirent));
- *result = entry;
- errno = nSavedErrno;
- nRet = 0;
- }
- else {
- if ( errno ) {
- nRet = errno; /* can be EBADF */
- }
- else {
- *result = NULL;
- nRet = 0;
- /* errno must not be changed if reaching end of dir */
- errno = nSavedErrno;
- }
- }
-
- pthread_mutex_unlock(&getrtl_mutex);
-
- return nRet;
-}
-
-/* No reentrant asctime() either... */
-
-/*******************************************************************************/
-char *asctime_r( const struct tm *tm, char *buffer )
-{
- char *asctimeBuffer;
-
- pthread_mutex_lock(&getrtl_mutex);
-
- asctimeBuffer = asctime( tm );
- /* Simply hope we don't have a buffer overflow... */
- if ( asctimeBuffer )
- strcpy( buffer, asctimeBuffer );
- else
- buffer = NULL;
-
- pthread_mutex_unlock(&getrtl_mutex);
- return( buffer );
-}
-
-/*
- * Return the system version. Currently, we only differentiate between
- * Darwin and OS X.
- */
-void macxp_getSystemVersion( unsigned int *isDarwin, unsigned int *majorVersion, unsigned int *minorVersion, unsigned int *minorMinorVersion )
-{
- int err;
- struct stat status;
-
- /* Check for the presence of /usr/bin/osascript, which is
- * believed to be OS X only.
- */
- err = stat( "/usr/bin/osascript", &status );
- if ( err == 0 )
- *isDarwin = 0; /* OS X system detected */
- else
- *isDarwin = 1; /* Darwin system detected */
-
- *majorVersion = 0;
- *minorVersion = 0;
- *minorMinorVersion = 0;
-}
-
-/*
* Add support for resolving Mac native alias files (not the same as unix alias files)
* returns 0 on success.
*/
diff --git a/sal/osl/unx/system.h b/sal/osl/unx/system.h
index f019b73fa9bc..c2e01126fb58 100644
--- a/sal/osl/unx/system.h
+++ b/sal/osl/unx/system.h
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: system.h,v $
- * $Revision: 1.42 $
+ * $Revision: 1.42.60.1 $
*
* This file is part of OpenOffice.org.
*
@@ -352,9 +352,6 @@ extern char *strdup(const char *);
# define NO_PTHREAD_RTL
/* for NSGetArgc/Argv/Environ */
# include <crt_externs.h>
-int readdir_r( DIR *dirp, struct dirent *entry, struct dirent **result );
-char *asctime_r( const struct tm *tm, char *buffer );
-void macxp_getSystemVersion( unsigned int *isDarwin, unsigned int *majorVersion, unsigned int *minorVersion, unsigned int *minorMinorVersion );
#ifdef __cplusplus
extern "C" {
#endif