Getting various compilers to work with wxWin again

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2734 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
1999-06-09 18:16:38 +00:00
parent 4286a5b595
commit 25889d3c43
28 changed files with 180 additions and 51 deletions

View File

@@ -158,7 +158,7 @@ class WXDLLEXPORT wxPrintData: public wxObject
void operator=(const wxPrintSetupData& setupData);
#endif
#ifdef __WXMSW__
#if defined(__WXMSW__)
// Convert to/from the DEVMODE structure
void ConvertToNative();
void ConvertFromNative();

View File

@@ -72,6 +72,7 @@ enum
// Windows using PostScript print/preview)
// ----------------------------------------------------------------------------
#if wxUSE_POSTSCRIPT
class WXDLLEXPORT wxGenericPrintDialog : public wxDialog
{
DECLARE_DYNAMIC_CLASS(wxGenericPrintDialog)
@@ -150,6 +151,8 @@ public:
wxPrintData& GetPrintData() { return m_printData; }
#endif // wxUSE_POSTSCRIPT
};
#endif
// wxUSE_POSTSCRIPT
class WXDLLEXPORT wxGenericPageSetupDialog : public wxDialog
{

View File

@@ -59,7 +59,7 @@ public:
void Resume() { m_state = Continue; }
/// Callback for optional abort button
void OnCancel(wxEvent& WXUNUSED(event)) { m_state = Canceled; }
void OnCancel(wxCommandEvent& WXUNUSED(event)) { m_state = Canceled; }
/// callback to disable "hard" window closing
void OnClose(wxCloseEvent& event);

View File

@@ -33,7 +33,7 @@ public:
// ctor & dtor
wxDataObject();
~wxDataObject();
virtual ~wxDataObject();
// pure virtuals to override
// get the best suited format for our data
@@ -114,9 +114,9 @@ public:
virtual bool IsSupportedFormat(wxDataFormat format) const
{ return format == wxDF_BITMAP; }
virtual size_t GetDataSize() const
{ wxASSERT(false); return 0; } // BEMIMP
{ wxASSERT(FALSE); return 0; } // BEMIMP
virtual void GetDataHere(void *pBuf) const
{ wxASSERT(false); } // BEMIMP
{ wxASSERT(FALSE); } // BEMIMP
private:
wxBitmap m_bitmap;

View File

@@ -9,8 +9,12 @@
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
/* THIS SHOULD NOT BE USED since you might include it once e.g. in window.h,
* then again _AFTER_ you've included windows.h, in which case it won't work
* a 2nd time -- JACS
#ifndef _WX_WINUNDEF_H_
#define _WX_WINUNDEF_H_
*/
// windows.h #defines the following identifiers which are also used in wxWin
@@ -117,7 +121,7 @@
#ifdef StartDoc
#undef StartDoc
#ifdef __MINGW32__
#ifdef __GNUWIN32__
#define DOCINFOW DOCINFO
#define DOCINFOA DOCINFO
#endif
@@ -196,4 +200,5 @@
// #undef GetNextChild
//endif
#endif // _WX_WINUNDEF_H_
// #endif // _WX_WINUNDEF_H_

View File

@@ -43,6 +43,28 @@ private:
typedef void (wxEvtHandler::*wxNotebookEventFunction)(wxNotebookEvent&);
// Truncation in 16-bit BC++ means we need to define these differently
#if defined(__BORLANDC__) && defined(__WIN16__)
#define EVT_NOTEBOOK_PAGE_CHANGED(id, fn) \
{ \
wxEVT_COMMAND_NB_PAGE_CHANGED, \
id, \
-1, \
(wxObjectEventFunction)(wxEventFunction)(wxNotebookEventFunction) &fn, \
NULL \
},
#define EVT_NOTEBOOK_PAGE_CHANGING(id, fn) \
{ \
wxEVT_COMMAND_NB_PAGE_CHANGING, \
id, \
-1, \
(wxObjectEventFunction)(wxEventFunction)(wxNotebookEventFunction) &fn, \
NULL \
},
#else
#define EVT_NOTEBOOK_PAGE_CHANGED(id, fn) \
{ \
wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, \
@@ -61,6 +83,8 @@ typedef void (wxEvtHandler::*wxNotebookEventFunction)(wxNotebookEvent&);
NULL \
},
#endif
// ----------------------------------------------------------------------------
// wxNotebook class itself
// ----------------------------------------------------------------------------

View File

@@ -195,6 +195,10 @@ typedef _TUCHAR wxUChar;
#endif
#elif defined(__GNUWIN32__) && !defined(__MINGW32__) // Cygwin (not Mingw32) doesn't have wcslen.h, needed in buffer.h
#define wxUSE_WCHAR_T 0
#elif defined(__BORLANDC__) // WIN16 BC++
#define wxUSE_WCHAR_T 0
#elif defined(__WATCOMC__)
#define wxUSE_WCHAR_T 0
#else
// add additional compiler checks if this fails
#define wxUSE_WCHAR_T 1
@@ -319,7 +323,50 @@ typedef unsigned char wxUChar;
#define wxSetlocale setlocale
// string.h functions
#define wxStricmp strcasecmp
// #define wxStricmp strcasecmp
// Taken from string.h since it tests for platform more correctly
// portable strcasecmp/_stricmp
inline int WXDLLEXPORT wxStricmp(const char *psz1, const char *psz2)
{
#if defined(__VISUALC__) || ( defined(__MWERKS__) && defined(__INTEL__) )
return _stricmp(psz1, psz2);
#elif defined(__SC__)
return _stricmp(psz1, psz2);
#elif defined(__SALFORDC__)
return stricmp(psz1, psz2);
#elif defined(__BORLANDC__)
return stricmp(psz1, psz2);
#elif defined(__WATCOMC__)
return stricmp(psz1, psz2);
#elif defined(__UNIX__) || defined(__GNUWIN32__)
return strcasecmp(psz1, psz2);
#elif defined(__MWERKS__) && !defined(__INTEL__)
register char c1, c2;
do {
c1 = tolower(*psz1++);
c2 = tolower(*psz2++);
} while ( c1 && (c1 == c2) );
return c1 - c2;
#else
// almost all compilers/libraries provide this function (unfortunately under
// different names), that's why we don't implement our own which will surely
// be more efficient than this code (uncomment to use):
/*
register char c1, c2;
do {
c1 = tolower(*psz1++);
c2 = tolower(*psz2++);
} while ( c1 && (c1 == c2) );
return c1 - c2;
*/
#error "Please define string case-insensitive compare for your OS/compiler"
#endif // OS/compiler
}
// #define wxStrtok strtok_r // this needs a configure check
// leave the rest to defaults below