diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2007-11-02 12:01:11 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2007-11-02 12:01:11 +0000 |
commit | ebd2a79309fec375f35e342e65181a6ba9d7c35b (patch) | |
tree | 97073ca71bc1f18b44d02ae13e78868be522260f /tools | |
parent | INTEGRATION: CWS os2port02 (1.7.8); FILE MERGED (diff) | |
download | core-ebd2a79309fec375f35e342e65181a6ba9d7c35b.tar.gz core-ebd2a79309fec375f35e342e65181a6ba9d7c35b.zip |
INTEGRATION: CWS os2port02 (1.14.8); FILE MERGED
2007/09/30 12:08:50 ydario 1.14.8.1: Issue number: i82034
Submitted by: ydario
Reviewed by: ydario
Commit of changes for OS/2 CWS source code integration.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/source/datetime/ttime.cxx | 47 | ||||
-rw-r--r-- | tools/source/debug/debug.cxx | 34 |
2 files changed, 74 insertions, 7 deletions
diff --git a/tools/source/datetime/ttime.cxx b/tools/source/datetime/ttime.cxx index baf8f7681498..e7abdbeb72f8 100644 --- a/tools/source/datetime/ttime.cxx +++ b/tools/source/datetime/ttime.cxx @@ -4,9 +4,9 @@ * * $RCSfile: ttime.cxx,v $ * - * $Revision: 1.14 $ + * $Revision: 1.15 $ * - * last change: $Author: kz $ $Date: 2007-09-06 14:14:31 $ + * last change: $Author: hr $ $Date: 2007-11-02 13:00:55 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -38,7 +38,11 @@ #define _TOOLS_TIME_CXX -#if defined WNT +#if defined( OS2 ) +#define INCL_DOSMISC +#define INCL_DOSDATETIME +#include <svpm.h> +#elif defined( WNT ) #ifdef _MSC_VER #pragma warning (push,1) #endif @@ -103,7 +107,16 @@ static Time Sec100ToTime( sal_Int32 nSec100 ) Time::Time() { -#if defined WNT +#if defined( OS2 ) + DATETIME aDateTime; + DosGetDateTime( &aDateTime ); + + // Zeit zusammenbauen + nTime = (((sal_Int32)aDateTime.hours)*1000000) + + (((sal_Int32)aDateTime.minutes)*10000) + + (((sal_Int32)aDateTime.seconds)*100) + + ((sal_Int32)aDateTime.hundredths); +#elif defined( WNT ) SYSTEMTIME aDateTime; GetLocalTime( &aDateTime ); @@ -313,7 +326,23 @@ BOOL Time::IsEqualIgnore100Sec( const Time& rTime ) const Time Time::GetUTCOffset() { -#if defined WNT +#if defined( OS2 ) +#undef timezone + DATETIME aDateTime; + DosGetDateTime( &aDateTime ); + + // Zeit zusammenbauen + if ( aDateTime.timezone != -1 ) + { + short nTempTime = (short)Abs( aDateTime.timezone ); + Time aTime( 0, (USHORT)nTempTime ); + if ( aDateTime.timezone > 0 ) + aTime = -aTime; + return aTime; + } + else + return Time( 0 ); +#elif defined( WNT ) TIME_ZONE_INFORMATION aTimeZone; aTimeZone.Bias = 0; DWORD nTimeZoneRet = GetTimeZoneInformation( &aTimeZone ); @@ -375,6 +404,10 @@ ULONG Time::GetSystemTicks() { #if defined WNT return (ULONG)GetTickCount(); +#elif defined( OS2 ) + ULONG nClock; + DosQuerySysInfo( QSV_MS_COUNT, QSV_MS_COUNT, &nClock, sizeof( nClock ) ); + return (ULONG)nClock; #else timeval tv; gettimeofday (&tv, 0); @@ -394,6 +427,10 @@ ULONG Time::GetProcessTicks() { #if defined WNT return (ULONG)GetTickCount(); +#elif defined( OS2 ) + ULONG nClock; + DosQuerySysInfo( QSV_MS_COUNT, QSV_MS_COUNT, &nClock, sizeof( nClock ) ); + return (ULONG)nClock; #else static ULONG nImplTicksPerSecond = 0; static double dImplTicksPerSecond; diff --git a/tools/source/debug/debug.cxx b/tools/source/debug/debug.cxx index bb18729007b0..06003c1bd0e7 100644 --- a/tools/source/debug/debug.cxx +++ b/tools/source/debug/debug.cxx @@ -4,9 +4,9 @@ * * $RCSfile: debug.cxx,v $ * - * $Revision: 1.14 $ + * $Revision: 1.15 $ * - * last change: $Author: kz $ $Date: 2007-09-06 14:14:46 $ + * last change: $Author: hr $ $Date: 2007-11-02 13:01:11 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -50,6 +50,14 @@ #include <string.h> #include <stdio.h> +#ifdef OS2 +#define INCL_DOSSEMAPHORES +#define INCL_DOSMISC +#define INCL_WINDIALOGS +#define INCL_WINSHELLDATA +#include <svpm.h> +#endif + #if defined ( WNT ) #ifdef _MSC_VER #pragma warning (push,1) @@ -209,6 +217,8 @@ static int bDbgImplInMain = FALSE; #if defined( WNT ) static CRITICAL_SECTION aImplCritDbgSection; +#elif defined( OS2 ) +static HMTX hImplCritDbgSection = 0; #endif static BOOL bImplCritDbgSectionInit = FALSE; @@ -218,6 +228,8 @@ void ImplDbgInitLock() { #if defined( WNT ) InitializeCriticalSection( &aImplCritDbgSection ); +#elif defined( OS2 ) + DosCreateMutexSem( NULL, &hImplCritDbgSection, 0, FALSE ); #endif bImplCritDbgSectionInit = TRUE; } @@ -228,6 +240,8 @@ void ImplDbgDeInitLock() { #if defined( WNT ) DeleteCriticalSection( &aImplCritDbgSection ); +#elif defined( OS2 ) + DosCloseMutexSem( hImplCritDbgSection ); #endif bImplCritDbgSectionInit = FALSE; } @@ -241,6 +255,8 @@ void ImplDbgLock() #if defined( WNT ) EnterCriticalSection( &aImplCritDbgSection ); +#elif defined( OS2 ) + DosRequestMutexSem( hImplCritDbgSection, SEM_INDEFINITE_WAIT ); #endif } @@ -253,6 +269,8 @@ void ImplDbgUnlock() #if defined( WNT ) LeaveCriticalSection( &aImplCritDbgSection ); +#elif defined( OS2 ) + DosReleaseMutexSem( hImplCritDbgSection ); #endif } @@ -305,6 +323,10 @@ static ULONG ImplGetPerfTime() { #if defined( WNT ) return (ULONG)GetTickCount(); +#elif defined( OS2 ) + ULONG nClock; + DosQuerySysInfo( QSV_MS_COUNT, QSV_MS_COUNT, &nClock, sizeof( nClock ) ); + return (ULONG)nClock; #else static ULONG nImplTicksPerSecond = 0; static double dImplTicksPerSecond; @@ -662,6 +684,9 @@ static void DbgGetDbgFileName( sal_Char* pStr, sal_Int32 nMaxLen ) strncpy( pStr, pName, nMaxLen ); else GetProfileStringA( "sv", "dbgsv", "dbgsv.ini", pStr, nMaxLen ); +#elif defined( OS2 ) + PrfQueryProfileString( HINI_PROFILE, (PSZ)"SV", (PSZ)"DBGSV", + "dbgsv.ini", (PSZ)pStr, nMaxLen ); #else strncpy( pStr, "dbgsv.ini", nMaxLen ); #endif @@ -683,6 +708,9 @@ static void DbgGetLogFileName( sal_Char* pStr ) strcpy( pStr, pName ); else GetProfileStringA( "sv", "dbgsvlog", "dbgsv.log", pStr, 200 ); +#elif defined( OS2 ) + PrfQueryProfileString( HINI_PROFILE, (PSZ)"SV", (PSZ)"DBGSVLOG", + "dbgsv.log", (PSZ)pStr, 200 ); #else strcpy( pStr, "dbgsv.log" ); #endif @@ -694,6 +722,8 @@ static void DbgDebugBeep() { #if defined( WNT ) MessageBeep( MB_ICONHAND ); +#elif defined( OS2 ) + WinAlarm( HWND_DESKTOP, WA_ERROR ); #endif } |