wxOS2 with Open Watcom: correct PCH usage, missing headers, warning fixes, source cleaning and other Watcom adjustements.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34903 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
0872eaf957
commit
7e1e696511
@ -14,6 +14,7 @@
|
||||
|
||||
#ifdef __WATCOMC__
|
||||
|
||||
#include <types.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/select.h>
|
||||
|
||||
@ -74,7 +75,7 @@ public:
|
||||
|
||||
virtual bool OnInitGui(void);
|
||||
|
||||
virtual bool Yield(bool onlyIfNeeded = FALSE);
|
||||
virtual bool Yield(bool onlyIfNeeded = false);
|
||||
virtual void WakeUpIdle(void);
|
||||
|
||||
virtual void SetPrintMode(int mode) { m_nPrintMode = mode; }
|
||||
@ -120,4 +121,3 @@ protected:
|
||||
};
|
||||
#endif
|
||||
// _WX_APP_H_
|
||||
|
||||
|
@ -106,10 +106,7 @@ public:
|
||||
);
|
||||
|
||||
// If depth is omitted, will create a bitmap compatible with the display
|
||||
wxBitmap( int nWidth
|
||||
,int nHeight
|
||||
,int nDepth = -1
|
||||
);
|
||||
wxBitmap( int nWidth, int nHeight, int nDepth = -1 );
|
||||
|
||||
wxBitmap( const wxImage& image, int depth = -1 )
|
||||
{ (void)CreateFromImage(image, depth); }
|
||||
@ -339,14 +336,14 @@ public:
|
||||
,int lType
|
||||
);
|
||||
private:
|
||||
inline virtual bool Load( wxGDIImage* pImage
|
||||
,const wxString& rName
|
||||
,HPS hPs
|
||||
,long lFlags
|
||||
,int nDesiredWidth
|
||||
,int nDesiredHeight
|
||||
inline virtual bool Load( wxGDIImage* WXUNUSED(pImage)
|
||||
,const wxString& WXUNUSED(rName)
|
||||
,HPS WXUNUSED(hPs)
|
||||
,long WXUNUSED(lFlags)
|
||||
,int WXUNUSED(nDesiredWidth)
|
||||
,int WXUNUSED(nDesiredHeight)
|
||||
)
|
||||
{ return FALSE; }
|
||||
{ return false; }
|
||||
DECLARE_DYNAMIC_CLASS(wxBitmapHandler)
|
||||
}; // end of CLASS wxBitmapHandler
|
||||
|
||||
|
@ -17,12 +17,12 @@
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_OWNER_DRAWN
|
||||
class WXDLLEXPORT wxOwnerDrawn;
|
||||
class WXDLLEXPORT wxOwnerDrawn;
|
||||
|
||||
// define the array of list box items
|
||||
#include <wx/dynarray.h>
|
||||
// define the array of list box items
|
||||
#include <wx/dynarray.h>
|
||||
|
||||
WX_DEFINE_EXPORTED_ARRAY(wxOwnerDrawn *, wxListBoxItemsArray);
|
||||
WX_DEFINE_EXPORTED_ARRAY_PTR(wxOwnerDrawn *, wxListBoxItemsArray);
|
||||
#endif // wxUSE_OWNER_DRAWN
|
||||
|
||||
// forward decl for GetSelections()
|
||||
|
@ -17,7 +17,7 @@
|
||||
#include "wx/list.h" // for "template" list classes
|
||||
#include "wx/dynarray.h"
|
||||
|
||||
WX_DEFINE_EXPORTED_ARRAY(wxAcceleratorEntry *, wxAcceleratorArray);
|
||||
WX_DEFINE_EXPORTED_ARRAY_PTR(wxAcceleratorEntry *, wxAcceleratorArray);
|
||||
#endif // wxUSE_ACCEL
|
||||
|
||||
class WXDLLEXPORT wxFrame;
|
||||
@ -139,9 +139,9 @@ private:
|
||||
void EndRadioGroup(void);
|
||||
|
||||
//
|
||||
// If TRUE, insert a breal before appending the next item
|
||||
// If true, insert a breal before appending the next item
|
||||
//
|
||||
bool m_bDoBreak;
|
||||
bool m_bDoBreak;
|
||||
|
||||
//
|
||||
// The menu handle of this menu
|
||||
|
@ -63,10 +63,10 @@ public:
|
||||
bool Unassociate();
|
||||
|
||||
// set an arbitrary command, ask confirmation if it already exists and
|
||||
// overwriteprompt is TRUE
|
||||
// overwriteprompt is true
|
||||
bool SetCommand(const wxString& cmd,
|
||||
const wxString& verb,
|
||||
bool overwriteprompt = TRUE);
|
||||
bool overwriteprompt = true);
|
||||
|
||||
bool SetDefaultIcon(const wxString& cmd = wxEmptyString, int index = 0);
|
||||
|
||||
@ -101,10 +101,10 @@ public:
|
||||
size_t EnumAllFileTypes(wxArrayString& mimetypes);
|
||||
|
||||
// these are NOPs under OS/2
|
||||
bool ReadMailcap(const wxString& filename, bool fallback = TRUE)
|
||||
{ return TRUE; }
|
||||
bool ReadMimeTypes(const wxString& filename)
|
||||
{ return TRUE; }
|
||||
bool ReadMailcap(const wxString& WXUNUSED(filename), bool WXUNUSED(fallback) = true)
|
||||
{ return true; }
|
||||
bool ReadMimeTypes(const wxString& WXUNUSED(filename))
|
||||
{ return true; }
|
||||
|
||||
void AddFallback(const wxFileTypeInfo& ft) { m_fallbacks.Add(ft); }
|
||||
|
||||
@ -116,4 +116,3 @@ private:
|
||||
|
||||
#endif
|
||||
//_MIMETYPE_IMPL_H
|
||||
|
||||
|
@ -19,18 +19,22 @@
|
||||
#define INCL_GPI
|
||||
#define INCL_WINSYS
|
||||
#define INCL_SHLERRORS
|
||||
#define INCL_DOS
|
||||
#include <os2.h>
|
||||
#if defined (__EMX__) && !defined(USE_OS2_TOOLKIT_HEADERS) && !defined(HAVE_SPBCDATA)
|
||||
typedef struct _SPBCDATA {
|
||||
ULONG cbSize; /* Size of control block. */
|
||||
ULONG ulTextLimit; /* Entryfield text limit. */
|
||||
LONG lLowerLimit; /* Spin lower limit (numeric only). */
|
||||
LONG lUpperLimit; /* Spin upper limit (numeric only). */
|
||||
ULONG idMasterSpb; /* ID of the servant's master spinbutton. */
|
||||
PVOID pHWXCtlData; /* Handwriting control data structure flag. */
|
||||
} SPBCDATA;
|
||||
|
||||
typedef SPBCDATA *PSPBCDATA;
|
||||
#if defined (__EMX__) && !defined(USE_OS2_TOOLKIT_HEADERS) && !defined(HAVE_SPBCDATA)
|
||||
|
||||
typedef struct _SPBCDATA {
|
||||
ULONG cbSize; /* Size of control block. */
|
||||
ULONG ulTextLimit; /* Entryfield text limit. */
|
||||
LONG lLowerLimit; /* Spin lower limit (numeric only). */
|
||||
LONG lUpperLimit; /* Spin upper limit (numeric only). */
|
||||
ULONG idMasterSpb; /* ID of the servant's master spinbutton. */
|
||||
PVOID pHWXCtlData; /* Handwriting control data structure flag. */
|
||||
} SPBCDATA;
|
||||
|
||||
typedef SPBCDATA *PSPBCDATA;
|
||||
|
||||
#endif
|
||||
|
||||
#include "wx/fontenc.h"
|
||||
@ -146,11 +150,11 @@ typedef MRESULT (APIENTRY * WndProcCast) (HWND, ULONG, MPARAM, MPARAM);
|
||||
#define STATIC_FLAGS (SS_TEXT|DT_LEFT|SS_LEFT|WS_VISIBLE)
|
||||
#define CHECK_CLASS _T("BUTTON")
|
||||
#define CHECK_FLAGS (BS_AUTOCHECKBOX|WS_TABSTOP)
|
||||
#define CHECK_IS_FAFA FALSE
|
||||
#define CHECK_IS_FAFA FALSE
|
||||
#define RADIO_CLASS _T("BUTTON" )
|
||||
#define RADIO_FLAGS (BS_AUTORADIOBUTTON|WS_VISIBLE)
|
||||
#define RADIO_SIZE 20
|
||||
#define RADIO_IS_FAFA FALSE
|
||||
#define RADIO_IS_FAFA FALSE
|
||||
#define PURE_WINDOWS
|
||||
/* PM has no group box button style
|
||||
#define GROUP_CLASS "BUTTON"
|
||||
@ -193,6 +197,34 @@ extern LONG APIENTRY wxSubclassedGenericControlProc(WXHWND hWnd, WXDWORD message
|
||||
#define ENDSESSION_LOGOFF 0x80000000
|
||||
#endif
|
||||
|
||||
#ifndef PMERR_INVALID_PARM
|
||||
#define PMERR_INVALID_PARM 0x1303
|
||||
#endif
|
||||
|
||||
#ifndef PMERR_INVALID_PARAMETERS
|
||||
#define PMERR_INVALID_PARAMETERS 0x1208
|
||||
#endif
|
||||
|
||||
#ifndef BOOKERR_INVALID_PARAMETERS
|
||||
#define BOOKERR_INVALID_PARAMETERS -1
|
||||
#endif
|
||||
|
||||
#ifndef DLGC_ENTRYFIELD
|
||||
#define DLGC_ENTRYFIELD 0x0001
|
||||
#endif
|
||||
|
||||
#ifndef DLGC_BUTTON
|
||||
#define DLGC_BUTTON 0x0002
|
||||
#endif
|
||||
|
||||
#ifndef DLGC_MLE
|
||||
#define DLGC_MLE 0x0400
|
||||
#endif
|
||||
|
||||
#ifndef DP_NORMAL
|
||||
#define DP_NORMAL 0
|
||||
#endif
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// debug messages -- OS/2 has no native debug output system
|
||||
// ---------------------------------------------------------------------------
|
||||
|
@ -15,7 +15,7 @@
|
||||
#include "wx/spinbutt.h" // the base class
|
||||
#include "wx/dynarray.h"
|
||||
class WXDLLEXPORT wxSpinCtrl;
|
||||
WX_DEFINE_EXPORTED_ARRAY(wxSpinCtrl *, wxArraySpins);
|
||||
WX_DEFINE_EXPORTED_ARRAY_PTR(wxSpinCtrl *, wxArraySpins);
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Under Win32 and OS2 PM, wxSpinCtrl is a wxSpinButton with a buddy
|
||||
@ -28,7 +28,7 @@ class WXDLLEXPORT wxSpinCtrl : public wxSpinButton
|
||||
public:
|
||||
wxSpinCtrl() { }
|
||||
wxSpinCtrl( wxWindow* pParent
|
||||
,wxWindowID vId = -1
|
||||
,wxWindowID vId = wxID_ANY
|
||||
,const wxString& rsValue = wxEmptyString
|
||||
,const wxPoint& rPos = wxDefaultPosition
|
||||
,const wxSize& rSize = wxDefaultSize
|
||||
@ -44,7 +44,7 @@ public:
|
||||
virtual ~wxSpinCtrl();
|
||||
|
||||
bool Create(wxWindow* pParent
|
||||
,wxWindowID vId = -1
|
||||
,wxWindowID vId = wxID_ANY
|
||||
,const wxString& rsValue = wxEmptyString
|
||||
,const wxPoint& rPos = wxDefaultPosition
|
||||
,const wxSize& rSize = wxDefaultSize
|
||||
@ -65,23 +65,23 @@ public:
|
||||
// implementation only from now on
|
||||
// -------------------------------
|
||||
//
|
||||
virtual bool Enable(bool bEnable = TRUE);
|
||||
virtual bool Enable(bool bEnable = true);
|
||||
|
||||
virtual int GetValue(void) const;
|
||||
virtual int GetValue(void) const;
|
||||
|
||||
virtual bool SetFont(const wxFont &rFont);
|
||||
virtual void SetFocus(void);
|
||||
|
||||
virtual bool SetFont(const wxFont &rFont);
|
||||
virtual void SetFocus(void);
|
||||
inline virtual void SetValue(int nVal) { wxSpinButton::SetValue(nVal); }
|
||||
void SetSelection( long lFrom
|
||||
,long lTo
|
||||
);
|
||||
|
||||
virtual bool Show(bool bShow = TRUE);
|
||||
void SetSelection(long lFrom, long lTo);
|
||||
|
||||
virtual bool Show(bool bShow = true);
|
||||
|
||||
//
|
||||
// wxSpinButton doesn't accept focus, but we do
|
||||
//
|
||||
inline virtual bool AcceptsFocus(void) const { return FALSE; }
|
||||
inline virtual bool AcceptsFocus(void) const { return false; }
|
||||
|
||||
//
|
||||
// Return the spinctrl object whose buddy is the given window or NULL
|
||||
@ -126,5 +126,3 @@ private:
|
||||
}; // end of CLASS wxSpinCtrl
|
||||
|
||||
#endif // _WX_MSW_SPINCTRL_H_
|
||||
|
||||
|
||||
|
@ -27,9 +27,9 @@ public:
|
||||
|
||||
// controlling tooltip behaviour: globally change tooltip parameters
|
||||
// enable or disable the tooltips globally
|
||||
static void Enable(bool flag) {}
|
||||
static void Enable(bool WXUNUSED(flag)) {}
|
||||
// set the delay after which the tooltip appears
|
||||
static void SetDelay(long milliseconds) {}
|
||||
static void SetDelay(long WXUNUSED(milliseconds)) {}
|
||||
|
||||
//
|
||||
// Implementation
|
||||
@ -44,4 +44,3 @@ private:
|
||||
wxString m_sText; // tooltip text
|
||||
wxWindow* m_pWindow; // window we're associated with
|
||||
}; // end of CLASS wxToolTip
|
||||
|
||||
|
@ -16,6 +16,12 @@
|
||||
* PLEASE don't put C++ comments here - this is a C source file.
|
||||
*/
|
||||
|
||||
#if defined(__WATCOMC__)
|
||||
#include "wx/wxprec.h"
|
||||
#include <errno.h>
|
||||
#include <nerrno.h>
|
||||
#endif
|
||||
|
||||
#ifndef __GSOCKET_STANDALONE__
|
||||
#include "wx/setup.h"
|
||||
#endif
|
||||
@ -118,7 +124,7 @@ int _System soclose(int);
|
||||
# define SOCKLEN_T socklen_t
|
||||
# endif
|
||||
# elif defined(__WXMAC__)
|
||||
# define SOCKLEN_T socklen_t
|
||||
# define SOCKLEN_T socklen_t
|
||||
# else
|
||||
# define SOCKLEN_T int
|
||||
# endif
|
||||
@ -150,15 +156,24 @@ int _System soclose(int);
|
||||
#define INADDR_NONE INADDR_BROADCAST
|
||||
#endif
|
||||
|
||||
#define MASK_SIGNAL() \
|
||||
{ \
|
||||
void (*old_handler)(int); \
|
||||
\
|
||||
old_handler = signal(SIGPIPE, SIG_IGN);
|
||||
#if defined(__VISAGECPP__) || defined(__WATCOMC__)
|
||||
|
||||
#define UNMASK_SIGNAL() \
|
||||
signal(SIGPIPE, old_handler); \
|
||||
}
|
||||
#define MASK_SIGNAL() {
|
||||
#define UNMASK_SIGNAL() }
|
||||
|
||||
#else
|
||||
|
||||
#define MASK_SIGNAL() \
|
||||
{ \
|
||||
void (*old_handler)(int); \
|
||||
\
|
||||
old_handler = signal(SIGPIPE, SIG_IGN);
|
||||
|
||||
#define UNMASK_SIGNAL() \
|
||||
signal(SIGPIPE, old_handler); \
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* If a SIGPIPE is issued by a socket call on a remotely closed socket,
|
||||
the program will "crash" unless it explicitly handles the SIGPIPE.
|
||||
@ -906,7 +921,7 @@ int GSocket::Write(const char *buffer, int size)
|
||||
|
||||
if (ret == -1)
|
||||
{
|
||||
if ((errno == EWOULDBLOCK) || (errno == EAGAIN))
|
||||
if ((errno == EWOULDBLOCK) || (errno == EAGAIN))
|
||||
{
|
||||
m_error = GSOCK_WOULDBLOCK;
|
||||
GSocket_Debug(( "GSocket_Write error WOULDBLOCK\n" ));
|
||||
@ -1303,7 +1318,7 @@ GSocketError GSocket::Output_Timeout()
|
||||
int GSocket::Recv_Stream(char *buffer, int size)
|
||||
{
|
||||
int ret;
|
||||
do
|
||||
do
|
||||
{
|
||||
ret = recv(m_fd, buffer, size, GSOCKET_MSG_NOSIGNAL);
|
||||
} while (ret == -1 && errno == EINTR); /* Loop until not interrupted */
|
||||
@ -1319,7 +1334,7 @@ int GSocket::Recv_Dgram(char *buffer, int size)
|
||||
|
||||
fromlen = sizeof(from);
|
||||
|
||||
do
|
||||
do
|
||||
{
|
||||
ret = recvfrom(m_fd, buffer, size, 0, &from, (SOCKLEN_T *) &fromlen);
|
||||
} while (ret == -1 && errno == EINTR); /* Loop until not interrupted */
|
||||
@ -1353,16 +1368,14 @@ int GSocket::Send_Stream(const char *buffer, int size)
|
||||
{
|
||||
int ret;
|
||||
|
||||
#ifndef __VISAGECPP__
|
||||
MASK_SIGNAL();
|
||||
#endif
|
||||
do
|
||||
MASK_SIGNAL();
|
||||
|
||||
do
|
||||
{
|
||||
ret = send(m_fd, (char *)buffer, size, GSOCKET_MSG_NOSIGNAL);
|
||||
} while (ret == -1 && errno == EINTR); /* Loop until not interrupted */
|
||||
#ifndef __VISAGECPP__
|
||||
|
||||
UNMASK_SIGNAL();
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
@ -1386,16 +1399,14 @@ int GSocket::Send_Dgram(const char *buffer, int size)
|
||||
return -1;
|
||||
}
|
||||
|
||||
#ifndef __VISAGECPP__
|
||||
MASK_SIGNAL();
|
||||
#endif
|
||||
do
|
||||
|
||||
do
|
||||
{
|
||||
ret = sendto(m_fd, (char *)buffer, size, 0, addr, len);
|
||||
} while (ret == -1 && errno == EINTR); /* Loop until not interrupted */
|
||||
#ifndef __VISAGECPP__
|
||||
|
||||
UNMASK_SIGNAL();
|
||||
#endif
|
||||
|
||||
/* Frees memory allocated from _GAddress_translate_to */
|
||||
free(addr);
|
||||
@ -1440,15 +1451,15 @@ void GSocket::Detected_Read()
|
||||
else
|
||||
{
|
||||
/* Do not throw a lost event in cases where the socket isn't really lost */
|
||||
if ((errno == EWOULDBLOCK) || (errno == EAGAIN) || (errno == EINTR))
|
||||
if ((errno == EWOULDBLOCK) || (errno == EAGAIN) || (errno == EINTR))
|
||||
{
|
||||
CALL_CALLBACK(this, GSOCK_INPUT);
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
CALL_CALLBACK(this, GSOCK_LOST);
|
||||
Shutdown();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1916,4 +1927,3 @@ GSocketError GAddress_UNIX_GetPath(GAddress *address, char *path, size_t sbuf)
|
||||
}
|
||||
#endif /* !defined(__VISAGECPP__) */
|
||||
#endif /* wxUSE_SOCKETS || defined(__GSOCKET_STANDALONE__) */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user