Ignore:
Timestamp:
Nov 16, 2005, 8:36:46 PM (20 years ago)
Author:
dmik
Message:

Transferred Qt for OS/2 version 3.3.1-rc5 sources from the CVS

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/tools/qglobal.cpp

    r7 r8  
    4747#if defined(Q_CC_MSVC) && !defined(Q_CC_MSVC_NET) && !defined(Q_OS_TEMP)
    4848#include <crtdbg.h>
     49#endif
     50
     51#if defined(Q_OS_OS2)
     52#include "qt_os2.h"
    4953#endif
    5054
     
    359363    \endcode
    360364
    361     Under X11, the text is printed to stderr. Under Windows, the text
     365    Under X11 or OS/2, the text is printed to stderr. Under Windows, the text
    362366    is sent to the debugger.
    363367
     
    392396    \endcode
    393397
    394     Under X11, the text is printed to stderr. Under Windows, the text
     398    Under X11 or OS/2, the text is printed to stderr. Under Windows, the text
    395399    is sent to the debugger.
    396400
     
    426430    \endcode
    427431
    428     Under X11, the text is printed to stderr. Under Windows, the text
     432    Under X11 or OS/2, the text is printed to stderr. Under Windows, the text
    429433    is sent to the debugger.
    430434
     
    652656  error code will be used if possible. Use this method to handle
    653657  failures in platform specific API calls.
     658 
     659  Under OS/2, the value -1 for \a code should only be used after Presentation
     660  Manager calls.
    654661
    655662  This function does nothing when Qt is built with \c QT_NO_DEBUG
     
    689696    } );
    690697    LocalFree( (HLOCAL)string );
     698#elif defined(Q_OS_OS2)
     699    if ( code != -1 ) {
     700        CHAR buf [256] = {0};
     701        ULONG len = 0;
     702        APIRET rc = DosGetMessage( NULL, 0, buf, sizeof(buf) - 1, code, "OSO001.MSG", &len );
     703        if ( !rc ) {
     704            buf[len] = '\0';
     705            qWarning( "%s\n\tError %s", msg, buf );
     706        } else {
     707            if ( rc == ERROR_MR_MSG_TOO_LONG )
     708                qWarning(
     709                    "%s\n\tError code SYS%04d, "
     710                    "type help %d in the command prompt to get more information",
     711                    msg, code, code );
     712            else
     713                qWarning( "%s\n\tError code %d (system error)", msg, code );
     714        }
     715    } else {
     716        code = (int) WinGetLastError( 0 );
     717        if ( code )
     718            qWarning( "%s\n\tError code %08X (PM error)", msg, code );
     719        else
     720            qWarning( msg );
     721    }
    691722#else
    692723    if ( code != -1 )
     
    858889
    859890    The default message handler prints the message to the standard
    860     output under X11 or to the debugger under Windows. If it is a
     891    output under X11 and OS/2 or to the debugger under Windows. If it is a
    861892    fatal message, the application aborts immediately.
    862893
Note: See TracChangeset for help on using the changeset viewer.