diff --git a/harbour/ChangeLog b/harbour/ChangeLog index a3d10a9d78..d921b4866e 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,12 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-11-15 06:34 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * contrib/hbqt/hbqt_destruct.cpp + ! Fixed the way windows.h is included. + ! Fixed to exclude Windows stuff on non-Windows systems (in debug mode). + ; PLEASE KEEP IT THIS WAY. + 2009-11-15 05:30 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbsms/Makefile ! Fixed dependency on tpathy headers. diff --git a/harbour/contrib/hbqt/hbqt_destruct.cpp b/harbour/contrib/hbqt/hbqt_destruct.cpp index cc97fa6efd..bd0a08af73 100644 --- a/harbour/contrib/hbqt/hbqt_destruct.cpp +++ b/harbour/contrib/hbqt/hbqt_destruct.cpp @@ -51,6 +51,10 @@ */ /*----------------------------------------------------------------------*/ +#if defined(__debug__) + #define HB_OS_WIN_USED +#endif + #include "hbapi.h" #include "hbvm.h" #include "hbapiitm.h" @@ -100,11 +104,13 @@ void * hbqt_gcpointer( int iParam ) #if defined(__debug__) -#include -#include +#if defined( HB_OS_WIN ) + #include +#endif void just_debug( const char * sTraceMsg, ... ) { +#if defined( HB_OS_WIN ) if( sTraceMsg ) { char buffer[ 1024 ]; @@ -116,27 +122,28 @@ void just_debug( const char * sTraceMsg, ... ) OutputDebugString( buffer ); } +#endif } int hb_getMemUsed( void ) { + int size = 0; +#if defined( HB_OS_WIN ) HANDLE hProcess; PROCESS_MEMORY_COUNTERS pmc; - int size = 0; - hProcess = OpenProcess( PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, - FALSE, GetCurrentProcessId() ); - if ( NULL == hProcess ) - return 0; + hProcess = OpenProcess( PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, GetCurrentProcessId() ); + if( hProcess == NULL ) + return 0; - if ( GetProcessMemoryInfo( hProcess, &pmc, sizeof(pmc)) ) - { - size = ( int ) pmc.WorkingSetSize / 1024 ; - } + if( GetProcessMemoryInfo( hProcess, &pmc, sizeof( pmc ) ) ) + size = ( int ) pmc.WorkingSetSize / 1024; - CloseHandle( hProcess ); - return size; + CloseHandle( hProcess ); +#endif + return size; } + #endif HB_FUNC( HB_GETMEMUSED )