From 4fcefc68f8cf9c2648c7140a08fa492c29896c3f Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Tue, 29 Mar 2016 09:29:51 +0000 Subject: Remove the platform-dependent type xchar File fl_utf8.h defines the xchar type with a platform-dependent value (wchar_t or unsigned short). But it is used exclusively by WIN32 code (0 use in cross-platform code, 0 use in APPLE or in USE_X11 code). Thus, we can just get rid of this type and replace it by wchar_t where it is used. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11459 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_Preferences.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/Fl_Preferences.cxx') diff --git a/src/Fl_Preferences.cxx b/src/Fl_Preferences.cxx index 382186949..2b9473f76 100644 --- a/src/Fl_Preferences.cxx +++ b/src/Fl_Preferences.cxx @@ -1010,15 +1010,15 @@ Fl_Preferences::RootNode::RootNode( Fl_Preferences *prefs, Root root, const char strcpy(filename, "C:\\FLTK"); } else { #if 0 - xchar *b = (xchar*)_wcsdup((xchar *)filename); + wchar_t *b = (wchar_t*)_wcsdup((wchar_t *)filename); #else // cygwin does not come with _wcsdup. Use malloc + wcscpy. // For implementation of wcsdup functionality See // - http://linenum.info/p/glibc/2.7/wcsmbs/wcsdup.c - xchar *b = (xchar*) malloc((wcslen((xchar *) filename) + 1) * sizeof(xchar)); - wcscpy(b, (xchar *) filename); + wchar_t *b = (wchar_t*) malloc((wcslen((wchar_t *) filename) + 1) * sizeof(wchar_t)); + wcscpy(b, (wchar_t *) filename); #endif - // filename[fl_unicode2utf(b, wcslen((xchar*)b), filename)] = 0; + // filename[fl_unicode2utf(b, wcslen((wchar_t*)b), filename)] = 0; unsigned len = fl_utf8fromwc(filename, (FL_PATH_MAX-1), b, (unsigned) wcslen(b)); filename[len] = 0; free(b); -- cgit v1.2.3