#include <string.h>
#include <stdlib.h>
+
+#include "wx/debug.h"
+#include "wx/strconv.h"
+#include "wx/intl.h"
+#include "wx/log.h"
+
+// ----------------------------------------------------------------------------
+// globals
+// ----------------------------------------------------------------------------
+
+WXDLLEXPORT_DATA(wxMBConv *) wxConvCurrent = &wxConvLibc;
+
+
+// ============================================================================
+// implementation
+// ============================================================================
+
+#if wxUSE_WCHAR_T
+
#ifdef __SALFORDC__
#include <clib.h>
#endif
#include <windows.h>
#endif
-#include "wx/debug.h"
-#include "wx/strconv.h"
-#include "wx/intl.h"
-#include "wx/log.h"
-
#define BSWAP_UCS4(str, len) { unsigned _c; for (_c=0; _c<len; _c++) str[_c]=wxUINT32_SWAP_ALWAYS(str[_c]); }
#define BSWAP_UTF16(str, len) { unsigned _c; for (_c=0; _c<len; _c++) str[_c]=wxUINT16_SWAP_ALWAYS(str[_c]); }
#error "Weird sizeof(wchar_t): please report your platform details to wx-users mailing list"
#endif
-// ----------------------------------------------------------------------------
-// globals
-// ----------------------------------------------------------------------------
-
-WXDLLEXPORT_DATA(wxMBConv *) wxConvCurrent = &wxConvLibc;
-
-// ============================================================================
-// implementation
-// ============================================================================
-
-#if wxUSE_WCHAR_T
#ifdef WC_UTF16
size_t outbuf = n;
size_t res, cres;
- wchar_t *tmpbuf;
+ wchar_t *tmpbuf = 0;
if (g_wcNeedsSwap)
{