From ba1e9d6cede4073faf42e3e290a030965a2205c3 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 7 Feb 2004 15:07:08 +0000 Subject: [PATCH] Digital Mars compilation warnings and Unicode fixes (patch 884587) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25561 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/filefn.h | 4 ++++ include/wx/univ/checklst.h | 4 ++-- include/wx/univ/combobox.h | 2 +- include/wx/wxchar.h | 12 ++++++++++++ src/common/filefn.cpp | 1 + src/univ/combobox.cpp | 2 +- 6 files changed, 21 insertions(+), 4 deletions(-) diff --git a/include/wx/filefn.h b/include/wx/filefn.h index c59b78a015..eb714186e3 100644 --- a/include/wx/filefn.h +++ b/include/wx/filefn.h @@ -75,6 +75,7 @@ enum wxSeekMode #if defined( __VISUALC__ ) \ || ( defined(__MINGW32__) && !defined(__WINE__) && wxCHECK_W32API_VERSION( 0, 5 ) ) \ || ( defined(__MWERKS__) && defined(__WXMSW__) ) \ + || ( defined(__DMC__) && defined(__WXMSW__) ) \ || ( defined(__WATCOMC__) && defined(__WXMSW__) ) // functions #if defined(__BORLANDC__) || defined(__WATCOMC__) @@ -163,6 +164,9 @@ enum wxSeekMode #if defined(__MWERKS__) && defined(macintosh) #include #endif +#if defined(__DMC__) + typedef unsigned long mode_t; +#endif WXDLLIMPEXP_BASE int wxStat( const wxChar *file_name, wxStructStat *buf ); WXDLLIMPEXP_BASE int wxAccess( const wxChar *pathname, int mode ); WXDLLIMPEXP_BASE int wxOpen( const wxChar *pathname, int flags, mode_t mode ); diff --git a/include/wx/univ/checklst.h b/include/wx/univ/checklst.h index af878cad02..d9a5b32a0a 100644 --- a/include/wx/univ/checklst.h +++ b/include/wx/univ/checklst.h @@ -37,7 +37,7 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, int nStrings = 0, - const wxString *choices = NULL, + const wxString choices[] = NULL, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxListBoxNameStr) @@ -60,7 +60,7 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, int nStrings = 0, - const wxString *choices = NULL, + const wxString choices[] = (const wxString *) NULL, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxListBoxNameStr); diff --git a/include/wx/univ/combobox.h b/include/wx/univ/combobox.h index bfc643c696..52fa4b46b8 100644 --- a/include/wx/univ/combobox.h +++ b/include/wx/univ/combobox.h @@ -221,7 +221,7 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, int n = 0, - const wxString *choices = (const wxString *) NULL, + const wxString choices[] = (const wxString *) NULL, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxComboBoxNameStr) diff --git a/include/wx/wxchar.h b/include/wx/wxchar.h index eb2dd42e9c..ad9d353990 100644 --- a/include/wx/wxchar.h +++ b/include/wx/wxchar.h @@ -114,6 +114,8 @@ #include #elif defined(__WATCOMC__) #define wxHAVE_TCHAR_SUPPORT +#elif defined(__DMC__) + #define wxHAVE_TCHAR_SUPPORT #elif defined(__MINGW32__) && wxCHECK_W32API_VERSION( 1, 0 ) #define wxHAVE_TCHAR_SUPPORT #include @@ -300,7 +302,17 @@ #define wxPutchar _puttchar #define wxPuts _putts #define wxScanf _tscanf + #if defined(__DMC__) + /* Digital Mars adds count to _stprintf (C99) so it does not fit wxWindows needs */ + /* Instead of it we can use function from MSW api (FIXME: doesn't work) */ + #ifdef wxUSE_UNICODE + #define wxSprintf wsprintfW + #else + #define wxSprintf wsprintfA + #endif + #else #define wxSprintf _stprintf + #endif #define wxSscanf _stscanf #define wxTmpnam _ttmpnam #define wxUngetc _tungetc diff --git a/src/common/filefn.cpp b/src/common/filefn.cpp index 92692711ad..c9daf16772 100644 --- a/src/common/filefn.cpp +++ b/src/common/filefn.cpp @@ -1303,6 +1303,7 @@ bool wxRemoveFile(const wxString& file) #if defined(__VISUALC__) \ || defined(__BORLANDC__) \ || defined(__WATCOMC__) \ + || defined(__DMC__) \ || defined(__GNUWIN32__) int res = wxRemove(file); #elif defined(__WXMAC__) diff --git a/src/univ/combobox.cpp b/src/univ/combobox.cpp index 6c3be430e5..83ecde8dc1 100644 --- a/src/univ/combobox.cpp +++ b/src/univ/combobox.cpp @@ -694,7 +694,7 @@ bool wxComboBox::Create(wxWindow *parent, const wxPoint& pos, const wxSize& size, int n, - const wxString *choices, + const wxString choices[], long style, const wxValidator& validator, const wxString& name) -- 2.45.2