From 3a3dde0d44c43bc70a1e9791381ada04b4953a5d Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Mon, 11 Jun 2007 06:08:13 +0000 Subject: [PATCH] use wx/crt.h as the 'official' header for wxCRT wrappers instead of wxchar.h; add comments explaining that users should include wx/crt.h to implementation headers git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@46395 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/crt.h | 7 ++++++- include/wx/string.h | 4 ++-- include/wx/wxchar.h | 9 +++------ include/wx/wxcrt.h | 3 +++ include/wx/wxcrtvararg.h | 3 +++ src/common/db.cpp | 2 +- src/common/log.cpp | 2 +- src/common/wxcrt.cpp | 4 ++-- src/common/wxprintf.cpp | 2 +- src/generic/fontdlgg.cpp | 2 +- src/mac/carbon/fontdlg.cpp | 2 +- src/msw/app.cpp | 2 +- src/os2/app.cpp | 2 +- src/os2/radiobox.cpp | 2 +- src/palmos/app.cpp | 2 +- src/unix/dialup.cpp | 2 +- 16 files changed, 29 insertions(+), 21 deletions(-) diff --git a/include/wx/crt.h b/include/wx/crt.h index f6996509b5..ee7f6cb945 100644 --- a/include/wx/crt.h +++ b/include/wx/crt.h @@ -11,6 +11,11 @@ #ifndef _WX_CRT_H_ #define _WX_CRT_H_ -#include "wx/wxchar.h" +// include wxChar type definition: +#include "wx/chartype.h" + +// and wrappers for CRT functions: +#include "wx/wxcrt.h" +#include "wx/wxcrtvararg.h" #endif // _WX_CRT_H_ diff --git a/include/wx/string.h b/include/wx/string.h index 76e8db2178..86eb7eef96 100644 --- a/include/wx/string.h +++ b/include/wx/string.h @@ -3094,11 +3094,11 @@ wxStringIteratorNode::~wxStringIteratorNode() #endif // wxUSE_UNICODE_UTF8 #if WXWIN_COMPATIBILITY_2_8 - // lot of code out there doesn't explicitly include wx/wxchar.h, but uses + // lot of code out there doesn't explicitly include wx/crt.h, but uses // CRT wrappers that are now declared in wx/wxcrt.h and wx/wxcrtvararg.h, // so let's include this header now that wxString is defined and it's safe // to do it: - #include "wx/wxchar.h" + #include "wx/crt.h" #endif #endif // _WX_WXSTRING_H_ diff --git a/include/wx/wxchar.h b/include/wx/wxchar.h index ee1bed8f1c..b595181709 100644 --- a/include/wx/wxchar.h +++ b/include/wx/wxchar.h @@ -12,11 +12,8 @@ #ifndef _WX_WXCHAR_H_ #define _WX_WXCHAR_H_ -// include wxChar type definition: -#include "wx/chartype.h" - -// and wrappers for CRT functions: -#include "wx/wxcrt.h" -#include "wx/wxcrtvararg.h" +// This header used to define CRT functions wrappers in wxWidgets 2.8. This is +// now done in (headers included by) wx/crt.h, so include it for compatibility: +#include "wx/crt.h" #endif /* _WX_WXCHAR_H_ */ diff --git a/include/wx/wxcrt.h b/include/wx/wxcrt.h index 4e82f89b87..6d4abb3dbe 100644 --- a/include/wx/wxcrt.h +++ b/include/wx/wxcrt.h @@ -13,6 +13,9 @@ #ifndef _WX_WXCRT_H_ #define _WX_WXCRT_H_ +// NB: User code should include wx/crt.h instead of including this +// header directly. + #include "wx/wxcrtbase.h" #include "wx/string.h" diff --git a/include/wx/wxcrtvararg.h b/include/wx/wxcrtvararg.h index 2fd54d4fed..cb8b2998c8 100644 --- a/include/wx/wxcrtvararg.h +++ b/include/wx/wxcrtvararg.h @@ -13,6 +13,9 @@ #ifndef _WX_WXCRTVARARG_H_ #define _WX_WXCRTVARARG_H_ +// NB: User code should include wx/crt.h instead of including this +// header directly. + #include "wx/wxcrt.h" #include "wx/strvararg.h" diff --git a/src/common/db.cpp b/src/common/db.cpp index 7ca9dc47ae..cf4f9a28b9 100644 --- a/src/common/db.cpp +++ b/src/common/db.cpp @@ -43,7 +43,7 @@ #endif #include "wx/filefn.h" -#include "wx/wxchar.h" +#include "wx/crt.h" #include #include diff --git a/src/common/log.cpp b/src/common/log.cpp index 113d202158..a9446dc898 100644 --- a/src/common/log.cpp +++ b/src/common/log.cpp @@ -42,7 +42,7 @@ #include "wx/msgout.h" #include "wx/textfile.h" #include "wx/thread.h" -#include "wx/wxchar.h" +#include "wx/crt.h" // other standard headers #ifndef __WXWINCE__ diff --git a/src/common/wxcrt.cpp b/src/common/wxcrt.cpp index b8961dcccd..a0430b73dc 100644 --- a/src/common/wxcrt.cpp +++ b/src/common/wxcrt.cpp @@ -20,7 +20,7 @@ #pragma hdrstop #endif -#include "wx/wxchar.h" +#include "wx/crt.h" #define _ISOC9X_SOURCE 1 // to get vsscanf() #define _BSD_SOURCE 1 // to still get strdup() @@ -90,7 +90,7 @@ size_t WXDLLEXPORT wxMB2WC(wchar_t *buf, const char *psz, size_t n) // to just get the size of the needed buffer -- this is needed as otherwise // we have no idea about how much space we need and if the CRT doesn't // support it (the only currently known example being Metrowerks, see - // wx/wxchar.h) we don't use its mbstowcs() at all + // wx/crt.h) we don't use its mbstowcs() at all #ifdef HAVE_WCSRTOMBS return mbsrtowcs((wchar_t *) NULL, &psz, 0, &mbstate); #else diff --git a/src/common/wxprintf.cpp b/src/common/wxprintf.cpp index 20bea8eea4..c9f25d8082 100644 --- a/src/common/wxprintf.cpp +++ b/src/common/wxprintf.cpp @@ -20,7 +20,7 @@ #pragma hdrstop #endif -#include "wx/wxchar.h" +#include "wx/crt.h" #include diff --git a/src/generic/fontdlgg.cpp b/src/generic/fontdlgg.cpp index 32fb9da936..3dccde50dd 100644 --- a/src/generic/fontdlgg.cpp +++ b/src/generic/fontdlgg.cpp @@ -20,7 +20,7 @@ #ifndef WX_PRECOMP #include - #include "wx/wxchar.h" + #include "wx/crt.h" #include "wx/utils.h" #include "wx/dialog.h" #include "wx/listbox.h" diff --git a/src/mac/carbon/fontdlg.cpp b/src/mac/carbon/fontdlg.cpp index 5e0b975781..e155dd7bd5 100644 --- a/src/mac/carbon/fontdlg.cpp +++ b/src/mac/carbon/fontdlg.cpp @@ -28,7 +28,7 @@ #ifndef WX_PRECOMP #include "wx/intl.h" - #include "wx/wxchar.h" + #include "wx/crt.h" #include "wx/dcclient.h" #include "wx/frame.h" #include "wx/textctrl.h" diff --git a/src/msw/app.cpp b/src/msw/app.cpp index 28e359be38..843b4d3c88 100644 --- a/src/msw/app.cpp +++ b/src/msw/app.cpp @@ -40,7 +40,7 @@ #include "wx/dialog.h" #include "wx/msgdlg.h" #include "wx/intl.h" - #include "wx/wxchar.h" + #include "wx/crt.h" #include "wx/log.h" #include "wx/module.h" #endif diff --git a/src/os2/app.cpp b/src/os2/app.cpp index 65b080d5e9..758e6c7c44 100644 --- a/src/os2/app.cpp +++ b/src/os2/app.cpp @@ -28,7 +28,7 @@ #include "wx/dialog.h" #include "wx/msgdlg.h" #include "wx/intl.h" - #include "wx/wxchar.h" + #include "wx/crt.h" #include "wx/log.h" #include "wx/module.h" #endif diff --git a/src/os2/radiobox.cpp b/src/os2/radiobox.cpp index 26c89bd5ac..6b09f22646 100644 --- a/src/os2/radiobox.cpp +++ b/src/os2/radiobox.cpp @@ -18,7 +18,7 @@ #ifndef WX_PRECOMP #include - #include "wx/wxchar.h" + #include "wx/crt.h" #include "wx/string.h" #include "wx/bitmap.h" #include "wx/brush.h" diff --git a/src/palmos/app.cpp b/src/palmos/app.cpp index 7efb190ac6..cfc5e1e70a 100644 --- a/src/palmos/app.cpp +++ b/src/palmos/app.cpp @@ -39,7 +39,7 @@ #include "wx/dialog.h" #include "wx/msgdlg.h" #include "wx/intl.h" - #include "wx/wxchar.h" + #include "wx/crt.h" #include "wx/log.h" #include "wx/module.h" #endif diff --git a/src/unix/dialup.cpp b/src/unix/dialup.cpp index 0f187a106b..859e027307 100644 --- a/src/unix/dialup.cpp +++ b/src/unix/dialup.cpp @@ -29,7 +29,7 @@ #include "wx/filefn.h" #include "wx/ffile.h" #include "wx/process.h" -#include "wx/wxchar.h" +#include "wx/crt.h" #include -- 2.45.2