head 1.5; access; symbols pkgsrc-2013Q2:1.5.0.20 pkgsrc-2013Q2-base:1.5 pkgsrc-2012Q4:1.5.0.18 pkgsrc-2012Q4-base:1.5 pkgsrc-2011Q4:1.5.0.16 pkgsrc-2011Q4-base:1.5 pkgsrc-2011Q2:1.5.0.14 pkgsrc-2011Q2-base:1.5 pkgsrc-2009Q4:1.5.0.12 pkgsrc-2009Q4-base:1.5 pkgsrc-2008Q4:1.5.0.10 pkgsrc-2008Q4-base:1.5 pkgsrc-2008Q3:1.5.0.8 pkgsrc-2008Q3-base:1.5 cube-native-xorg:1.5.0.6 cube-native-xorg-base:1.5 pkgsrc-2008Q2:1.5.0.4 pkgsrc-2008Q2-base:1.5 pkgsrc-2008Q1:1.5.0.2 pkgsrc-2008Q1-base:1.5 pkgsrc-2007Q4:1.4.0.24 pkgsrc-2007Q4-base:1.4 pkgsrc-2007Q3:1.4.0.22 pkgsrc-2007Q3-base:1.4 pkgsrc-2007Q2:1.4.0.20 pkgsrc-2007Q2-base:1.4 pkgsrc-2007Q1:1.4.0.18 pkgsrc-2007Q1-base:1.4 pkgsrc-2006Q4:1.4.0.16 pkgsrc-2006Q4-base:1.4 pkgsrc-2006Q3:1.4.0.14 pkgsrc-2006Q3-base:1.4 pkgsrc-2006Q2:1.4.0.12 pkgsrc-2006Q2-base:1.4 pkgsrc-2006Q1:1.4.0.10 pkgsrc-2006Q1-base:1.4 pkgsrc-2005Q4:1.4.0.8 pkgsrc-2005Q4-base:1.4 pkgsrc-2005Q3:1.4.0.6 pkgsrc-2005Q3-base:1.4 pkgsrc-2005Q2:1.4.0.4 pkgsrc-2005Q2-base:1.4 pkgsrc-2005Q1:1.4.0.2 pkgsrc-2005Q1-base:1.4 pkgsrc-2004Q4:1.2.0.6 pkgsrc-2004Q4-base:1.2 pkgsrc-2004Q3:1.2.0.4 pkgsrc-2004Q3-base:1.2 pkgsrc-2004Q2:1.2.0.2 pkgsrc-2004Q2-base:1.2 pkgsrc-2004Q1:1.1.1.1.0.12 pkgsrc-2004Q1-base:1.1.1.1 pkgsrc-2003Q4:1.1.1.1.0.10 pkgsrc-2003Q4-base:1.1.1.1 netbsd-1-6-1:1.1.1.1.0.6 netbsd-1-6-1-base:1.1.1.1 netbsd-1-6:1.1.1.1.0.8 netbsd-1-6-RELEASE-base:1.1.1.1 pkgviews:1.1.1.1.0.4 pkgviews-base:1.1.1.1 buildlink2:1.1.1.1.0.2 buildlink2-base:1.1.1.1 netbsd-1-5-PATCH003:1.1.1.1 pkgsrc-base:1.1.1.1 TNF:1.1.1; locks; strict; comment @# @; 1.5 date 2008.03.25.13.43.17; author wiz; state dead; branches; next 1.4; 1.4 date 2005.01.03.22.51.01; author agc; state Exp; branches; next 1.3; 1.3 date 2005.01.03.08.07.26; author agc; state Exp; branches; next 1.2; 1.2 date 2004.05.03.20.56.36; author mrauch; state Exp; branches; next 1.1; 1.1 date 2002.02.13.18.09.23; author mrauch; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2002.02.13.18.09.23; author mrauch; state Exp; branches; next ; desc @@ 1.5 log @Remove openoffice (1.x branch) packages. They have security problems and are not maintained. Removal was announced on pkgsrc-users on March 13. @ text @$NetBSD: patch-ad,v 1.4 2005/01/03 22:51:01 agc Exp $ Patch from Rui-Xiang Guo for building on NetBSD-current --- ../sal/osl/unx/system.c.orig 2003-07-17 01:21:47.000000000 +0800 +++ ../sal/osl/unx/system.c 2004-11-19 10:46:49.000000000 +0800 @@@@ -97,8 +97,11 @@@@ struct passwd *getpwnam_r(const char* name, struct passwd* s, char* buffer, int size ) #endif /* BUILD_OS_APPLEOSX */ #else /* MACOSX */ +#if (__NetBSD_Version__ < 299001000) struct passwd *getpwnam_r(const char* name, struct passwd* s, char* buffer, int size ) +#endif #endif /* MACOSX */ +#if (__NetBSD_Version__ < 299001000) { struct passwd* res; @@@@ -164,8 +167,9 @@@@ return(res); #endif /* MACOSX */ } +#endif -#if defined(NETBSD) || defined(MACOSX) +#if defined(NETBSD) && (__NetBSD_Version__ < 299001000) || defined(MACOSX) int getpwuid_r(uid_t uid, struct passwd *pwd, char *buffer, size_t buflen, struct passwd **result) { @@@@ -460,7 +464,7 @@@@ return res; } -#if defined(MACOSX) +#if defined(MACOSX) || defined(NETBSD) /* * This section works around calls that are missing or broken * in MacOS X 10.1.x and earlier. @@@@ -504,6 +508,10 @@@@ return nRet; } +#endif + +#if defined(MACOSX) + /* No reentrant asctime() either... */ /*******************************************************************************/ @ 1.4 log @The getpwnam_r prototype appeared in NetBSD in 2.99.10 or so @ text @d1 1 a1 1 $NetBSD: patch-ad,v 1.3 2005/01/03 08:07:26 agc Exp $ @ 1.3 log @Patches from Rui-Xiang Guo for building on NetBSD-current @ text @d1 1 a1 1 $NetBSD$ d11 1 a11 1 +#if (__NetBSD_Version__ < 200000000) d15 1 a15 1 +#if (__NetBSD_Version__ < 200000000) d26 1 a26 1 +#if defined(NETBSD) && (__NetBSD_Version__ < 200000000) || defined(MACOSX) @ 1.2 log @Update to version 1.1.1. New features include: * PDF, DocBook/XML, XHTML and Macromedia Flash (SWF) export * Accessibility * Support for Complex Text Layout (CTL) * User installation automated @ text @d3 28 a30 3 --- ../sal/osl/unx/system.c.orig 2004-04-17 19:24:56.000000000 +0200 +++ ../sal/osl/unx/system.c @@@@ -460,7 +460,7 @@@@ struct hostent *gethostbyname_r(const ch d39 1 a39 1 @@@@ -504,6 +504,10 @@@@ int readdir_r( DIR *dirp, struct dirent @ 1.1 log @Initial revision @ text @d3 22 a24 308 --- ../bridges/source/cpp_uno/gcc2_netbsd_intel/except.cxx.orig Sun Jan 6 11:41:58 2002 +++ ../bridges/source/cpp_uno/gcc2_netbsd_intel/except.cxx @@@@ -0,0 +1,305 @@@@ +#include +#include +#include +#if STLPORT_VERSION<321 +#include +#else +#include +#endif +#ifndef _RTL_ALLOC_H_ +#include +#endif +#ifndef _OSL_DIAGNOSE_H_ +#include +#endif + +#ifndef _BRIDGES_CPP_UNO_BRIDGE_HXX_ +#include +#endif +#ifndef _TYPELIB_TYPEDESCRIPTION_HXX_ +#include +#endif +#ifndef _COM_SUN_STAR_UNO_ANY_HXX_ +#include +#endif + +#include + +#include "gcc2_netbsd_intel.hxx" + +#ifdef DEBUG +#include +#endif + +using namespace std; +using namespace osl; +using namespace rtl; +using namespace com::sun::star::uno; + +namespace CPPU_CURRENT_NAMESPACE +{ + +//================================================================================================== +static OString toUNOname( const OString & rRTTIname ) +{ + OString aRet; + + sal_Char* pStr = rRTTIname.getStr(); + sal_Char* pOrg = pStr; + + // check for namespace + if( *pStr == '_' ) + pStr++; + if( *pStr == 'Q' ) + { + pStr++; + if( *pStr++ == '_' ) + { + while( *pStr++ != '_' ) + ; + } + } + + while( *pStr ) + { + int nCharsToCopy = 0; + while( *pStr >= '0' && *pStr <= '9' ) + nCharsToCopy = 10*nCharsToCopy + (int)(*pStr++ - '0'); + if( aRet.getLength() ) + aRet += "."; + aRet += rRTTIname.copy( pStr - pOrg, nCharsToCopy ); + pStr += nCharsToCopy; + } + + return aRet; +} +//================================================================================================== +static OString toRTTIname( const OString & rUNOname ) +{ + if( ! rUNOname.getLength() ) + return OString(); + + OStringBuffer aRet( 64 ); + + sal_Int32 nIndex = 0; + sal_Int32 nToken = 0; + do + { + OString aToken( rUNOname.getToken( 0, '.', nIndex ) ); + aRet.append( OString::valueOf( (sal_Int32)aToken.getLength() ) ); + aRet.append( aToken ); + ++nToken; + } + while (nIndex >= 0); + + OString ret( aRet.makeStringAndClear() ); + + if( nToken >= 2 ) + { + OStringBuffer buf( 64 ); + buf.append( 'Q' ); + if( nToken > 9 ) + aRet.append( '_' ); + buf.append( OString::valueOf( (sal_Int32)nToken ) ); + if( nToken > 9 ) + aRet.append( '_' ); + buf.append( ret ); + ret = buf.makeStringAndClear(); + } + + return ret; +} + + +//################################################################################################## +//#### RTTI simulation ############################################################################# +//################################################################################################## + +class RTTIHolder +{ + static std::map< OString, void* > aAllRTTI; +public: + static void* getRTTI( const OString& rTypename ); + static void* getRTTI_UnoName( const OString& rUnoTypename ) + { return getRTTI( toRTTIname( rUnoTypename ) ); } + + static void* insertRTTI( const OString& rTypename ); + static void* insertRTTI_UnoName( const OString& rTypename ) + { return insertRTTI( toRTTIname( rTypename ) ); } + + // rSuperTypename MUST exist !!! + static void* insertRTTI( const OString& rTypename, const OString& rSuperTypename ); + static void* insertRTTI_UnoNames( const OString& rTypename, const OString& rSuperTypename ) + { return insertRTTI( toRTTIname( rTypename ), toRTTIname( rSuperTypename ) ); } + + // for complex RTTI + static void* insertRTTI( const OString& rTypename, void* pRTTI ); + static void* insertRTTI_UnoName( const OString&rTypename, void* pRTTI ) + { return insertRTTI( toRTTIname( rTypename ), pRTTI ); } +}; + +std::map< OString, void* > RTTIHolder::aAllRTTI; + +void* RTTIHolder::getRTTI( const OString& rTypename ) +{ + std::map< OString, void* >::iterator element; + + element = aAllRTTI.find( rTypename ); + return element != aAllRTTI.end() ? (*element).second : NULL; +} + +void* RTTIHolder::insertRTTI( const OString& rTypename ) +{ +#ifdef DEBUG + fprintf( stderr, "generating base RTTI: %s\n", rTypename.getStr() ); +#endif + void* pRTTI = new __user_type_info( strdup( rTypename.getStr() ) ); + aAllRTTI[ rTypename ] = pRTTI; + return pRTTI; +} + +void* RTTIHolder::insertRTTI( const OString& rTypename, const OString& rSuperTypename ) +{ +#ifdef DEBUG + fprintf( stderr, "generating subclass RTTI: %s %s\n", rTypename.getStr(), rSuperTypename.getStr() ); +#endif + OSL_ENSURE( ! getRTTI( rTypename ), "insert RTTI called on already existing type" ); + void* pRTTI = new __si_type_info( strdup( rTypename.getStr() ), *(__user_type_info*)getRTTI( rSuperTypename ) ); + aAllRTTI[ rTypename ] = pRTTI; + return pRTTI; +} + +void* RTTIHolder::insertRTTI( const OString& rTypename, void* pRTTI ) +{ + aAllRTTI[ rTypename ] = pRTTI; + return pRTTI; +} + +//-------------------------------------------------------------------------------------------------- + +static void* generateRTTI( typelib_CompoundTypeDescription * pCompTypeDescr ) +{ + OString aCompTypeName( OUStringToOString( pCompTypeDescr->aBase.pTypeName, RTL_TEXTENCODING_ASCII_US ) ); + void* pRTTI = RTTIHolder::getRTTI_UnoName( aCompTypeName ); + if( pRTTI ) + return pRTTI; + + if( ! pCompTypeDescr->pBaseTypeDescription ) + // this is a base type + return RTTIHolder::insertRTTI_UnoName( aCompTypeName ); + if( ! pCompTypeDescr->pBaseTypeDescription->pBaseTypeDescription ) + { + OString aBasename( + OUStringToOString( pCompTypeDescr->pBaseTypeDescription->aBase.pTypeName, RTL_TEXTENCODING_ASCII_US ) + ); + if( ! RTTIHolder::getRTTI_UnoName( aBasename ) ) + RTTIHolder::insertRTTI_UnoName( aBasename ); + + // this type has only one supertype + return RTTIHolder::insertRTTI_UnoNames( aCompTypeName, aBasename ); + } + + // create __si_type_info + void* pSuperRTTI = generateRTTI( pCompTypeDescr->pBaseTypeDescription ); + OString aCompTypeRTTIname( toRTTIname( aCompTypeName ) ); +#ifdef DEBUG + fprintf( stderr, "generating RTTI: %s\n", aCompTypeRTTIname.getStr() ); +#endif + pRTTI = new __si_type_info( strdup( aCompTypeRTTIname.getStr() ), + *(__user_type_info*)pSuperRTTI ); +#if 0 + __class_type_info::base_info* pBaseInfo = new __class_type_info::base_info; + pBaseInfo->base = (__user_type_info*)pSuperRTTI; + pBaseInfo->offset = 0; + pBaseInfo->is_virtual = 0; + pBaseInfo->access1 = __class_type_info::PUBLIC; + + OString aCompTypeRTTIname( toRTTIname( aCompTypeName ) ); + pRTTI = new __class_type_info( + strdup( aCompTypeRTTIname.getStr() ), + pBaseInfo, + 1 + ); +#endif + return RTTIHolder::insertRTTI_UnoName( aCompTypeName, pRTTI ); +} + +//-------------------------------------------------------------------------------------------------- + +static Mutex s_aMutex; +static std::map< void*, typelib_TypeDescription* > aExceptionMap; + +static void deleteException( void* pExc, int nDummy ) +{ + MutexGuard aGuard( s_aMutex ); + std::map< void*, typelib_TypeDescription* >::iterator element = + aExceptionMap.find( pExc ); + OSL_ASSERT( element != aExceptionMap.end() ); + if( element != aExceptionMap.end() ) + { + typelib_TypeDescription* pType = (*element).second; + aExceptionMap.erase( pExc ); + uno_destructData( pExc, pType, cpp_release ); + typelib_typedescription_release( pType ); + } +} + +//__________________________________________________________________________________________________ + +//################################################################################################## +//#### exported #################################################################################### +//################################################################################################## + + +void gcc291_netbsd_intel_raiseException( uno_Any * pUnoExc, uno_Mapping * pUno2Cpp ) +{ + // construct cpp exception object + typelib_TypeDescription * pTypeDescr = 0; + typelib_typedescriptionreference_getDescription( &pTypeDescr, pUnoExc->pType ); + + void * pCppExc = __eh_alloc( pTypeDescr->nSize ); // will be released in generated dtor + uno_copyAndConvertData( pCppExc, pUnoExc->pData, pTypeDescr, pUno2Cpp ); + + // destruct uno exception + uno_any_destruct( pUnoExc, 0 ); + + // a must be + OSL_ENSURE( sizeof(sal_Int32) == sizeof(void *), "### pointer size differs from sal_Int32!" ); + + typelib_CompoundTypeDescription * pCompTypeDescr = (typelib_CompoundTypeDescription *)pTypeDescr; + void* pRTTI = generateRTTI( pCompTypeDescr ); + + { + MutexGuard aGuard( s_aMutex ); + aExceptionMap[ pCppExc ] = pTypeDescr; + } + + __cp_push_exception( pCppExc, pRTTI, deleteException ); + __throw(); +} + +void gcc291_netbsd_intel_fillUnoException( cp_eh_info* pInfo, uno_Any* pExc, uno_Mapping * pCpp2Uno ) +{ + OUString aName( OStringToOUString( + toUNOname( ((__user_type_info*)(pInfo->type))->name() ), RTL_TEXTENCODING_ASCII_US ) ); + + typelib_TypeDescription * pExcTypeDescr = 0; + typelib_typedescription_getByName( + &pExcTypeDescr, + aName.pData ); + OSL_ENSURE( pExcTypeDescr, "could not get type description for exception" ); + if (pExcTypeDescr) + { + // construct cpp exception any + Any aAny( pInfo->value, pExcTypeDescr ); // const_cast + typelib_typedescription_release( pExcTypeDescr ); + // construct uno exception any + typelib_TypeDescription* pAnyDescr = 0; + getCppuType( (const Any *)0 ).getDescription( &pAnyDescr ); + uno_copyAndConvertData( pExc, &aAny, pAnyDescr, pCpp2Uno ); + typelib_typedescription_release( pAnyDescr ); + } +} + +} + @ 1.1.1.1 log @OpenOffice.org is an Open Source, community-developed, multi-platform office productivity suite. It includes the key desktop applications, such as a word processor, spreadsheet, presentation manager, and drawing program, with a user interface and feature set similar to other office suites. @ text @@