- Fixes for Mac OS X-only crashing bugs - Fixes for Mac OS X-only file system issues like UTF8 names, HFS+ file aliases, and remote exclusive file locking - Jaguar build and runtime dependencies like libdl
Although the fixes that I have donated are for OOo 1.1.4, most of the same bugs exist in the current OOo 2.0 code so these fixes should be useful in your OOo 2.0 porting efforts.
I have committed the donated code in the cws_srx645_macxjoin1153 branch. Also, I have attached a "diff -u" file of all of the donated code that I committed.
Since the donated code is now in the OOo CVS repository, the OOo 2.0 Mac OS X builders should feel free to merge the code in the cws_srx645_macxjoin1153 branch into the OOo 2.0 code. To help with this effort, here is a brief description of each of the changes:
- berkeleydb module
On Mac OS X, a *.jnilib softlink will be created and delivered that links to the *.dylib file.
- desktop
The mozwrapper.sh and nswrapper.sh scripts now have different logic for Mac OS X.
- dlcompat module
The original dlcompat code in the OOo CVS tree was not buildable. My changes fix this problem. Note that dlcompat is only built when building on Mac OS X 10.2. Nothing is done for other platforms or Mac OS X versions.
- external module (commit still pending)
The dlcompat module was added as a build dependency for this module.
- sal
In most of the files, the only change was to #define osl_getThreadTextEncoding() as RTL_TEXTENCODING_UTF8 on Mac OS X so that all file paths use UTF-8 encoding. Without this change in several files, performing any file operation on a file with non-ASCII characters will most likely fail.
In addition, there are many other bug fixes in this module:
- sal/osl/unx/makefile.mk - Allow a Mac OS X creator type to be
passed to the code. Note: this change does nothing in the OOo
X11 build but it may be useful for an Aqua port in the future. - sal/osl/unx/module.c - Synchronize loading of libraries to
prevent deadlocking. - sal/osl/unx/process.c - Only fork() if the executable exists
as trying to execute non-existant executables will eventually
cause Mac OS X to hang. - sal/osl/unx/signal.c - Disable the crash reporter on Mac OS X
as Mac OS X has its own crash reporter. - sal/osl/unx/system.c - Use /tmp instead of /var/tmp as the
temporary directory on Mac OS X since /var/tmp is not cleaned
up by the OS. Also, add the macxp_resolveAlias() function to
resolve Mac OS X "alias" files. - sal/osl/unx/system.h - Add the macxp_resolveAlias() function
prototype. - sal/osl/unx/tempfile.c - Use /tmp instead of /var/tmp as the
temporary directory on Mac OS X. - sal/osl/unx/uunxapi.cxx - Resolve an paths on Mac OS X using
the macxp_resolveAlias() function. - sal/rtl/source/alloc.c - Do not use mmap() and munmap() to
replace malloc() and free() on Mac OS X as it can cause random
crashing when when "delete []" is called. - sal/systools/macxp_extras/x11osx/osxlocale.c - Properly detect
the user's locale by using native Mac OS X functions. Important
note: for this code to work, you will need to create an empty
"Contents/Resources/<lang>.lproj" directory for each language
that OOo supports within the directory that soffice.bin is in.
For example, if soffice.bin is in the following directory:/Applications/OpenOffice.org/program/soffice.bin
then you would need to create the following directories to
support English, French, and German installations: /Applications/OpenOffice.org/program/Contents/Resources/en.lproj
/Applications/OpenOffice.org/program/Contents/Resources/en_US.lproj
/Applications/OpenOffice.org/program/Contents/Resources/de.lproj
/Applications/OpenOffice.org/program/Contents/Resources/fr.lproj - sal/textenc/tencinfo.c - Properly handle the text encoding codes
that are embedded in RTF files created by Mac OS X applications.
Important note: this code should be ported to other platforms.- sal/util/makefile.mk - Add Carbon to the link list.
- sc
Building of the Hindu and Kannada resource files is disabled because these resource files are too large for the OOo resource compiler.
- scp
The *.jnilib added to the berkeleydb build is now included in the OOo installation.
- shell module
This change fixes the Mac OS X code that mails a document using the macosx_mailer script. The old OOo 1.1.x code did not properly handle documents with quotes, double-quotes, or spaces in the document name.
- solenv
On Mac OS X, linking against the X11 libraries is only done when $(GUIBASE) == "unx". This is needed to allow development of any non-X11 implementation of OOo (e.g. a future Aqua port).
- store
Handle case where invoking fcntl(<file>, F_SETLK, <lock>) to get a read-only lock returns the ENOTSUP error. The ENOTSUP error occurs for mounted filesystems that do not support file locking.
- sw
This change stops OOo from crashing when loading http:// URLs.
- ucbhelper
An #include was added to allow compiling on Mac OS X 10.2.
- vcl
Change library link list to allow compiling on Mac OS X 10.2.
- xmlhelp
Correct mismatch in data types between method prototype in header file to allow compiling on Mac OS X 10.2.
I hope you find the donated code helpful in your OOo 2.0 porting efforts.
Patrick Luby
-- _________________________________________________________________ Patrick Luby Planamesa Software [EMAIL PROTECTED] http://www.planamesa.com _________________________________________________________________
Index: berkeleydb/makefile.mk
===================================================================
RCS file: /cvs/external/berkeleydb/makefile.mk,v
retrieving revision 1.13.12.2
retrieving revision 1.13.12.2.2.1
diff -u -r1.13.12.2 -r1.13.12.2.2.1
--- berkeleydb/makefile.mk 28 Oct 2004 11:54:48 -0000 1.13.12.2
+++ berkeleydb/makefile.mk 18 Apr 2005 14:38:27 -0000 1.13.12.2.2.1
@@ -93,6 +93,9 @@
.ENDIF
OUT2LIB=$(BUILD_DIR)$/.libs$/libdb*$(DLLPOST)
+.IF "$(OS)"=="MACOSX"
+OUT2LIB+=$(BUILD_DIR)$/.libs$/libdb*.jnilib
+.ENDIF
.IF "$(SOLAR_JAVA)"!=""
OUT2BIN=$(BUILD_DIR)$/db.jar
OUT2CLASS=$(BUILD_DIR)$/db.jar
Index: berkeleydb/prj/d.lst
===================================================================
RCS file: /cvs/external/berkeleydb/prj/d.lst,v
retrieving revision 1.4.6.1
retrieving revision 1.4.6.1.2.1
diff -u -r1.4.6.1 -r1.4.6.1.2.1
--- berkeleydb/prj/d.lst 28 Oct 2004 11:55:58 -0000 1.4.6.1
+++ berkeleydb/prj/d.lst 18 Apr 2005 14:38:28 -0000 1.4.6.1.2.1
@@ -13,6 +13,7 @@
..\%__SRC%\lib\libdb-4.2.dylib %_DEST%\lib%_EXT%\libdb-4.2.dylib
..\%__SRC%\lib\libdb_java-4.2.dylib %_DEST%\lib%_EXT%\libdb_java-4.2.dylib
+..\%__SRC%\lib\libdb_java-4.2.jnilib %_DEST%\lib%_EXT%\libdb_java-4.2.jnilib
..\%__SRC%\lib\libdb_cxx-4.2.dylib %_DEST%\lib%_EXT%\libdb_cxx-4.2.dylib
..\%__SRC%\bin\libdb42.dll %_DEST%\bin%_EXT%\libdb42.dll
Index: desktop/scripts/mozwrapper.sh
===================================================================
RCS file: /cvs/framework/desktop/scripts/mozwrapper.sh,v
retrieving revision 1.1.6.1
retrieving revision 1.1.6.1.14.1
diff -u -r1.1.6.1 -r1.1.6.1.14.1
--- desktop/scripts/mozwrapper.sh 27 Aug 2004 10:25:42 -0000 1.1.6.1
+++ desktop/scripts/mozwrapper.sh 18 Apr 2005 02:57:53 -0000
1.1.6.1.14.1
@@ -1,8 +1,20 @@
#!/bin/sh
-# if mozilla is not found, specify full path here
-MOZILLA=mozilla
+if [ `uname` = "Darwin" ] ; then
+ while [ "$1" != "" ] ; do
+ URL=`echo "$1" | sed 's#^/#file:///#'`
+ if [ "$1" != "" ] ; then
+ /usr/bin/open "$URL"
+ fi
+ shift
+ done
+else
+ # if mozilla is not found, specify full path here
+ MOZILLA=mozilla
-if ${MOZILLA} -remote "openURL($1,new-window)" 2>&1 | egrep -si "not running
on display"; then
- ${MOZILLA} $1
+ if ${MOZILLA} -remote "openURL($1,new-window)" 2>&1 | egrep -si "not
running on display"; then
+ ${MOZILLA} $1
+ fi
fi
+
+exit 0
Index: desktop/scripts/nswrapper.sh
===================================================================
RCS file: /cvs/framework/desktop/scripts/Attic/nswrapper.sh,v
retrieving revision 1.2
retrieving revision 1.2.378.1
diff -u -r1.2 -r1.2.378.1
--- desktop/scripts/nswrapper.sh 25 Mar 2003 13:50:59 -0000 1.2
+++ desktop/scripts/nswrapper.sh 18 Apr 2005 02:57:54 -0000
1.2.378.1
@@ -1,10 +1,20 @@
#!/bin/sh
-# if netscape is not found, specify full path here
-NETSCAPE=netscape
+if [ `uname` = "Darwin" ] ; then
+ while [ "$1" != "" ] ; do
+ URL=`echo "$1" | sed 's#^/#file:///#'`
+ if [ "$1" != "" ] ; then
+ /usr/bin/open "$URL"
+ fi
+ shift
+ done
+else
+ # if netscape is not found, specify full path here
+ NETSCAPE=netscape
-if ${NETSCAPE} -remote "openURL($1,new-window)" 2>&1 | egrep -si "not running
on display"; then
- ${NETSCAPE} $1
+ if ${NETSCAPE} -remote "openURL($1,new-window)" 2>&1 | egrep -si "not
running on display"; then
+ ${NETSCAPE} $1
+ fi
fi
-
+exit 0
Index: dlcompat/dlcompat.pat
===================================================================
RCS file: /cvs/external/dlcompat/dlcompat.pat,v
retrieving revision 1.1
retrieving revision 1.1.10.1
diff -u -r1.1 -r1.1.10.1
--- dlcompat/dlcompat.pat 22 Mar 2004 15:45:19 -0000 1.1
+++ dlcompat/dlcompat.pat 18 Apr 2005 14:39:03 -0000 1.1.10.1
@@ -1,4 +1,19 @@
-115c115
-< $(CC) -dynamiclib -o $@ $(OBJS) -install_name $(prefix)/lib/$@
$(VERSTRING)
----
-> $(CC) -dynamiclib -o $@ $(OBJS) -install_name @executable_path/$@
$(VERSTRING)
+*** misc/dlcompat-20030629/Makefile.in Sat Jun 28 09:50:34 2003
+--- misc/build/dlcompat-20030629/Makefile.in Tue May 25 14:44:12 2004
+***************
+*** 112,118 ****
+ ln -sf libdl.$(LIBVER).dylib $@
+
+ libdl.$(LIBVER).dylib: $(OBJS)
+! $(CC) -dynamiclib -o $@ $(OBJS) -install_name $(prefix)/lib/$@
$(VERSTRING)
+
+ clean:
+ rm -f $(OBJS) libdl.* *~ *.o dlopen.3
+--- 112,118 ----
+ ln -sf libdl.$(LIBVER).dylib $@
+
+ libdl.$(LIBVER).dylib: $(OBJS)
+! $(CC) -dynamiclib -o $@ $(OBJS) -install_name @executable_path/$@
$(VERSTRING)
+
+ clean:
+ rm -f $(OBJS) libdl.* *~ *.o dlopen.3
Index: dlcompat/makefile.mk
===================================================================
RCS file: /cvs/external/dlcompat/makefile.mk,v
retrieving revision 1.1
retrieving revision 1.1.10.1
diff -u -r1.1 -r1.1.10.1
--- dlcompat/makefile.mk 22 Mar 2004 15:45:19 -0000 1.1
+++ dlcompat/makefile.mk 18 Apr 2005 14:39:03 -0000 1.1.10.1
@@ -77,13 +77,18 @@
.IF "$(BUILD_OS_MINOR)" == "2"
TARFILE_NAME=dlcompat-20030629
-PATCH_FILE_NAME=dlcompat.patch
+PATCH_FILE_NAME=dlcompat.pat
-BUILD_DIR=dlcompat-20030629
+CONFIGURE_DIR=.
+CONFIGURE_ACTION=./configure
+BUILD_DIR=$(CONFIGURE_DIR)
BUILD_ACTION=make -f Makefile clean all
OUT2INC= \
- dlcompat-20030629/dlfcn.h
+ dlfcn.h
+
+OUT2LIB= \
+ libdl*$(DLLPOST)
.ELSE
verbose:
Index: external/prj/build.lst
===================================================================
RCS file: /cvs/util/external/prj/build.lst,v
retrieving revision 1.12
retrieving revision 1.12.44.1
diff -u -r1.12 -r1.12.44.1
--- external/prj/build.lst 18 Jun 2003 12:44:11 -0000 1.12
+++ external/prj/build.lst 28 May 2004 15:38:19 -0000 1.12.44.1
@@ -1,4 +1,4 @@
-es external : soltools NULL
+es external : soltools dlcompat NULL
es external usr1 - all es_mkout NULL
es external\ado nmake - w es_ado NULL
es external\glibc nmake - all es_glibc NULL
Index: sal/osl/unx/file.c
===================================================================
RCS file: /cvs/porting/sal/osl/unx/Attic/file.c,v
retrieving revision 1.72.28.1
retrieving revision 1.72.28.1.22.1
diff -u -r1.72.28.1 -r1.72.28.1.22.1
--- sal/osl/unx/file.c 9 Jan 2004 18:31:46 -0000 1.72.28.1
+++ sal/osl/unx/file.c 18 Apr 2005 02:56:45 -0000 1.72.28.1.22.1
@@ -173,6 +173,8 @@
#include <sys/mount.h>
#define HAVE_STATFS_H
+/* All Mac OS X paths are UTF-8 */
+#define osl_getThreadTextEncoding() RTL_TEXTENCODING_UTF8
#endif
#if OSL_DEBUG_LEVEL > 1
@@ -266,6 +268,9 @@
static int oslDoCopyFile(const sal_Char* pszSourceFileName, const
sal_Char* pszDestFileName, size_t nSourceSize, mode_t mode);
static oslFileError oslDoMoveFile(const sal_Char* pszPath, const sal_Char*
pszDestPath);
static rtl_uString* oslMakeUStrFromPsz(const sal_Char* pszStr,rtl_uString**
uStr);
+#if defined MACOSX && defined PRODUCT_FILETYPE
+static void oslSetFileTypeFromPsz(const sal_Char* pszStr);
+#endif /* MACOSX && PRODUCT_FILETYPE */
/******************************************************************************
*
@@ -336,7 +341,11 @@
osl_systemPathRemoveSeparator(ustrSystemPath);
/* convert unicode path to text */
+#ifdef MACOSX
+ if ( UnicodeToText( path, PATH_MAX, ustrSystemPath->buffer,
ustrSystemPath->length ) && macxp_resolveAlias( path, PATH_MAX ) == 0 )
+#else /* MACOSX */
if ( UnicodeToText( path, PATH_MAX, ustrSystemPath->buffer,
ustrSystemPath->length ) )
+#endif /* MACOSX */
{
/* open directory */
DIR *pdir = opendir( path );
@@ -443,9 +452,22 @@
if (NULL == pEntry)
return osl_File_E_NOENT;
+#if defined(MACOSX) && (BUILD_OS_MAJOR==10) && (BUILD_OS_MINOR>=2)
+ /* convert decomposed file name to precomposed unicode */
+ char composed_name[BUFSIZ];
+ CFMutableStringRef strRef = CFStringCreateMutable( NULL, 0 );
+ CFStringAppendCString( strRef, pEntry->d_name, kCFStringEncodingUTF8 );
+ CFStringNormalize( strRef, kCFStringNormalizationFormC );
+ CFStringGetCString( strRef, composed_name, BUFSIZ, kCFStringEncodingUTF8 );
+ CFRelease( strRef );
+
+ rtl_string2UString( &ustrFileName, composed_name, strlen( composed_name ),
+ osl_getThreadTextEncoding(), OSTRING_TO_OUSTRING_CVTFLAGS );
+#else
/* convert file name to unicode */
rtl_string2UString( &ustrFileName, pEntry->d_name, strlen( pEntry->d_name
),
osl_getThreadTextEncoding(), OSTRING_TO_OUSTRING_CVTFLAGS );
+#endif
osl_systemPathMakeAbsolutePath(pDirImpl->ustrPath, ustrFileName,
&ustrFilePath);
@@ -586,8 +608,13 @@
osl_systemPathRemoveSeparator(ustrFilePath);
/* convert unicode path to text */
+#ifdef MACOSX
+ if( UnicodeToText( buffer, PATH_MAX, ustrFilePath->buffer,
ustrFilePath->length ) && macxp_resolveAlias( buffer, PATH_MAX ) == 0 )
+#else /* MACOSX */
if( UnicodeToText( buffer, PATH_MAX, ustrFilePath->buffer,
ustrFilePath->length ) )
+#endif /* MACOSX */
{
+
/* we do not open devices or such here */
if( !( uFlags & osl_File_OpenFlag_Create ) )
{
@@ -653,6 +680,11 @@
*pHandle = (oslFileHandle) pHandleImpl;
+#if defined MACOSX && defined PRODUCT_FILETYPE
+ if ( uFlags & osl_File_OpenFlag_Create )
+ oslSetFileTypeFromPsz( buffer );
+#endif /* MACOSX && PRODUCT_FILETYPE */
+
return osl_File_E_None;
}
else
@@ -664,10 +696,39 @@
close( fd );
}
+#ifdef MACOSX
+ /*
+ * Handle case where we cannot open a file for writing because it
+ * is locked in the Finder's GetInfo panel
+ */
+ if ( errno == EPERM )
+ {
+ struct stat aFileStat;
+
+ if( stat( buffer, &aFileStat ) >= 0 && ( aFileStat.st_flags &
( UF_IMMUTABLE | SF_IMMUTABLE ) ) )
+ errno = EACCES;
+ }
+ /*
+ * Mac OS X will return ENOTSUP for mounted file systems so ignore
+ * the error for write locks
+ */
+ else if ( errno == ENOTSUP )
+ {
+ struct stat aFileStat;
+
+ if( stat( buffer, &aFileStat ) >= 0 )
+ errno = EACCES;
+ }
+#endif /* MACOSX */
+
PERROR( "osl_openFile", buffer );
eRet = oslTranslateFileError(OSL_FET_ERROR, errno );
}
}
+#ifdef MACOSX
+ else if( errno )
+ eRet = oslTranslateFileError(OSL_FET_ERROR, errno );
+#endif /* MACOSX */
else
eRet = osl_File_E_INVAL;
@@ -781,6 +842,11 @@
if( eRet != osl_File_E_None )
return eRet;
+#ifdef MACOSX
+ if ( macxp_resolveAlias( srcPath, PATH_MAX ) != 0 || macxp_resolveAlias(
destPath, PATH_MAX ) != 0 )
+ return oslTranslateFileError( OSL_FET_ERROR, errno );
+#endif /* MACOSX */
+
return oslDoMoveFile( srcPath, destPath );
}
@@ -807,6 +873,11 @@
if( eRet != osl_File_E_None )
return eRet;
+#ifdef MACOSX
+ if ( macxp_resolveAlias( srcPath, PATH_MAX ) != 0 || macxp_resolveAlias(
destPath, PATH_MAX ) != 0 )
+ return oslTranslateFileError( OSL_FET_ERROR, errno );
+#endif /* MACOSX */
+
return osl_psz_copyFile( srcPath, destPath );
}
@@ -826,6 +897,11 @@
if( eRet != osl_File_E_None )
return eRet;
+#ifdef MACOSX
+ if ( macxp_resolveAlias( path, PATH_MAX ) != 0 )
+ return oslTranslateFileError( OSL_FET_ERROR, errno );
+#endif /* MACOSX */
+
return osl_psz_removeFile( path );
}
@@ -846,6 +922,11 @@
if( eRet != osl_File_E_None )
return eRet;
+#ifdef MACOSX
+ if ( macxp_resolveAlias( path, PATH_MAX ) != 0 )
+ return oslTranslateFileError( OSL_FET_ERROR, errno );
+#endif /* MACOSX */
+
return osl_psz_getVolumeInformation( path, pInfo, uFieldMask);
}
@@ -865,6 +946,11 @@
if( eRet != osl_File_E_None )
return eRet;
+#ifdef MACOSX
+ if ( macxp_resolveAlias( path, PATH_MAX ) != 0 )
+ return oslTranslateFileError( OSL_FET_ERROR, errno );
+#endif /* MACOSX */
+
return osl_psz_createDirectory( path );
}
@@ -884,6 +970,11 @@
if( eRet != osl_File_E_None )
return eRet;
+#ifdef MACOSX
+ if ( macxp_resolveAlias( path, PATH_MAX ) != 0 )
+ return oslTranslateFileError( OSL_FET_ERROR, errno );
+#endif /* MACOSX */
+
return osl_psz_removeDirectory( path );
}
@@ -916,6 +1007,11 @@
if( eRet != osl_File_E_None )
return eRet;
+#ifdef MACOSX
+ if ( macxp_resolveAlias( path, PATH_MAX ) != 0 )
+ return oslTranslateFileError( OSL_FET_ERROR, errno );
+#endif /* MACOSX */
+
return osl_psz_setFileAttributes( path, uAttributes );
}
@@ -936,6 +1032,11 @@
if( eRet != osl_File_E_None )
return eRet;
+#ifdef MACOSX
+ if ( macxp_resolveAlias( path, PATH_MAX ) != 0 )
+ return oslTranslateFileError( OSL_FET_ERROR, errno );
+#endif /* MACOSX */
+
return osl_psz_setFileTime( path, pCreationTime, pLastAccessTime,
pLastWriteTime );
}
@@ -1955,6 +2056,10 @@
close(SourceFileFD);
close(DestFileFD);
+#if defined MACOSX && defined PRODUCT_FILETYPE
+ oslSetFileTypeFromPsz( pszDestFileName );
+#endif /* MACOSX && PRODUCT_FILETYPE */
+
return 0;
}
@@ -1973,6 +2078,26 @@
return *ustrValid;
}
+
+/*****************************************
+ * oslSetFileTypeFromPsz
+ ****************************************/
+
+#if defined MACOSX && defined PRODUCT_FILETYPE
+static void oslSetFileTypeFromPsz(const sal_Char* pszStr)
+{
+ FSRef aFSRef;
+ FSCatalogInfo aCatInfo;
+ if ( FSPathMakeRef( (const UInt8 *)pszStr, &aFSRef, 0 ) == noErr &&
FSGetCatalogInfo( &aFSRef, kFSCatInfoFinderInfo, &aCatInfo, NULL, NULL, NULL)
== noErr )
+ {
+ if ( ( (FileInfo *)&aCatInfo.finderInfo )->fileType == 0x00000000 )
+ {
+ ( (FileInfo *)&aCatInfo.finderInfo )->fileType =
(OSType)PRODUCT_FILETYPE;
+ FSSetCatalogInfo( &aFSRef, kFSCatInfoFinderInfo, &aCatInfo );
+ }
+ }
+}
+#endif /* MACOSX && PRODUCT_FILETYPE */
/*****************************************************************************
* UnicodeToText
Index: sal/osl/unx/makefile.mk
===================================================================
RCS file: /cvs/porting/sal/osl/unx/makefile.mk,v
retrieving revision 1.23.10.2
retrieving revision 1.23.10.2.6.1
diff -u -r1.23.10.2 -r1.23.10.2.6.1
--- sal/osl/unx/makefile.mk 6 Jul 2004 10:36:15 -0000 1.23.10.2
+++ sal/osl/unx/makefile.mk 18 Apr 2005 02:56:45 -0000 1.23.10.2.6.1
@@ -76,6 +76,11 @@
TARGETTYPE=CUI
+.IF "$(OS)"=="MACOSX"
+.IF "$(PRODUCT_FILETYPE)"!=""
+ENVCDEFS += -DPRODUCT_FILETYPE=\'$(PRODUCT_FILETYPE)\'
+.ENDIF # "$(PRODUCT_FILETYPE)"!=""
+.ENDIF # "$(OS)"=="MACOSX"
# --- Settings -----------------------------------------------------
Index: sal/osl/unx/module.c
===================================================================
RCS file: /cvs/porting/sal/osl/unx/module.c,v
retrieving revision 1.28
retrieving revision 1.28.142.1
diff -u -r1.28 -r1.28.142.1
--- sal/osl/unx/module.c 29 Apr 2003 08:32:35 -0000 1.28
+++ sal/osl/unx/module.c 18 Apr 2005 02:56:45 -0000 1.28.142.1
@@ -115,8 +115,14 @@
#ifndef _OSL_PROCESS_H_
#include <osl/process.h>
#endif
+#ifndef _OSL_MUTEX_H_
+#include <osl/mutex.h>
+#endif
#include <mach-o/dyld.h>
extern oslProcessError SAL_CALL osl_searchPath(const sal_Char* pszName, const
sal_Char* pszPath, sal_Char Separator, sal_Char *pszBuffer, sal_uInt32 Max);
+
+/* All Mac OS X paths are UTF-8 */
+#define osl_getThreadTextEncoding() RTL_TEXTENCODING_UTF8
#else /* MACOSX */
extern int _dlclose(void *handle);
#endif /* MACOSX */
@@ -169,6 +175,7 @@
const struct mach_header *pLib = NULL;
oslModule pModule;
sal_Char buf[PATH_MAX + 1];
+ oslMutex *pMutex;
OSL_ASSERT(pszModuleName);
@@ -176,6 +183,10 @@
return NULL;
#ifndef NO_DL_FUNCTIONS
+ // Synchronize calls to NSAddImage to prevent crashing on multiple CPUs
+ pMutex = osl_getGlobalMutex();
+ if ( pMutex )
+ osl_acquireMutex( *pMutex );
// Check if module is already loaded
strncpy(buf, pszModuleName, sizeof(buf));
@@ -202,6 +213,9 @@
pLib = NSAddImage(buf, NSADDIMAGE_OPTION_WITH_SEARCHING |
NSADDIMAGE_OPTION_RETURN_ON_ERROR);
}
+
+ if ( pMutex )
+ osl_releaseMutex( *pMutex );
if (!pLib) {
// Still couldn't find it - give up
Index: sal/osl/unx/pipe.c
===================================================================
RCS file: /cvs/porting/sal/osl/unx/pipe.c,v
retrieving revision 1.17
retrieving revision 1.17.256.1
diff -u -r1.17 -r1.17.256.1
--- sal/osl/unx/pipe.c 1 Jul 2003 14:53:28 -0000 1.17
+++ sal/osl/unx/pipe.c 18 Apr 2005 02:56:45 -0000 1.17.256.1
@@ -69,6 +69,11 @@
#include <osl/interlck.h>
#include "sockimpl.h"
+
+#ifdef MACOSX
+/* All Mac OS X paths are UTF-8 */
+#define osl_getThreadTextEncoding() RTL_TEXTENCODING_UTF8
+#endif
#define PIPEDEFAULTPATH "/tmp"
#define PIPEALTERNATEPATH "/var/tmp"
Index: sal/osl/unx/process.c
===================================================================
RCS file: /cvs/porting/sal/osl/unx/process.c,v
retrieving revision 1.31
retrieving revision 1.31.108.1
diff -u -r1.31 -r1.31.108.1
--- sal/osl/unx/process.c 2 Jul 2003 13:34:17 -0000 1.31
+++ sal/osl/unx/process.c 18 Apr 2005 02:56:46 -0000 1.31.108.1
@@ -113,6 +113,10 @@
#include "sockimpl.h"
#include "secimpl.h"
+#ifdef MACOSX
+/* All Mac OS X paths are UTF-8 */
+#define osl_getThreadTextEncoding() RTL_TEXTENCODING_UTF8
+#endif
#define MAX_ARGS 255
#define MAX_ENVS 255
@@ -1363,6 +1367,16 @@
if ((Options & osl_Process_SEARCHPATH) &&
(osl_searchPath_impl(pszImageName, NULL, '\0', path,
sizeof(path)) == osl_Process_E_None))
pszImageName = path;
+
+#ifdef MACOSX
+ // The fork() function will eventually hang the process if too many
+ // non-existant executables are called so don't bother forking if we
know
+ // exec() will fail
+ if (access(pszImageName, R_OK | X_OK))
+ {
+ return osl_Process_E_NotFound;
+ }
+#endif /* MACOSX */
Data.m_pszArgs[0] = strdup(pszImageName);
Data.m_pszArgs[1] = 0;
Index: sal/osl/unx/process_impl.cxx
===================================================================
RCS file: /cvs/porting/sal/osl/unx/process_impl.cxx,v
retrieving revision 1.3
retrieving revision 1.3.108.1
diff -u -r1.3 -r1.3.108.1
--- sal/osl/unx/process_impl.cxx 2 Jul 2003 13:34:30 -0000 1.3
+++ sal/osl/unx/process_impl.cxx 18 Apr 2005 02:56:46 -0000
1.3.108.1
@@ -92,6 +92,11 @@
#endif
#include <string.h>
+
+ #ifdef MACOSX
+ /* All Mac OS X paths are UTF-8 */
+ #define osl_getThreadTextEncoding() RTL_TEXTENCODING_UTF8
+ #endif
//------------------------------------
// forward
Index: sal/osl/unx/profile.c
===================================================================
RCS file: /cvs/porting/sal/osl/unx/profile.c,v
retrieving revision 1.13
retrieving revision 1.13.146.1
diff -u -r1.13 -r1.13.146.1
--- sal/osl/unx/profile.c 13 May 2003 12:28:24 -0000 1.13
+++ sal/osl/unx/profile.c 18 Apr 2005 02:56:46 -0000 1.13.146.1
@@ -68,6 +68,11 @@
#include <osl/thread.h>
#include <rtl/alloc.h>
#include <osl/util.h>
+
+#ifdef MACOSX
+/* All Mac OS X paths are UTF-8 */
+#define osl_getThreadTextEncoding() RTL_TEXTENCODING_UTF8
+#endif
#define LINES_INI 32
#define LINES_ADD 10
Index: sal/osl/unx/security.c
===================================================================
RCS file: /cvs/porting/sal/osl/unx/security.c,v
retrieving revision 1.7.62.2
retrieving revision 1.7.62.2.2.1
diff -u -r1.7.62.2 -r1.7.62.2.2.1
--- sal/osl/unx/security.c 27 Aug 2004 10:22:34 -0000 1.7.62.2
+++ sal/osl/unx/security.c 18 Apr 2005 02:56:46 -0000 1.7.62.2.2.1
@@ -73,6 +73,11 @@
#endif
#include "secimpl.h"
+
+#ifdef MACOSX
+/* All Mac OS X paths are UTF-8 */
+#define osl_getThreadTextEncoding() RTL_TEXTENCODING_UTF8
+#endif
#ifndef PAM_BINARY_MSG
#define PAM_BINARY_MSG 6
Index: sal/osl/unx/signal.c
===================================================================
RCS file: /cvs/porting/sal/osl/unx/signal.c,v
retrieving revision 1.17.10.3
retrieving revision 1.17.10.3.22.1
diff -u -r1.17.10.3 -r1.17.10.3.22.1
--- sal/osl/unx/signal.c 9 Jan 2004 18:31:47 -0000 1.17.10.3
+++ sal/osl/unx/signal.c 18 Apr 2005 02:56:46 -0000 1.17.10.3.22.1
@@ -360,6 +360,7 @@
static int ReportCrash( int Signal )
{
+#ifndef MACOSX
static sal_Bool bCrashReporterExecuted = sal_False;
sal_uInt32 argi;
@@ -596,28 +597,25 @@
return 0;
}
+#endif /* !MACOSX */
return 1;
}
static void PrintStack( int sig )
{
- void *buffer[MAX_STACK_FRAMES];
#ifndef MACOSX
+ void *buffer[MAX_STACK_FRAMES];
int size = backtrace( buffer, sizeof(buffer) / sizeof(buffer[0]) );
-#endif
fprintf( stderr, "\n\nFatal exception: Signal %d\n", sig );
-#ifdef MACOSX
- fprintf( stderr, "Please turn on Enable Crash Reporting and\nAutomatic
Display of Crashlogs in the Console application\n" );
-#else
if ( size > 0 )
{
fputs( "Stack:\n", stderr );
backtrace_symbols_fd( buffer, size, fileno(stderr) );
}
-#endif
+#endif /* !MACOSX */
}
static oslSignalAction CallSignalHandler(oslSignalInfo *pInfo)
Index: sal/osl/unx/system.c
===================================================================
RCS file: /cvs/porting/sal/osl/unx/system.c,v
retrieving revision 1.8
retrieving revision 1.8.252.1
diff -u -r1.8 -r1.8.252.1
--- sal/osl/unx/system.c 16 Jul 2003 17:21:47 -0000 1.8
+++ sal/osl/unx/system.c 18 Apr 2005 02:56:47 -0000 1.8.252.1
@@ -563,16 +563,23 @@
* 3) P_tmpdir (defined in stdio.h)
* 4) /tmp
*/
+#ifdef MACOSX
+ /* But because /tmp gets automatically cleaned up with each reboot, we
+ * won't use P_tmpdir.
+ */
+#endif /* MACOSX */
/* Get the length of whatever temp dir we are going to use. */
if ( (envTempDir=getenv("TMPDIR")) != NULL )
tempDirLen = strlen( envTempDir );
else if ( tmpdir != NULL )
tempDirLen = strlen( tmpdir );
+#ifdef MACOSX
#ifdef P_tmpdir
else if ( P_tmpdir != NULL )
tempDirLen = strlen( P_tmpdir );
#endif
+#endif /* MACOSX */
else
tempDirLen = strlen( kLastResortTempDir );
tempDirLen++;
@@ -595,10 +602,12 @@
strncpy( tempFilePathAndPrefix, envTempDir,
tempDirLen );
else if ( tmpdir != NULL )
strncpy( tempFilePathAndPrefix, tmpdir,
tempDirLen );
+#ifdef MACOSX
#ifdef P_tmpdir
else if ( P_tmpdir != NULL )
strncpy( tempFilePathAndPrefix,
P_tmpdir, tempDirLen );
#endif
+#endif /* MACOSX */
else
strncpy( tempFilePathAndPrefix,
kLastResortTempDir, tempDirLen );
@@ -670,6 +679,72 @@
*minorMinorVersion = 0;
}
+int macxp_resolveAlias(char *path, int buflen)
+{
+ FSRef aFSRef;
+ OSStatus nErr;
+ MacOSBoolean bFolder;
+ MacOSBoolean bAliased;
+ char *unprocessedPath = path;
+
+ if ( *unprocessedPath == '/' )
+ unprocessedPath++;
+
+ int nRet = 0;
+ while ( !nRet && unprocessedPath && *unprocessedPath )
+ {
+ unprocessedPath = strchr( unprocessedPath, '/' );
+ if ( unprocessedPath )
+ *unprocessedPath = '\0';
+
+ nErr = noErr;
+ bFolder = FALSE;
+ bAliased = FALSE;
+ if ( FSPathMakeRef( (const UInt8 *)path, &aFSRef, 0 ) == noErr )
+ {
+ nErr = FSResolveAliasFileWithMountFlags( &aFSRef, TRUE, &bFolder,
&bAliased, kResolveAliasFileNoUI );
+ if ( nErr == nsvErr )
+ {
+ errno = ENOENT;
+ nRet = -1;
+ }
+ else if ( nErr == noErr && bAliased )
+ {
+ char tmpPath[ PATH_MAX ];
+ if ( FSRefMakePath( &aFSRef, (UInt8 *)tmpPath, PATH_MAX ) ==
noErr )
+ {
+ int nLen = strlen( tmpPath ) + ( unprocessedPath ? strlen(
unprocessedPath + 1 ) + 1 : 0 );
+ if ( nLen < buflen && nLen < PATH_MAX )
+ {
+ if ( unprocessedPath )
+ {
+ int nTmpPathLen = strlen( tmpPath );
+ strcat( tmpPath, "/" );
+ strcat( tmpPath, unprocessedPath + 1 );
+ strcpy( path, tmpPath);
+ unprocessedPath = path + nTmpPathLen;
+ }
+ else if ( !unprocessedPath )
+ {
+ strcpy( path, tmpPath);
+ }
+ }
+ else
+ {
+ errno = ENAMETOOLONG;
+ nRet = -1;
+ }
+ }
+ }
+ }
+
+ if ( unprocessedPath )
+ *unprocessedPath++ = '/';
+ }
+
+ return nRet;
+}
+
#endif /* defined MACOSX */
#endif /* NO_PTHREAD_RTL */
@@ -802,7 +877,7 @@
{
v1=strtok(buf,".");
v2=strtok(NULL,".");
- strcpy(ret,v1);
+ sctrcpy(ret,v1);
strcat(ret,v2);
}
else
Index: sal/osl/unx/system.h
===================================================================
RCS file: /cvs/porting/sal/osl/unx/system.h,v
retrieving revision 1.19.10.1
retrieving revision 1.19.10.1.46.1
diff -u -r1.19.10.1 -r1.19.10.1.46.1
--- sal/osl/unx/system.h 15 Aug 2003 11:38:50 -0000 1.19.10.1
+++ sal/osl/unx/system.h 18 Apr 2005 02:56:47 -0000 1.19.10.1.46.1
@@ -397,6 +397,8 @@
/* fixme are premac and postmac still needed here? */
# include <premac.h>
# include <mach-o/dyld.h>
+# define __OPENTRANSPORTPROVIDERS__
+# include <Carbon/Carbon.h>
# include <postmac.h>
# if BYTE_ORDER == LITTLE_ENDIAN
# define _LITTLE_ENDIAN
@@ -413,6 +415,13 @@
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 );
+#ifdef __cplusplus
+extern "C" {
+#endif
+int macxp_resolveAlias(char *path, int buflen);
+#ifdef __cplusplus
+}
+#endif
#endif
#if !defined(_WIN32) && !defined(_WIN16) && !defined(OS2) && \
Index: sal/osl/unx/tempfile.c
===================================================================
RCS file: /cvs/porting/sal/osl/unx/tempfile.c,v
retrieving revision 1.5.28.1
retrieving revision 1.5.28.1.18.1
diff -u -r1.5.28.1 -r1.5.28.1.18.1
--- sal/osl/unx/tempfile.c 28 Jan 2004 10:18:07 -0000 1.5.28.1
+++ sal/osl/unx/tempfile.c 18 Apr 2005 02:56:47 -0000 1.5.28.1.18.1
@@ -92,6 +92,11 @@
#ifndef _FILE_URL_H_
#include "file_url.h"
#endif
+
+#ifdef MACOSX
+/* All Mac OS X paths are UTF-8 */
+#define osl_getThreadTextEncoding() RTL_TEXTENCODING_UTF8
+#endif
/*****************************************************************/
/* osl_getTempFirURL */
@@ -99,6 +104,21 @@
oslFileError SAL_CALL osl_getTempDirURL( rtl_uString** pustrTempDir )
{
+#ifdef MACOSX
+ /* There are a number of temp paths to choose from... The order
+ * from the MacOS X man page is:
+ * 1) the environment variable TMPDIR
+ * 2) tmpdir argument
+ * 3) P_tmpdir (defined in stdio.h)
+ * 4) /tmp
+ * But because /tmp gets automatically cleaned up with each reboot, we
+ * won't use P_tmpdir.
+ */
+ const char *pValue = getenv( "TMPDIR" );
+
+ if ( !pValue )
+ pValue = "/tmp";
+#else /* MACOSX */
const char *pValue = getenv( "TEMP" );
if ( !pValue )
@@ -109,6 +129,7 @@
pValue = P_tmpdir;
#endif
}
+#endif /* MACOSX */
if ( pValue )
{
Index: sal/osl/unx/uunxapi.cxx
===================================================================
RCS file: /cvs/porting/sal/osl/unx/uunxapi.cxx,v
retrieving revision 1.2
retrieving revision 1.2.160.1
diff -u -r1.2 -r1.2.160.1
--- sal/osl/unx/uunxapi.cxx 26 Mar 2003 16:46:06 -0000 1.2
+++ sal/osl/unx/uunxapi.cxx 18 Apr 2005 02:56:47 -0000 1.2.160.1
@@ -74,7 +74,13 @@
#ifndef _OSL_THREAD_H_
#include <osl/thread.h>
#endif
-
+
+ #ifdef MACOSX
+ #include "system.h"
+
+ /* All Mac OS X paths are UTF-8 */
+ #define osl_getThreadTextEncoding() RTL_TEXTENCODING_UTF8
+ #endif
/***********************************
access_u
@@ -85,6 +91,16 @@
rtl::OString p = rtl::OUStringToOString(
rtl::OUString(const_cast<rtl_uString*>(pustrPath)),
osl_getThreadTextEncoding());
+
+ #ifdef MACOSX
+ sal_Char path[ PATH_MAX ];
+ if ( p.getLength() < PATH_MAX )
+ {
+ strcpy( path, p.getStr() );
+ macxp_resolveAlias( path, PATH_MAX );
+ p = rtl::OString( path );
+ }
+ #endif
return access(p.getStr(), mode);
}
@@ -99,6 +115,16 @@
rtl::OUString(const_cast<rtl_uString*>(pustrFileName)),
osl_getThreadTextEncoding());
+ #ifdef MACOSX
+ sal_Char path[ PATH_MAX ];
+ if ( fn.getLength() < PATH_MAX )
+ {
+ strcpy( path, fn.getStr() );
+ macxp_resolveAlias( path, PATH_MAX );
+ fn = rtl::OString( path );
+ }
+ #endif
+
char rp[PATH_MAX];
bool bRet = realpath(fn.getStr(), rp);
@@ -122,6 +148,16 @@
rtl::OString p = rtl::OUStringToOString(
rtl::OUString(const_cast<rtl_uString*>(pustrPath)),
osl_getThreadTextEncoding());
+
+ #ifdef MACOSX
+ sal_Char path[ PATH_MAX ];
+ if ( p.getLength() < PATH_MAX )
+ {
+ strcpy( path, p.getStr() );
+ macxp_resolveAlias( path, PATH_MAX );
+ p = rtl::OString( path );
+ }
+ #endif
return lstat(p.getStr(), buf);
}
Index: sal/rtl/source/alloc.c
===================================================================
RCS file: /cvs/porting/sal/rtl/source/alloc.c,v
retrieving revision 1.11.10.1
retrieving revision 1.11.10.1.22.1
diff -u -r1.11.10.1 -r1.11.10.1.22.1
--- sal/rtl/source/alloc.c 9 Jan 2004 18:31:51 -0000 1.11.10.1
+++ sal/rtl/source/alloc.c 18 Apr 2005 02:56:47 -0000 1.11.10.1.22.1
@@ -165,6 +165,14 @@
#define RTL_MEMORY_ALLOC(n) __rtl_memory_vmalloc((size_t)(n))
#define RTL_MEMORY_FREE(p, n) munmap((void*)(p), (size_t)(n))
+
+#ifdef MACOSX
+/*
+ * Fix bug 682 by using system functions. Using mmap() and munmap() can
+ * sometimes cause crashing on Panther in delete[] calls.
+ */
+#define FORCE_SYSALLOC
+#endif /* MACOSX */
#endif /* SAL_UNX */
Index: sal/systools/macxp_extras/x11osx/osxlocale.c
===================================================================
RCS file: /cvs/porting/sal/systools/macxp_extras/x11osx/osxlocale.c,v
retrieving revision 1.2.10.3
retrieving revision 1.2.10.3.2.1
diff -u -r1.2.10.3 -r1.2.10.3.2.1
--- sal/systools/macxp_extras/x11osx/osxlocale.c 27 Aug 2004 10:23:08
-0000 1.2.10.3
+++ sal/systools/macxp_extras/x11osx/osxlocale.c 18 Apr 2005 02:56:48
-0000 1.2.10.3.2.1
@@ -73,70 +73,35 @@
*/
int macxp_getOSXLocale( char *locale, sal_uInt32 bufferLen )
{
+ CFBundleRef rBundle;
-#if (BUILD_OS_MAJOR == 10) && (BUILD_OS_MINOR == 2)
-// Jaguar code
- LocaleRef lref;
- CFArrayRef aref;
- CFStringRef sref;
- CFStringRef locNameRef;
-
- aref = (CFArrayRef)CFPreferencesCopyAppValue( CFSTR( "AppleLanguages"
), kCFPreferencesCurrentApplication );
- if ( aref != NULL )
+ locale[0] = '\0';
+ rBundle = CFBundleGetMainBundle();
+ if ( rBundle )
{
- if ( (CFGetTypeID(aref) == CFArrayGetTypeID()) &&
(CFArrayGetCount(aref) > 0) )
+ CFArrayRef rAvailableLocales = CFBundleCopyBundleLocalizations(
rBundle );
+ if ( rAvailableLocales )
{
- sref = (CFStringRef)CFArrayGetValueAtIndex( aref, 0 );
- if ( (sref != NULL) && (CFGetTypeID(sref) ==
CFStringGetTypeID()) )
+ CFArrayRef rPreferredLocales =
CFBundleCopyPreferredLocalizationsFromArray( rAvailableLocales );
+ if ( rPreferredLocales )
{
- if ( CFStringGetCString( sref, locale,
bufferLen, CFStringGetSystemEncoding() ) )
+ CFStringRef rString =
(CFStringRef)CFArrayGetValueAtIndex( rPreferredLocales, 0 );
+ if ( rString )
{
- LocaleRefFromLocaleString( locale,
&lref );
- LocaleRefGetPartString( lref,
kLocaleAllPartsMask, bufferLen, locale );
-
- /* Hack for US english locales. OS X
returns only "en", but we want
- * "en_US". So add it.
- */
- if ( (strlen(locale) == 2) &&
(strncmp(locale, "en", 2) == 0) )
- strncat( locale, "_US",
bufferLen - strlen(locale) - 1 );
- // For Japanese locale, just "ja" is
not sufficient.
- // Use "ja_JP.UTF-8" instead.
- if ( (strlen(locale) == 2) &&
(strncmp(locale, "ja", 2) == 0) )
- strlcpy( locale, "ja_JP.UTF-8",
bufferLen );
+ if ( !CFStringGetCString( rString,
locale, bufferLen, kCFStringEncodingUTF8 ) )
+ locale[0] = '\0';
+
}
+ CFRelease( rPreferredLocales );
}
- else
- fprintf( stderr, "Could not get array index 0
value of CFPref AppleLanguages!\n" );
+ CFRelease( rAvailableLocales );
}
+ }
- CFRelease( aref );
- }
- else
- fprintf( stderr, "Could not get value of CFPref AppleLanguages!
Please reset your locale in the International control panel.\n" );
+ if ( !strlen( locale ) )
+ strcpy( locale, "en" );
return( noErr );
-
-#else
-// Panther and later code
-
- CFStringRef lstr;
- CFLocaleRef lref;
-
- lref = CFLocaleCopyCurrent();
- lstr = CFLocaleGetIdentifier(lref);
- CFStringGetCString(lstr, locale, bufferLen, kCFStringEncodingASCII);
- CFRelease(lref);
- CFRelease(lstr);
-
- if ( strchr(locale, '.') == NULL )
- strlcat( locale, ".UTF-8", bufferLen );
-
- // fprintf(stderr,"returned locale string is %s\n",locale);
-
- return ( noErr );
-
-#endif
-
}
Index: sal/textenc/tencinfo.c
===================================================================
RCS file: /cvs/porting/sal/textenc/tencinfo.c,v
retrieving revision 1.22
retrieving revision 1.22.62.1
diff -u -r1.22 -r1.22.62.1
--- sal/textenc/tencinfo.c 20 Jun 2003 10:11:52 -0000 1.22
+++ sal/textenc/tencinfo.c 18 Apr 2005 02:56:48 -0000 1.22.62.1
@@ -169,6 +169,10 @@
const ImplStrCharsetDef* mpSecondPartTab;
} ImplStrFirstPartCharsetDef;
+#if MACOSX
+rtl_TextEncoding SAL_CALL rtl_getTextEncodingFromMacTextEncoding( sal_uInt32
nMacTextEncoding );
+#endif /* MACOSX */
+
/* ======================================================================= */
sal_Bool SAL_CALL rtl_getTextEncodingInfo( rtl_TextEncoding eTextEncoding,
rtl_TextEncodingInfo* pEncInfo )
@@ -247,12 +251,18 @@
default: eTextEncoding = RTL_TEXTENCODING_DONTKNOW; break;
};
+#ifdef MACOSX
+ /* Mac OS X sets the encoding in RTF files to 77 + nWinCharset */
+ if ( eTextEncoding == RTL_TEXTENCODING_DONTKNOW && nWinCharset >= 77 )
+ eTextEncoding = rtl_getTextEncodingFromMacTextEncoding( nWinCharset -
77 );
+#endif /* MACOSX */
+
return eTextEncoding;
}
/* ----------------------------------------------------------------------- */
-#if 0
+#if MACOSX
rtl_TextEncoding SAL_CALL rtl_getTextEncodingFromMacTextEncoding( sal_uInt32
nMacTextEncoding )
{
@@ -408,7 +418,7 @@
return eTextEncoding;
}
-#endif
+#endif /* MACOSX */
/* ----------------------------------------------------------------------- */
Index: sal/util/makefile.mk
===================================================================
RCS file: /cvs/porting/sal/util/makefile.mk,v
retrieving revision 1.31
retrieving revision 1.31.118.1
diff -u -r1.31 -r1.31.118.1
--- sal/util/makefile.mk 16 Jul 2003 17:23:32 -0000 1.31
+++ sal/util/makefile.mk 18 Apr 2005 02:56:49 -0000 1.31.118.1
@@ -160,7 +160,7 @@
.ENDIF # UNX
.IF "$(OS)"=="MACOSX"
-SHL1STDLIBS+=-lstlport_gcc -framework CoreFoundation
+SHL1STDLIBS+=-lstlport_gcc -framework CoreFoundation -framework Carbon
.ENDIF
SHL1LIBS+=$(SLB)$/$(TARGET).lib
Index: sc/util/makefile.mk
===================================================================
RCS file: /cvs/sc/sc/util/makefile.mk,v
retrieving revision 1.18.42.1
retrieving revision 1.18.42.1.102.1
diff -u -r1.18.42.1 -r1.18.42.1.102.1
--- sc/util/makefile.mk 15 Aug 2003 11:52:48 -0000 1.18.42.1
+++ sc/util/makefile.mk 18 Apr 2005 02:50:47 -0000 1.18.42.1.102.1
@@ -69,6 +69,10 @@
GEN_HID_OTHER=TRUE
# --- Settings -----------------------------------------------------------
+
+# Indic resources are too big for the resource compiler
+RES_HINDI :=
+RES_KANNADA :=
.INCLUDE : svpre.mk
.INCLUDE : connectivity/version.mk
Index: scp/source/office/files.scp
===================================================================
RCS file: /cvs/installation/scp/source/office/Attic/files.scp,v
retrieving revision 1.369.16.19
retrieving revision 1.369.16.19.6.1
diff -u -r1.369.16.19 -r1.369.16.19.6.1
--- scp/source/office/files.scp 28 Oct 2004 11:54:26 -0000 1.369.16.19
+++ scp/source/office/files.scp 18 Apr 2005 02:51:07 -0000 1.369.16.19.6.1
@@ -1037,7 +1037,11 @@
Styles = (PACKED);
Dir = GID_DIR_PROGRAM;
#ifdef UNX
+ #ifdef MACOSX
+ Name = "libdb_java-4.2.jnilib";
+ #else
Name = STRING(CONCAT2(libdb_java-4.2,UNXSUFFIX));
+ #endif
#else
Name = "libdb_java42.dll";
#endif
Index: shell/source/cmdmail/cmdmailmsg.cxx
===================================================================
RCS file: /cvs/gsl/shell/source/cmdmail/cmdmailmsg.cxx,v
retrieving revision 1.2.24.1
retrieving revision 1.2.24.1.14.1
diff -u -r1.2.24.1 -r1.2.24.1.14.1
--- shell/source/cmdmail/cmdmailmsg.cxx 6 Jul 2004 10:52:16 -0000 1.2.24.1
+++ shell/source/cmdmail/cmdmailmsg.cxx 19 Apr 2005 03:45:59 -0000
1.2.24.1.14.1
@@ -261,7 +261,7 @@
{
MutexGuard aGuard( m_aMutex );
m_Attachments = aAttachment;
-#ifdef MACOSX
+#if defined MACOSX && ! defined USE_JAVA
sal_uInt32 nmax = m_Attachments.getLength();
for (sal_uInt32 i = 0; i < nmax; i++) {
OUString tmp;
Index: shell/source/cmdmail/cmdmailsuppl.cxx
===================================================================
RCS file: /cvs/gsl/shell/source/cmdmail/cmdmailsuppl.cxx,v
retrieving revision 1.5.92.1
retrieving revision 1.5.92.1.2.1
diff -u -r1.5.92.1 -r1.5.92.1.2.1
--- shell/source/cmdmail/cmdmailsuppl.cxx 27 Sep 2004 08:32:07 -0000
1.5.92.1
+++ shell/source/cmdmail/cmdmailsuppl.cxx 19 Apr 2005 03:45:59 -0000
1.5.92.1.2.1
@@ -415,6 +415,17 @@
aArgumentList[nArguments - 1] = aCommandLine.copy(
nLastIndex );
+#if defined MACOSX && defined USE_JAVA
+ // Mac OS X's open command cannot handle URLs properly for
+ // mail applications so convert URL to a path
+ for ( n = 0; n < aArgumentList.getLength(); n++ )
+ {
+ OUString aPath;
+ if ( aArgumentList[n].indexOf(
OUString::createFromAscii( "file://" ) ) == 0 && osl_getSystemPathFromFileURL(
aArgumentList[n].pData, &aPath.pData ) == osl_File_E_None )
+ aArgumentList[n] = aPath;
+ }
+#endif // MACOSX && USE_JAVA
+
oslProcess aProcess;
rtl_uString **pArgumentArray = (rtl_uString **)
aArgumentList.getArray();
Index: solenv/inc/unxmacxp.mk
===================================================================
RCS file: /cvs/tools/solenv/inc/unxmacxp.mk,v
retrieving revision 1.43.8.3
retrieving revision 1.43.8.3.40.1
diff -u -r1.43.8.3 -r1.43.8.3.40.1
--- solenv/inc/unxmacxp.mk 28 Jan 2004 17:32:17 -0000 1.43.8.3
+++ solenv/inc/unxmacxp.mk 18 Apr 2005 02:51:38 -0000 1.43.8.3.40.1
@@ -214,10 +214,19 @@
STDSLOCUI=
STDLIBGUIST=-lm
+.IF "$(GUIBASE)"=="unx"
STDLIBCUIST=-lX11 -lpthread -lm
+.ELSE
+STDLIBCUIST=-lpthread -lm
+.ENDIF
STDLIBGUIMT=-lpthread -lm
+.IF "$(GUIBASE)"=="unx"
STDLIBCUIMT=-lX11 -lm
STDSHLGUIMT=-lX11 -lXext -lpthread -m
+.ELSE
+STDLIBCUIMT=-lm
+STDSHLGUIMT=-lpthread -m
+.ENDIF
STDSHLCUIMT=-lpthread -lm
LIBMGR=ar
Index: store/source/fileunx.hxx
===================================================================
RCS file: /cvs/ucb/store/source/fileunx.hxx,v
retrieving revision 1.2.22.1
retrieving revision 1.2.22.1.28.1
diff -u -r1.2.22.1 -r1.2.22.1.28.1
--- store/source/fileunx.hxx 15 Aug 2003 11:53:11 -0000 1.2.22.1
+++ store/source/fileunx.hxx 18 Apr 2005 19:16:24 -0000 1.2.22.1.28.1
@@ -251,7 +251,13 @@
lock.l_start = 0;
lock.l_len = 0;
+#ifdef MACOSX
+ // Mac OS X will return ENOTSUP for mounted file systems so ignore the
+ // error for read locks
+ if (::fcntl (rhFile, F_SETLK, &lock) < 0 && errno != ENOTSUP &&
lock.l_type == F_RDLCK)
+#else // MACOSX
if (::fcntl (rhFile, F_SETLK, &lock) < 0)
+#endif // MACOSX
{
// Save original result.
storeError result;
Index: sw/source/core/unocore/unocoll.cxx
===================================================================
RCS file: /cvs/sw/sw/source/core/unocore/unocoll.cxx,v
retrieving revision 1.23
retrieving revision 1.23.446.1
diff -u -r1.23 -r1.23.446.1
--- sw/source/core/unocore/unocoll.cxx 30 Jun 2003 15:52:15 -0000 1.23
+++ sw/source/core/unocore/unocoll.cxx 18 Apr 2005 02:58:42 -0000
1.23.446.1
@@ -600,6 +600,9 @@
break;
case SW_SERVICE_IMAP_POLYGON :
xRet = SvUnoImageMapPolygonObject_createInstance(
lcl_GetSupportedMacroItems() );
+ break;
+ case SW_SERVICE_FIELDTYPE_DUMMY_0:
+ // Do nothing
break;
default:
throw uno::RuntimeException();
Index: sw/source/ui/uiview/viewprt.cxx
===================================================================
RCS file: /cvs/sw/sw/source/ui/uiview/viewprt.cxx,v
retrieving revision 1.21
retrieving revision 1.21.280.1
diff -u -r1.21 -r1.21.280.1
--- sw/source/ui/uiview/viewprt.cxx 28 Jul 2003 12:32:55 -0000 1.21
+++ sw/source/ui/uiview/viewprt.cxx 18 Apr 2005 02:58:43 -0000
1.21.280.1
@@ -528,9 +528,17 @@
SFX_REQUEST_ARG(rReq, pSilentItem, SfxBoolItem, SID_SILENT, FALSE);
BOOL bSilent = pSilentItem ? pSilentItem->GetValue() : FALSE;
SFX_REQUEST_ARG(rReq, pPrintFromMergeItem, SfxBoolItem,
FN_QRY_MERGE, FALSE);
+#ifdef MACOSX
+ // Fix bug 206 by retrieving the value before removing
it as once
+ // it is removed, it will sometimes be set by the
compiler to FALSE
+ BOOL bFromMerge = pPrintFromMergeItem ?
pPrintFromMergeItem->GetValue() : FALSE;
+ if(pPrintFromMergeItem)
+ rReq.RemoveItem(FN_QRY_MERGE);
+#else // MACOSX
if(pPrintFromMergeItem)
rReq.RemoveItem(FN_QRY_MERGE);
BOOL bFromMerge = pPrintFromMergeItem ?
pPrintFromMergeItem->GetValue() : FALSE;
+#endif // MACOSX
if(!bSilent && !bFromMerge && pSh->IsAnyDatabaseFieldInDoc())
{
QueryBox aBox( &GetEditWin(), SW_RES( MSG_PRINT_AS_MERGE ));
Index: ucbhelper/source/client/proxydecider.cxx
===================================================================
RCS file: /cvs/ucb/ucbhelper/source/client/proxydecider.cxx,v
retrieving revision 1.3.16.1
retrieving revision 1.3.16.1.2.1
diff -u -r1.3.16.1 -r1.3.16.1.2.1
--- ucbhelper/source/client/proxydecider.cxx 20 Oct 2004 12:04:36 -0000
1.3.16.1
+++ ucbhelper/source/client/proxydecider.cxx 18 Apr 2005 14:39:59 -0000
1.3.16.1.2.1
@@ -125,6 +125,9 @@
#else
#include <netdb.h>
#include <unistd.h>
+#ifdef MACOSX
+#include <sys/socket.h>
+#endif // MACOSX
#endif
#ifdef SOLARIS
Index: vcl/util/makefile.mk
===================================================================
RCS file: /cvs/gsl/vcl/util/makefile.mk,v
retrieving revision 1.47.10.4
retrieving revision 1.47.10.4.10.1
diff -u -r1.47.10.4 -r1.47.10.4.10.1
--- vcl/util/makefile.mk 14 Sep 2004 13:17:44 -0000 1.47.10.4
+++ vcl/util/makefile.mk 18 Apr 2005 02:52:24 -0000 1.47.10.4.10.1
@@ -299,7 +299,7 @@
SHL1STDLIBS += -lXp -lXext -lSM -lICE -lX11
.ELSE
.IF "$(USE_XINERAMA)" != "NO"
-.IF "$(XINERAMA_LINK)" == "dynamic"
+.IF "$(XINERAMA_LINK)" == "dynamic" || "$(OS)" == "MACOSX"
SHL1STDLIBS += -lXinerama
.ELSE
SHL1STDLIBS += -Wl,-Bstatic -lXinerama -Wl,-Bdynamic
Index: xmlhelp/source/cxxhelp/provider/db.cxx
===================================================================
RCS file: /cvs/util/xmlhelp/source/cxxhelp/provider/db.cxx,v
retrieving revision 1.1.4.1
retrieving revision 1.1.4.1.2.1
diff -u -r1.1.4.1 -r1.1.4.1.2.1
--- xmlhelp/source/cxxhelp/provider/db.cxx 28 Oct 2004 11:53:10 -0000
1.1.4.1
+++ xmlhelp/source/cxxhelp/provider/db.cxx 18 Apr 2005 02:52:45 -0000
1.1.4.1.2.1
@@ -116,7 +116,7 @@
}
-Dbt::Dbt(void *data_arg, u_int32_t size_arg)
+Dbt::Dbt(void *data_arg, size_t size_arg)
: m_pDBT((DBT*)rtl_allocateZeroMemory(sizeof(DBT)))
{
set_data(data_arg);--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
