From 3d5231db07a04de50075f18fd605d3d87234a33b Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Sun, 17 Feb 2002 23:29:25 +0000 Subject: [PATCH] more MSLU fixes and moved MSLU stuff into separate file git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14290 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- distrib/msw/tmake/filelist.txt | 3 +++ include/wx/filefn.h | 18 +++++++++--------- include/wx/msw/private.h | 3 +++ include/wx/wxchar.h | 9 +++++++-- src/common/fileconf.cpp | 6 ++---- src/common/filefn.cpp | 28 ++-------------------------- src/microwin/files.lst | 1 + src/msw/files.lst | 3 +++ src/msw/makefile.b32 | 3 +++ src/msw/makefile.bcc | 3 +++ src/msw/makefile.dos | 6 ++++++ src/msw/makefile.g95 | 1 + src/msw/makefile.sc | 1 + src/msw/makefile.vc | 1 + src/msw/makefile.wat | 4 ++++ src/wxWindows.dsp | 8 ++++++++ 16 files changed, 57 insertions(+), 41 deletions(-) diff --git a/distrib/msw/tmake/filelist.txt b/distrib/msw/tmake/filelist.txt index 246786f918..8f3c52b261 100644 --- a/distrib/msw/tmake/filelist.txt +++ b/distrib/msw/tmake/filelist.txt @@ -314,6 +314,7 @@ metafile.cpp MSW mimetype.cpp MSW Win32Only,Base minifram.cpp MSW msgdlg.cpp MSW +mslu.cpp MSW nativdlg.cpp MSW notebook.cpp MSW Win32Only oleutils.cpp MSW OLE @@ -874,6 +875,7 @@ mimetype.h WXH Base minifram.h WXH module.h WXH Base msgdlg.h WXH +mslu.cpp MSW mstream.h WXH Base notebook.h WXH object.h WXH Base @@ -1264,6 +1266,7 @@ metafile.h MSWH mimetype.h MSWH Win32Only,Base minifram.h MSWH msgdlg.h MSWH +mslu.h MSWH msvcrt.h MSWH notebook.h MSWH palette.h MSWH diff --git a/include/wx/filefn.h b/include/wx/filefn.h index e590ff3fe8..b1df9ded52 100644 --- a/include/wx/filefn.h +++ b/include/wx/filefn.h @@ -81,23 +81,23 @@ WXDLLEXPORT_DATA(extern const wxChar*) wxEmptyString; #if wxUSE_UNICODE #if wxUSE_UNICODE_MSLU - WXDLLEXPORT int wxOpen(const wxChar *name, int flags, int mode); + #define wxOpen wxMSLU__wopen + #define wxAccess wxMSLU__waccess + #define wxMkDir wxMSLU__wmkdir + #define wxRmDir wxMSLU__wrmdir + #define wxStat wxMSLU__wstat #else #define wxOpen _wopen + #define wxAccess _waccess + #define wxMkDir _wmkdir + #define wxRmDir _wrmdir + #define wxStat _wstat #endif - #define wxAccess _waccess - - #define wxMkDir _wmkdir - #define wxRmDir _wrmdir - - #define wxStat _wstat #else // !wxUSE_UNICODE #define wxOpen _open #define wxAccess _access - #define wxMkDir _mkdir #define wxRmDir _rmdir - #define wxStat _stat #endif diff --git a/include/wx/msw/private.h b/include/wx/msw/private.h index 23aaba1766..5fe1bbfbef 100644 --- a/include/wx/msw/private.h +++ b/include/wx/msw/private.h @@ -28,6 +28,9 @@ // undefine conflicting symbols which were defined in windows.h #include "wx/msw/winundef.h" +// Include fixes for MSLU: +#include "wx/msw/mslu.h" + #include "wx/log.h" class WXDLLEXPORT wxFont; diff --git a/include/wx/wxchar.h b/include/wx/wxchar.h index df2130d45d..462da579d6 100644 --- a/include/wx/wxchar.h +++ b/include/wx/wxchar.h @@ -202,6 +202,13 @@ typedef _TUCHAR wxUChar; // stdio.h functions #ifndef wxNO_TCHAR_STDIO +# if wxUSE_UNICODE_MSLU +# define wxRemove wxMSLU__tremove +# define wxRename wxMSLU__trename +# else +# define wxRemove _tremove +# define wxRename _trename +# endif # define wxFgetc _fgettc # define wxFgetchar _fgettchar # define wxFgets _fgetts @@ -219,8 +226,6 @@ typedef _TUCHAR wxUChar; # define wxPutc _puttc # define wxPutchar _puttchar # define wxPuts _putts -# define wxRemove _tremove -# define wxRename _trename # define wxScanf _tscanf # define wxSprintf _stprintf # define wxSscanf _stscanf diff --git a/src/common/fileconf.cpp b/src/common/fileconf.cpp index e976daf434..45ea8251d0 100644 --- a/src/common/fileconf.cpp +++ b/src/common/fileconf.cpp @@ -50,10 +50,8 @@ #include "wx/mac/private.h" // includes mac headers #endif -// _WINDOWS_ is defined when windows.h is included, -// __WXMSW__ is defined for MS Windows compilation -#if defined(__WXMSW__) && !defined(_WINDOWS_) - #include +#if defined(__WXMSW__) + #include "wx/msw/private.h" #endif //windows.h #if defined(__WXPM__) #define INCL_DOS diff --git a/src/common/filefn.cpp b/src/common/filefn.cpp index 319f1a6d66..9d83a8dbac 100644 --- a/src/common/filefn.cpp +++ b/src/common/filefn.cpp @@ -114,7 +114,8 @@ #ifdef __WINDOWS__ #include - + #include "wx/msw/mslu.h" + // sys/cygwin.h is needed for cygwin_conv_to_full_win32_path() // // note that it must be included after @@ -1803,28 +1804,3 @@ bool wxMatchWild( const wxString& pat, const wxString& text, bool dot_special ) #ifdef __VISUALC__ #pragma warning(default:4706) // assignment within conditional expression #endif // VC++ - -//------------------------------------------------------------------------ -// Missing functions in Unicode for Win9x -//------------------------------------------------------------------------ - -// NB: MSLU only covers Win32 API, it doesn't provide Unicode implementation of -// libc functions. Unfortunately, some of MSVCRT wchar_t functions -// (e.g. _wopen) don't work on Windows 9x, so we have to workaround it -// by calling the char version. We still want to use wchar_t version on -// NT/2000/XP, though, because they allow for Unicode file names. -#if wxUSE_UNICODE_MSLU - - #if defined( __VISUALC__ ) \ - || ( defined(__MINGW32__) && wxCHECK_W32API_VERSION( 0, 5 ) ) \ - || ( defined(__MWERKS__) && defined(__WXMSW__) ) - WXDLLEXPORT int wxOpen(const wxChar *name, int flags, int mode) - { - if ( wxGetOsVersion() == wxWINDOWS_NT ) - return _wopen(name, flags, mode); - else - return _open(wxConvFile.cWX2MB(name), flags, mode); - } - #endif - -#endif // wxUSE_UNICODE_MSLU diff --git a/src/microwin/files.lst b/src/microwin/files.lst index 7f43e3e584..31cce0384f 100644 --- a/src/microwin/files.lst +++ b/src/microwin/files.lst @@ -514,6 +514,7 @@ ALL_HEADERS = \ msw/mimetype.h \ msw/minifram.h \ msw/msgdlg.h \ + msw/mslu.h \ msw/msvcrt.h \ msw/notebook.h \ msw/palette.h \ diff --git a/src/msw/files.lst b/src/msw/files.lst index 38148cdac4..8e68f25ebb 100644 --- a/src/msw/files.lst +++ b/src/msw/files.lst @@ -221,6 +221,7 @@ ALL_SOURCES = \ msw/mimetype.cpp \ msw/minifram.cpp \ msw/msgdlg.cpp \ + msw/mslu.cpp \ msw/nativdlg.cpp \ msw/notebook.cpp \ msw/ole/oleutils.cpp \ @@ -572,6 +573,7 @@ ALL_HEADERS = \ msw/mimetype.h \ msw/minifram.h \ msw/msgdlg.h \ + msw/mslu.h \ msw/msvcrt.h \ msw/notebook.h \ msw/palette.h \ @@ -899,6 +901,7 @@ GUIOBJS = \ mimetype.o \ minifram.o \ msgdlg.o \ + mslu.o \ nativdlg.o \ notebook.o \ ownerdrw.o \ diff --git a/src/msw/makefile.b32 b/src/msw/makefile.b32 index f395edd232..68da714766 100644 --- a/src/msw/makefile.b32 +++ b/src/msw/makefile.b32 @@ -305,6 +305,7 @@ MSWOBJS = $(MSWDIR)\accel.obj \ $(MSWDIR)\mimetype.obj \ $(MSWDIR)\minifram.obj \ $(MSWDIR)\msgdlg.obj \ + $(MSWDIR)\mslu.obj \ $(MSWDIR)\nativdlg.obj \ $(MSWDIR)\notebook.obj \ $(MSWDIR)\oleutils.obj \ @@ -558,6 +559,8 @@ $(MSWDIR)\minifram.obj: $(MSWDIR)\minifram.$(SRCSUFF) $(MSWDIR)\msgdlg.obj: $(MSWDIR)\msgdlg.$(SRCSUFF) +$(MSWDIR)\mslu.obj: $(MSWDIR)\mslu.$(SRCSUFF) + $(MSWDIR)\nativdlg.obj: $(MSWDIR)\nativdlg.$(SRCSUFF) $(MSWDIR)\notebook.obj: $(MSWDIR)\notebook.$(SRCSUFF) diff --git a/src/msw/makefile.bcc b/src/msw/makefile.bcc index 6ec16f2814..526845f116 100644 --- a/src/msw/makefile.bcc +++ b/src/msw/makefile.bcc @@ -266,6 +266,7 @@ MSWOBJS = $(MSWDIR)\accel.obj \ $(MSWDIR)\metafile.obj \ $(MSWDIR)\minifram.obj \ $(MSWDIR)\msgdlg.obj \ + $(MSWDIR)\mslu.obj \ $(MSWDIR)\nativdlg.obj \ $(MSWDIR)\ownerdrw.obj \ $(MSWDIR)\palette.obj \ @@ -440,6 +441,8 @@ $(MSWDIR)\minifram.obj: $(MSWDIR)\minifram.$(SRCSUFF) $(MSWDIR)\msgdlg.obj: $(MSWDIR)\msgdlg.$(SRCSUFF) +$(MSWDIR)\mslu.obj: $(MSWDIR)\mslu.$(SRCSUFF) + $(MSWDIR)\nativdlg.obj: $(MSWDIR)\nativdlg.$(SRCSUFF) $(MSWDIR)\ownerdrw.obj: $(MSWDIR)\ownerdrw.$(SRCSUFF) diff --git a/src/msw/makefile.dos b/src/msw/makefile.dos index 30ccd68365..628d8a1bc9 100644 --- a/src/msw/makefile.dos +++ b/src/msw/makefile.dos @@ -254,6 +254,7 @@ MSWOBJS1 = $(MSWDIR)\accel.obj \ $(MSWDIR)\metafile.obj \ $(MSWDIR)\minifram.obj \ $(MSWDIR)\msgdlg.obj \ + $(MSWDIR)\mslu.obj \ $(MSWDIR)\nativdlg.obj \ $(MSWDIR)\ownerdrw.obj @@ -633,6 +634,11 @@ $(MSWDIR)/msgdlg.obj: $*.$(SRCSUFF) $(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF) << +$(MSWDIR)/mslu.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF) +<< + $(MSWDIR)/nativdlg.obj: $*.$(SRCSUFF) cl @<< $(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF) diff --git a/src/msw/makefile.g95 b/src/msw/makefile.g95 index 59b8a9c1ff..f0b9403606 100644 --- a/src/msw/makefile.g95 +++ b/src/msw/makefile.g95 @@ -337,6 +337,7 @@ MSWOBJS = \ $(MSWDIR)/metafile.$(OBJSUFF) \ $(MSWDIR)/minifram.$(OBJSUFF) \ $(MSWDIR)/msgdlg.$(OBJSUFF) \ + $(MSWDIR)/mslu.$(OBJSUFF) \ $(MSWDIR)/nativdlg.$(OBJSUFF) \ $(MSWDIR)/notebook.$(OBJSUFF) \ $(MSWDIR)/ownerdrw.$(OBJSUFF) \ diff --git a/src/msw/makefile.sc b/src/msw/makefile.sc index a7a3ae40e1..c555f891b4 100644 --- a/src/msw/makefile.sc +++ b/src/msw/makefile.sc @@ -248,6 +248,7 @@ MSWOBJS = $(MSWDIR)\accel.obj \ $(MSWDIR)\mimetype.obj \ $(MSWDIR)\minifram.obj \ $(MSWDIR)\msgdlg.obj \ + $(MSWDIR)\mslu.obj \ $(MSWDIR)\nativdlg.obj \ $(MSWDIR)\ole\oleutils.obj \ $(MSWDIR)\ownerdrw.obj \ diff --git a/src/msw/makefile.vc b/src/msw/makefile.vc index b12c0ffbbc..e5c5a967d0 100644 --- a/src/msw/makefile.vc +++ b/src/msw/makefile.vc @@ -326,6 +326,7 @@ MSWOBJS = $(MSWDIR)\$D\accel.obj \ $(MSWDIR)\$D\mimetype.obj \ $(MSWDIR)\$D\minifram.obj \ $(MSWDIR)\$D\msgdlg.obj \ + $(MSWDIR)\$D\mslu.obj \ $(MSWDIR)\$D\nativdlg.obj \ $(MSWDIR)\$D\notebook.obj \ $(OLEDIR)\$D\oleutils.obj \ diff --git a/src/msw/makefile.wat b/src/msw/makefile.wat index 5f2d58f03f..ce15e03732 100644 --- a/src/msw/makefile.wat +++ b/src/msw/makefile.wat @@ -290,6 +290,7 @@ MSWOBJS = accel.obj & mimetype.obj & minifram.obj & msgdlg.obj & + mslu.obj & nativdlg.obj & notebook.obj & oleutils.obj & @@ -595,6 +596,9 @@ minifram.obj: $(MSWDIR)\minifram.cpp msgdlg.obj: $(MSWDIR)\msgdlg.cpp *$(CCC) $(CPPFLAGS) $(IFLAGS) $< +mslu.obj: $(MSWDIR)\mslu.cpp + *$(CCC) $(CPPFLAGS) $(IFLAGS) $< + nativdlg.obj: $(MSWDIR)\nativdlg.cpp *$(CCC) $(CPPFLAGS) $(IFLAGS) $< diff --git a/src/wxWindows.dsp b/src/wxWindows.dsp index 753b51cf44..dd069a2f0a 100644 --- a/src/wxWindows.dsp +++ b/src/wxWindows.dsp @@ -1217,6 +1217,10 @@ SOURCE=.\msw\msgdlg.cpp # End Source File # Begin Source File +SOURCE=.\msw\mslu.cpp +# End Source File +# Begin Source File + SOURCE=.\msw\nativdlg.cpp # End Source File # Begin Source File @@ -2639,6 +2643,10 @@ SOURCE=..\include\wx\msw\msgdlg.h # End Source File # Begin Source File +SOURCE=..\include\wx\msw\mslu.h +# End Source File +# Begin Source File + SOURCE=..\include\wx\msw\msvcrt.h # End Source File # Begin Source File -- 2.45.2