diff options
author | Mathias Bauer <mba@openoffice.org> | 2009-09-09 11:45:13 +0200 |
---|---|---|
committer | Mathias Bauer <mba@openoffice.org> | 2009-09-09 11:45:13 +0200 |
commit | c617ecebd7e6f5b5ec29f32ca54decf649c00d7a (patch) | |
tree | f4dbae1cc849da6ad5e2fb454ffa8542eaf97920 /sal | |
parent | 5518e93f0d8c739938783054082eeda4c1c0d06b (diff) | |
parent | 1f5e32262c475444b09293e7e7b78141a1704696 (diff) |
merge commit to DEV300_m57
Diffstat (limited to 'sal')
-rw-r--r-- | sal/inc/rtl/logfile.h | 8 | ||||
-rw-r--r-- | sal/inc/rtl/logfile.hxx | 11 | ||||
-rw-r--r-- | sal/inc/systools/win32/snprintf.h | 4 | ||||
-rw-r--r-- | sal/osl/os2/util.c | 5 | ||||
-rw-r--r-- | sal/osl/unx/file.cxx | 69 | ||||
-rw-r--r-- | sal/osl/unx/file_impl.hxx | 48 | ||||
-rw-r--r-- | sal/osl/unx/file_path_helper.cxx | 10 | ||||
-rw-r--r-- | sal/osl/unx/file_path_helper.h | 17 | ||||
-rw-r--r-- | sal/osl/unx/file_path_helper.hxx | 19 | ||||
-rw-r--r-- | sal/osl/unx/file_stat.cxx | 70 | ||||
-rw-r--r-- | sal/osl/unx/file_url.cxx | 56 | ||||
-rw-r--r-- | sal/osl/unx/process.c | 12 | ||||
-rw-r--r-- | sal/osl/unx/security.c | 9 | ||||
-rw-r--r-- | sal/osl/unx/util.c | 77 | ||||
-rw-r--r-- | sal/osl/w32/conditn.c | 3 | ||||
-rw-r--r-- | sal/osl/w32/diagnose.c | 4 | ||||
-rw-r--r-- | sal/osl/w32/util.c | 9 | ||||
-rw-r--r-- | sal/rtl/source/logfile.cxx | 5 | ||||
-rw-r--r-- | sal/systools/win32/uwinapi/makefile.mk | 4 | ||||
-rw-r--r-- | sal/util/makefile.mk | 4 | ||||
-rwxr-xr-x | sal/util/sal.map | 5 |
21 files changed, 243 insertions, 206 deletions
diff --git a/sal/inc/rtl/logfile.h b/sal/inc/rtl/logfile.h index 232232a4c3ed..66789d92426e 100644 --- a/sal/inc/rtl/logfile.h +++ b/sal/inc/rtl/logfile.h @@ -67,6 +67,14 @@ void SAL_CALL rtl_logfile_trace( const sal_Char* pszFormat, ... ); */ void SAL_CALL rtl_logfile_longTrace(char const * format, ...); +/** Return if a log file is written. + + @return true if a log file is written + + @since UDK 3.2.11 +*/ +sal_Bool SAL_CALL rtl_logfile_hasLogFile( void ); + #ifdef __cplusplus } #endif diff --git a/sal/inc/rtl/logfile.hxx b/sal/inc/rtl/logfile.hxx index 7ce33f3ea28a..5eae13b62952 100644 --- a/sal/inc/rtl/logfile.hxx +++ b/sal/inc/rtl/logfile.hxx @@ -189,12 +189,19 @@ namespace rtl #define RTL_LOGFILE_PRODUCT_TRACE( string ) \ rtl_logfile_longTrace( "| : %s\n", string ) -#define RTL_LOGFILE_PRODUCT_CONTEXT( instance, name ) \ - ::rtl::Logfile instance( name ) #define RTL_LOGFILE_PRODUCT_TRACE1( frmt, arg1 ) \ rtl_logfile_longTrace( "| : " ); \ rtl_logfile_trace( frmt, arg1 ); \ rtl_logfile_trace( "\n" ) +#define RTL_LOGFILE_PRODUCT_CONTEXT( instance, name ) \ + ::rtl::Logfile instance( name ) +#define RTL_LOGFILE_PRODUCT_CONTEXT_TRACE1( instance, frmt, arg1 ) \ + rtl_logfile_longTrace( "| %s : ", \ + instance.getName() ); \ + rtl_logfile_trace( frmt, arg1 ); \ + rtl_logfile_trace( "\n" ) +#define RTL_LOGFILE_HASLOGFILE() \ + rtl_logfile_hasLogFile() #endif diff --git a/sal/inc/systools/win32/snprintf.h b/sal/inc/systools/win32/snprintf.h index 254726e2f37b..79441f032fee 100644 --- a/sal/inc/systools/win32/snprintf.h +++ b/sal/inc/systools/win32/snprintf.h @@ -1,4 +1,4 @@ -#ifndef _SMPRINTF_H +#ifndef _SNPRINTF_H #define _SNPRINTF_H #if !defined(_WIN32) @@ -77,4 +77,4 @@ _SNPRINTF_DLLIMPORT int __cdecl vsnprintf( char *buffer, size_t count, const cha } #endif -#endif /* _SMPRINTF_H */ +#endif /* _SNPRINTF_H */ diff --git a/sal/osl/os2/util.c b/sal/osl/os2/util.c index 4dd08c00aed3..217c71878838 100644 --- a/sal/osl/os2/util.c +++ b/sal/osl/os2/util.c @@ -32,11 +32,6 @@ -extern sal_Bool osl_getEtherAddr(sal_Char* pszAddr, sal_uInt16 BufferSize) -{ - return sal_False; -} - extern sal_Bool osl_getEthernetAddress( sal_uInt8 * pTargetAddress ) { return sal_False; diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx index e28328368a96..bd5b54a6d8c3 100644 --- a/sal/osl/unx/file.cxx +++ b/sal/osl/unx/file.cxx @@ -131,6 +131,42 @@ static const sal_Char* MOUNTTAB="/etc/mtab"; #endif +#ifdef _DIRENT_HAVE_D_TYPE +#include "file_impl.hxx" + oslDirectoryItemImpl* oslDirectoryItemImpl_CreateNew( rtl_uString* _ustrFilePath, bool _bHasDType, unsigned char _DType ) + { + oslDirectoryItemImpl *pItemObject = (oslDirectoryItemImpl*) malloc( sizeof( oslDirectoryItemImpl ) ); + pItemObject->RefCount = 1; + pItemObject->bHasType = _bHasDType; + pItemObject->DType = _DType; + pItemObject->ustrFilePath = _ustrFilePath; + + return pItemObject; + } + + void oslDirectoryItemImpl_Destroy( oslDirectoryItemImpl* pItem ) + { + if( pItem->ustrFilePath ) { + rtl_uString_release( pItem->ustrFilePath ); + pItem->ustrFilePath = NULL; + } + free( pItem ); + } + + void oslDirectoryItemImpl_acquire( oslDirectoryItemImpl* pItem ) + { + pItem->RefCount ++; + } + + void oslDirectoryItemImpl_release( oslDirectoryItemImpl* pItem ) + { + pItem->RefCount --; + + if( pItem->RefCount <= 0 ) + oslDirectoryItemImpl_Destroy( pItem ); + } +#endif + #if OSL_DEBUG_LEVEL > 1 extern void debug_ustring(rtl_uString*); @@ -467,8 +503,15 @@ oslFileError SAL_CALL osl_getNextDirectoryItem(oslDirectory Directory, oslDirect osl_systemPathMakeAbsolutePath(pDirImpl->ustrPath, ustrFileName, &ustrFilePath); rtl_uString_release( ustrFileName ); - /* use path as directory item */ - *pItem = (oslDirectoryItem) ustrFilePath; +#ifdef _DIRENT_HAVE_D_TYPE + if(*pItem) + oslDirectoryItemImpl_release( ( oslDirectoryItemImpl* )( *pItem ) ); + + *pItem = (oslDirectoryItem) oslDirectoryItemImpl_CreateNew( ustrFilePath, true, pEntry->d_type ); +#else + /* use path as directory item */ + *pItem = (oslDirectoryItem) ustrFilePath; +#endif return osl_File_E_None; } @@ -497,7 +540,11 @@ oslFileError SAL_CALL osl_getDirectoryItem( rtl_uString* ustrFileURL, oslDirecto if (0 == access_u(ustrSystemPath, F_OK)) { +#ifdef _DIRENT_HAVE_D_TYPE + *pItem = (oslDirectoryItem) oslDirectoryItemImpl_CreateNew( ustrSystemPath, false ); +#else *pItem = (oslDirectoryItem)ustrSystemPath; +#endif osl_error = osl_File_E_None; } else @@ -515,12 +562,21 @@ oslFileError SAL_CALL osl_getDirectoryItem( rtl_uString* ustrFileURL, oslDirecto oslFileError osl_acquireDirectoryItem( oslDirectoryItem Item ) { +#ifdef _DIRENT_HAVE_D_TYPE + oslDirectoryItemImpl* pImpl = (oslDirectoryItemImpl*) Item; +#else rtl_uString* ustrFilePath = (rtl_uString *) Item; +#endif OSL_ASSERT( Item ); +#ifdef _DIRENT_HAVE_D_TYPE + if( pImpl ) + oslDirectoryItemImpl_acquire( pImpl ); +#else if( ustrFilePath ) rtl_uString_acquire( ustrFilePath ); +#endif return osl_File_E_None; } @@ -531,12 +587,21 @@ oslFileError osl_acquireDirectoryItem( oslDirectoryItem Item ) oslFileError osl_releaseDirectoryItem( oslDirectoryItem Item ) { +#ifdef _DIRENT_HAVE_D_TYPE + oslDirectoryItemImpl* pImpl = (oslDirectoryItemImpl*) Item; +#else rtl_uString* ustrFilePath = (rtl_uString *) Item; +#endif OSL_ASSERT( Item ); +#ifdef _DIRENT_HAVE_D_TYPE + if( pImpl ) + oslDirectoryItemImpl_release( pImpl ); +#else if( ustrFilePath ) rtl_uString_release( ustrFilePath ); +#endif return osl_File_E_None; } diff --git a/sal/osl/unx/file_impl.hxx b/sal/osl/unx/file_impl.hxx new file mode 100644 index 000000000000..ae9d56ca85f3 --- /dev/null +++ b/sal/osl/unx/file_impl.hxx @@ -0,0 +1,48 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: $ + * $Revision: $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifdef __cplusplus +extern "C" { +#endif +typedef struct +{ + rtl_uString* ustrFilePath; /* holds native file name */ + unsigned char DType; + bool bHasType; + sal_uInt32 RefCount; +} oslDirectoryItemImpl; + + oslDirectoryItemImpl* oslDirectoryItemImpl_CreateNew( rtl_uString* _ustrFilePath, bool _bHasDType, unsigned char _DType=0 ); + void oslDirectoryItemImpl_Destroy( oslDirectoryItemImpl* pItem ); + void oslDirectoryItemImpl_acquire( oslDirectoryItemImpl* pItem ); + void oslDirectoryItemImpl_release( oslDirectoryItemImpl* pItem ); +#ifdef __cplusplus +} /* extern "C" */ +#endif diff --git a/sal/osl/unx/file_path_helper.cxx b/sal/osl/unx/file_path_helper.cxx index 0f6ad9e216ad..434a5a516e5c 100644 --- a/sal/osl/unx/file_path_helper.cxx +++ b/sal/osl/unx/file_path_helper.cxx @@ -125,16 +125,6 @@ } /****************************************** - * osl_systemPathIsAbsolutePath - *****************************************/ - - sal_Bool SAL_CALL osl_systemPathIsAbsolutePath(const rtl_uString* pustrPath) - { - OSL_PRECOND(pustrPath, "osl_systemPathIsAbsolutePath: Invalid parameter"); - return (!osl_systemPathIsRelativePath(pustrPath)); - } - - /****************************************** osl_systemPathMakeAbsolutePath *****************************************/ diff --git a/sal/osl/unx/file_path_helper.h b/sal/osl/unx/file_path_helper.h index 17c6f0b71fba..3a89077e5633 100644 --- a/sal/osl/unx/file_path_helper.h +++ b/sal/osl/unx/file_path_helper.h @@ -105,23 +105,6 @@ const rtl_uString* pustrPath); /****************************************** - osl_systemPathIsAbsolutePath - Returns true if the given path is an - absolute path and so starts with a '/' - - @param pustrPath [in] a system path - pustrPath must not be NULL - - @returns sal_True if the given path - start's with a separator else - sal_False will be returned - - *****************************************/ - - sal_Bool SAL_CALL osl_systemPathIsAbsolutePath( - const rtl_uString* pustrPath); - - /****************************************** osl_systemPathMakeAbsolutePath Append a relative path to a base path diff --git a/sal/osl/unx/file_path_helper.hxx b/sal/osl/unx/file_path_helper.hxx index ee38c14648c2..2a1d74687493 100644 --- a/sal/osl/unx/file_path_helper.hxx +++ b/sal/osl/unx/file_path_helper.hxx @@ -106,25 +106,6 @@ namespace osl } /****************************************** - systemPathIsAbsolutePath - Returns true if the given path is an - absolute path and so starts with a '/' - - @param pustrPath [in] a system path - pustrPath must not be NULL - - @returns sal_True if the given path - start's with a separator else - sal_False will be returned - - *****************************************/ - - inline bool systemPathIsAbsolutePath(const rtl::OUString& Path) - { - return osl_systemPathIsAbsolutePath(Path.pData); - } - - /****************************************** systemPathMakeAbsolutePath Append a relative path to a base path diff --git a/sal/osl/unx/file_stat.cxx b/sal/osl/unx/file_stat.cxx index ec8cead84620..3a710743a1b2 100644 --- a/sal/osl/unx/file_stat.cxx +++ b/sal/osl/unx/file_stat.cxx @@ -42,6 +42,11 @@ #ifndef _UNISTD_H #include <unistd.h> #endif + +#ifndef _DIRENT_H +#include <dirent.h> +#endif + #include <osl/file.h> #ifndef _ERRNO_H @@ -56,6 +61,9 @@ #include "file_path_helper.hxx" #include "file_error_transl.h" +#ifdef _DIRENT_HAVE_D_TYPE +#include "file_impl.hxx" +#endif namespace /* private */ { @@ -223,9 +231,19 @@ namespace /* private */ /* we only need to call stat or lstat if one of the following flags is set */ +#ifdef _DIRENT_HAVE_D_TYPE + inline bool is_stat_call_necessary(sal_uInt32 field_mask, oslDirectoryItemImpl *pImpl) +#else inline bool is_stat_call_necessary(sal_uInt32 field_mask) +#endif { - return ((field_mask & osl_FileStatus_Mask_Type) || + return ( +/* on linux the dirent might have d_type */ +#ifdef _DIRENT_HAVE_D_TYPE + ((field_mask & osl_FileStatus_Mask_Type) && (!pImpl->bHasType || pImpl->DType == DT_UNKNOWN)) || +#else + (field_mask & osl_FileStatus_Mask_Type) || +#endif (field_mask & osl_FileStatus_Mask_Attributes) || (field_mask & osl_FileStatus_Mask_CreationTime) || (field_mask & osl_FileStatus_Mask_AccessTime) || @@ -254,7 +272,11 @@ namespace /* private */ if ((NULL == Item) || (NULL == pStat)) return osl_File_E_INVAL; +#ifdef _DIRENT_HAVE_D_TYPE + file_path = rtl::OUString(reinterpret_cast<rtl_uString*>(((oslDirectoryItemImpl* ) Item)->ustrFilePath)); +#else file_path = rtl::OUString(reinterpret_cast<rtl_uString*>(Item)); +#endif OSL_ASSERT(file_path.getLength() > 0); @@ -285,10 +307,18 @@ oslFileError SAL_CALL osl_getFileStatus(oslDirectoryItem Item, oslFileStatus* pS #else struct stat file_stat; #endif - if (is_stat_call_necessary(uFieldMask) && (0 != osl::lstat(file_path, file_stat))) + +#ifdef _DIRENT_HAVE_D_TYPE + oslDirectoryItemImpl* pImpl = (oslDirectoryItemImpl*) Item; + bool bStatNeeded = is_stat_call_necessary(uFieldMask, pImpl); +#else + bool bStatNeeded = is_stat_call_necessary(uFieldMask); +#endif + + if (bStatNeeded && (0 != osl::lstat(file_path, file_stat))) return oslTranslateFileError(OSL_FET_ERROR, errno); - if (is_stat_call_necessary(uFieldMask)) + if (bStatNeeded) { // we set all these attributes because it's cheap set_file_type(file_stat, pStat); @@ -305,6 +335,40 @@ oslFileError SAL_CALL osl_getFileStatus(oslDirectoryItem Item, oslFileStatus* pS return osl_error; } } +#ifdef _DIRENT_HAVE_D_TYPE + else if (uFieldMask & osl_FileStatus_Mask_Type) + { + OSL_ASSERT(pImpl->bHasType); + + switch(pImpl->DType) + { + case DT_LNK: + pStat->eType = osl_File_Type_Link; + break; + case DT_DIR: + pStat->eType = osl_File_Type_Directory; + break; + case DT_REG: + pStat->eType = osl_File_Type_Regular; + break; + case DT_FIFO: + pStat->eType = osl_File_Type_Fifo; + break; + case DT_SOCK: + pStat->eType = osl_File_Type_Socket; + break; + case DT_CHR: + case DT_BLK: + pStat->eType = osl_File_Type_Special; + break; + default: + OSL_ASSERT(0); + pStat->eType = osl_File_Type_Unknown; + } + + pStat->uValidFields |= osl_FileStatus_Mask_Type; + } +#endif if (uFieldMask & osl_FileStatus_Mask_FileURL) { diff --git a/sal/osl/unx/file_url.cxx b/sal/osl/unx/file_url.cxx index 602e8a98beac..1d6b9172bc6d 100644 --- a/sal/osl/unx/file_url.cxx +++ b/sal/osl/unx/file_url.cxx @@ -462,39 +462,6 @@ namespace /* private */ /********************************************* ********************************************/ - sal_Unicode* ustrcpy(const sal_Unicode* s, sal_Unicode* d) - { - const sal_Unicode* sc = s; - sal_Unicode* dc = d; - - while ((*dc++ = *sc++)) - /**/; - - return d; - } - - /********************************************* - - ********************************************/ - - sal_Unicode* ustrncpy(const sal_Unicode* s, sal_Unicode* d, unsigned int n) - { - const sal_Unicode* sc = s; - sal_Unicode* dc = d; - unsigned int i = n; - - while (i--) - *dc++ = *sc++; - - if (n) - *dc = 0; - - return d; - } - - /********************************************* - - ********************************************/ sal_Unicode* ustrchrcat(const sal_Unicode chr, sal_Unicode* d) { @@ -504,17 +471,6 @@ namespace /* private */ return d; } - /********************************************* - - ********************************************/ - - sal_Unicode* ustrcat(const sal_Unicode* s, sal_Unicode* d) - { - sal_Unicode* dc = ustrtoend(d); - ustrcpy(s, dc); - return d; - } - /****************************************************** * ******************************************************/ @@ -528,18 +484,6 @@ namespace /* private */ } /****************************************************** - * Ensure that the given string has the specified last - * character if necessary append it - ******************************************************/ - - sal_Unicode* _strensurelast(sal_Unicode* pStr, sal_Unicode Chr) - { - if (!_islastchr(pStr, Chr)) - ustrchrcat(Chr, pStr); - return pStr; - } - - /****************************************************** * Remove the last part of a path, a path that has * only a '/' or no '/' at all will be returned * unmodified diff --git a/sal/osl/unx/process.c b/sal/osl/unx/process.c index a163436031d2..e5faf46548a6 100644 --- a/sal/osl/unx/process.c +++ b/sal/osl/unx/process.c @@ -650,6 +650,18 @@ static void ChildStatusProc(void *pData) close( stdOutput[0] ); close( stdError[0] ); + //if pid > 0 then a process was created, even if it later failed + //e.g. bash searching for a command to execute, and we still + //need to clean it up to avoid "defunct" processes + if (pid > 0) + { + pid_t child_pid; + do + { + child_pid = waitpid(pid, &status, 0); + } while ( 0 > child_pid && EINTR == errno ); + } + /* notify (and unblock) parent thread */ osl_setCondition(pdata->m_started); } diff --git a/sal/osl/unx/security.c b/sal/osl/unx/security.c index 53dd452e220b..5b601ee138a9 100644 --- a/sal/osl/unx/security.c +++ b/sal/osl/unx/security.c @@ -801,7 +801,14 @@ sal_Bool SAL_CALL osl_getConfigDir(oslSecurity Security, rtl_uString **pustrDire static sal_Bool SAL_CALL osl_psz_getConfigDir(oslSecurity Security, sal_Char* pszDirectory, sal_uInt32 nMax) { - return (osl_psz_getHomeDir(Security, pszDirectory, nMax)); + sal_Char *pStr = getenv("XDG_CONFIG_HOME"); + + if ((pStr == NULL) || (strlen(pStr) == 0) || + (access(pStr, 0) != 0)) + return (osl_psz_getHomeDir(Security, pszDirectory, nMax)); + + strncpy(pszDirectory, pStr, nMax); + return sal_True; } #else diff --git a/sal/osl/unx/util.c b/sal/osl/unx/util.c index c0b9e3c5aa09..66746fd3ff44 100644 --- a/sal/osl/unx/util.c +++ b/sal/osl/unx/util.c @@ -51,11 +51,10 @@ static int osl_getHWAddr(const char *ifname, char* hard_addr); static int osl_checkAddr(const char* addr); -static char* osl_decodeEtherAddr(const char *ptr, char* buff); /*****************************************************************************/ -/* osl_getEtherAddr */ +/* osl_getEthernetAddress */ /*****************************************************************************/ sal_Bool SAL_CALL osl_getEthernetAddress( sal_uInt8 * pAddr ) @@ -124,68 +123,6 @@ sal_Bool SAL_CALL osl_getEthernetAddress( sal_uInt8 * pAddr ) } -extern sal_Bool osl_getEtherAddr(sal_Char* pszAddr, sal_uInt16 BufferSize) -{ - char buff[1024]; - char hard_addr[64]; - struct ifconf ifc; - struct ifreq *ifr; - int i; - int so; - - (void) BufferSize; /* unused */ - - if ( pszAddr == 0 ) - { - return sal_False; - } - - - /* - * All we need is ... a network file descriptor. - * Normally, this is a very socket. - */ - - so = socket(AF_INET, SOCK_DGRAM, 0); - - - /* - * The first thing we have to do, get the interface configuration. - * It is a list of attached/configured interfaces - */ - - ifc.ifc_len = sizeof(buff); - ifc.ifc_buf = buff; - if ( ioctl(so, SIOCGIFCONF, &ifc) < 0 ) - { -/* fprintf(stderr, "SIOCGIFCONF: %s\n", strerror(errno));*/ - close(so); - return sal_False; - } - - close(so); - - /* - * For each of the interfaces in the interface list, - * try to get the hardware address - */ - - ifr = ifc.ifc_req; - for ( i = ifc.ifc_len / sizeof(struct ifreq) ; --i >= 0 ; ifr++ ) - { - int nRet=0; - nRet = osl_getHWAddr(ifr->ifr_name,hard_addr); - if ( nRet > 0 ) - { - osl_decodeEtherAddr(hard_addr,pszAddr); - return sal_True; - } - } - - return sal_False; -} - - /*****************************************************************************/ /* osl_getHWAddr */ /*****************************************************************************/ @@ -285,18 +222,6 @@ static int osl_checkAddr(const char* addr) } -/*****************************************************************************/ -/* osl_decodeEtherAddr */ -/*****************************************************************************/ - -static char* osl_decodeEtherAddr(const char *ptr, char* buff) -{ - sprintf(buff, "%02X:%02X:%02X:%02X:%02X:%02X", - (ptr[0] & 0377), (ptr[1] & 0377), (ptr[2] & 0377), - (ptr[3] & 0377), (ptr[4] & 0377), (ptr[5] & 0377)); - return(buff); -} - #if defined (SPARC) #if defined (SOLARIS) && !defined(__sparcv8plus) && !defined(__sparcv9) diff --git a/sal/osl/w32/conditn.c b/sal/osl/w32/conditn.c index c87d161137b4..7af4398284be 100644 --- a/sal/osl/w32/conditn.c +++ b/sal/osl/w32/conditn.c @@ -107,8 +107,7 @@ oslConditionResult SAL_CALL osl_waitCondition(oslCondition Condition, while ( 1 ) { /* Only wake up if a SendMessage call to the threads message loop is detected */ - - switch( MsgWaitForMultipleObjects( 1, &(HANDLE)Condition, FALSE, timeout, QS_SENDMESSAGE ) ) + switch( MsgWaitForMultipleObjects( 1, (HANDLE *)(&Condition), FALSE, timeout, QS_SENDMESSAGE ) ) { case WAIT_OBJECT_0 + 1: { diff --git a/sal/osl/w32/diagnose.c b/sal/osl/w32/diagnose.c index af1b67eff5ac..6a67c1aa5b0f 100644 --- a/sal/osl/w32/diagnose.c +++ b/sal/osl/w32/diagnose.c @@ -73,6 +73,7 @@ void SAL_CALL osl_breakDebug(void) void SAL_CALL osl_trace(const sal_Char* lpszFormat, ...) { va_list args; + int written = 0; va_start(args, lpszFormat); @@ -90,7 +91,8 @@ void SAL_CALL osl_trace(const sal_Char* lpszFormat, ...) { sal_Char szMessage[512]; szMessage[sizeof(szMessage)-1] = 0; - _vsnprintf( szMessage, sizeof(szMessage) -1, lpszFormat, args ); + written = _vsnprintf( szMessage, sizeof(szMessage) - 2, lpszFormat, args ); + szMessage[ written == -1 ? sizeof(szMessage) - 2 : written ] = '\n'; OutputDebugString( szMessage ); } diff --git a/sal/osl/w32/util.c b/sal/osl/w32/util.c index a952de1dba8c..34c7b7ada53d 100644 --- a/sal/osl/w32/util.c +++ b/sal/osl/w32/util.c @@ -32,15 +32,6 @@ -extern sal_Bool osl_getEtherAddr(sal_Char* pszAddr, sal_uInt16 BufferSize) -{ - /* avoid warnings */ - pszAddr = pszAddr; - BufferSize = BufferSize; - - return sal_False; -} - extern sal_Bool SAL_CALL osl_getEthernetAddress( sal_uInt8 *pAddr ) { pAddr = pAddr; /* avoid warnings */ diff --git a/sal/rtl/source/logfile.cxx b/sal/rtl/source/logfile.cxx index 9bd0a939513b..476dea11393d 100644 --- a/sal/rtl/source/logfile.cxx +++ b/sal/rtl/source/logfile.cxx @@ -250,3 +250,8 @@ extern "C" void SAL_CALL rtl_logfile_longTrace(char const * format, ...) { va_end(args); } } + +extern "C" sal_Bool SAL_CALL rtl_logfile_hasLogFile( void ) { + init(); + return g_buffer != 0; +} diff --git a/sal/systools/win32/uwinapi/makefile.mk b/sal/systools/win32/uwinapi/makefile.mk index e2a91cf3fd03..52a8561588c2 100644 --- a/sal/systools/win32/uwinapi/makefile.mk +++ b/sal/systools/win32/uwinapi/makefile.mk @@ -142,7 +142,9 @@ STDSHL= .IF "$(COM)"=="GCC" SHL1STDLIBS=\ -lmingw32 \ - -lgcc + $(MINGW_LIBGCC) +MINGWSSTDOBJ= +MINGWSSTDENDOBJ= .ELSE SHL1STDLIBS=\ unicows.lib diff --git a/sal/util/makefile.mk b/sal/util/makefile.mk index f56e6f88f058..bc8026aa860f 100644 --- a/sal/util/makefile.mk +++ b/sal/util/makefile.mk @@ -113,6 +113,10 @@ SHL1STDLIBS= \ $(COMDLG32LIB)\ $(USER32LIB)\ $(OLE32LIB) +.IF "$(COM)"=="GCC" +MINGWSSTDOBJ= +MINGWSSTDENDOBJ= +.ENDIF .ENDIF # WNT .IF "$(GUI)"=="UNX" diff --git a/sal/util/sal.map b/sal/util/sal.map index 03af5c114aa1..ad063f3794d4 100755 --- a/sal/util/sal.map +++ b/sal/util/sal.map @@ -588,6 +588,11 @@ UDK_3.9 { # OOo 3.1 rtl_math_atanh; } UDK_3.8; +UDK_3.10 { # OOo 3.2 + global: + rtl_logfile_hasLogFile; +} UDK_3.9; + PRIVATE_1.0 { global: osl_detail_ObjectRegistry_storeAddresses; |