]> git.saurik.com Git - wxWidgets.git/commitdiff
try to fix D Mars compilation for Unicode
authorChris Elliott <biol75@york.ac.uk>
Wed, 11 Feb 2004 14:34:22 +0000 (14:34 +0000)
committerChris Elliott <biol75@york.ac.uk>
Wed, 11 Feb 2004 14:34:22 +0000 (14:34 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25736 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/wxchar.h
src/common/wxchar.cpp

index 5ca84cdbe121d049b56879ad234f78b3a9195110..3a126dad6ee3bb00955e82e48f1190dbc57964e1 100644 (file)
     #define  wxPuts      _putts
     #define  wxScanf     _tscanf
     #if defined(__DMC__)
-        /* Digital Mars adds count to _stprintf (C99) so it does not fit wxWindows needs */
-        /* and there is a bug in D Mars tchar.h prior to 8.39.4n, so define as sprintf */
-        /* for non-unicode builds CE */
-        /* Unicode broken 10 Feb 04 Fixme */
         #if wxUSE_UNICODE
-            #define wxSprintf swprintf
+            /* Digital Mars adds count to _stprintf (C99) so prototype conversion see wxchar.cpp */
+            int wxSprintf (wchar_t * __RESTRICT s, const wchar_t * __RESTRICT format, ... ) ;
         #else
+            /* and there is a bug in D Mars tchar.h prior to 8.39.4n, so define as sprintf */
             #define wxSprintf sprintf
         #endif
     #else
index dbb015767c05b7a7015574f05d380ff774e2c5ab..aa6fb1ec6d1b6f95fd45045f45d09a10a9bd66ea 100644 (file)
@@ -540,6 +540,23 @@ int WXDLLEXPORT wxSnprintf_(wxChar *buf, size_t len, const wxChar *format, ...)
 }
 #endif // wxSnprintf_
 
+#if defined(__DMC__)
+    /* Digital Mars adds count to _stprintf (C99) so convert */
+    #if wxUSE_UNICODE
+        int wxSprintf (wchar_t * __RESTRICT s, const wchar_t * __RESTRICT format, ... )
+        {
+            va_list arglist;
+
+            va_start( arglist, format );
+            int iLen = swprintf ( s, -1, format, arglist );
+            va_end( arglist );
+            return iLen ;
+        }
+
+    #endif // wxUSE_UNICODE
+
+#endif //__DMC__
+
 // ----------------------------------------------------------------------------
 // implement the standard IO functions for wide char if libc doesn't have them
 // ----------------------------------------------------------------------------