One of the #ifdef guards in src/utf8.c can be moved up since the
fossil_utf8_to_console() function is only ever called on WIN32
platforms anyway.
BTW, many guards are "#if defined(_WIN32)" rather than "#ifdef _WIN32"
but I'm not sure what is preferred here.
Index: src/utf8.c
==================================================================
--- src/utf8.c
+++ src/utf8.c
@@ -305,16 +305,16 @@
** Display UTF-8 on the console. Return the number of
** Characters written. If stdout or stderr is redirected
** to a file, -1 is returned and nothing is written
** to the console.
*/
+#ifdef _WIN32
int fossil_utf8_to_console(
const char *zUtf8,
int nByte,
int toStdErr
){
-#ifdef _WIN32
int nChar, written = 0;
wchar_t *zUnicode; /* Unicode version of zUtf8 */
DWORD dummy;
Blob blob;
@@ -352,9 +352,7 @@
zUnicode + written, size, &dummy, 0);
written += size;
}
fossil_free(zUnicode);
return nChar;
-#else
- return -1; /* No-op on unix */
-#endif
}
+#endif
_______________________________________________
fossil-users mailing list
[email protected]
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users