Fossil SCM
Eliminate fossil_utf8_to_console() for non-windows platforms: it isn't used then. Thanks to "bytevolcano" for the suggestion.
Commit
434adc35fc75e5fef19809e944e40f72f1e4a0ddb98f02f53764cd9b4dfa8ed8
Parent
84347382046a649…
1 file changed
+2
-4
+2
-4
| --- src/utf8.c | ||
| +++ src/utf8.c | ||
| @@ -305,16 +305,16 @@ | ||
| 305 | 305 | ** Display UTF-8 on the console. Return the number of |
| 306 | 306 | ** Characters written. If stdout or stderr is redirected |
| 307 | 307 | ** to a file, -1 is returned and nothing is written |
| 308 | 308 | ** to the console. |
| 309 | 309 | */ |
| 310 | +#ifdef _WIN32 | |
| 310 | 311 | int fossil_utf8_to_console( |
| 311 | 312 | const char *zUtf8, |
| 312 | 313 | int nByte, |
| 313 | 314 | int toStdErr |
| 314 | 315 | ){ |
| 315 | -#ifdef _WIN32 | |
| 316 | 316 | int nChar, written = 0; |
| 317 | 317 | wchar_t *zUnicode; /* Unicode version of zUtf8 */ |
| 318 | 318 | DWORD dummy; |
| 319 | 319 | Blob blob; |
| 320 | 320 | |
| @@ -352,9 +352,7 @@ | ||
| 352 | 352 | zUnicode + written, size, &dummy, 0); |
| 353 | 353 | written += size; |
| 354 | 354 | } |
| 355 | 355 | fossil_free(zUnicode); |
| 356 | 356 | return nChar; |
| 357 | -#else | |
| 358 | - return -1; /* No-op on unix */ | |
| 359 | -#endif | |
| 360 | 357 | } |
| 358 | +#endif | |
| 361 | 359 |
| --- src/utf8.c | |
| +++ src/utf8.c | |
| @@ -305,16 +305,16 @@ | |
| 305 | ** Display UTF-8 on the console. Return the number of |
| 306 | ** Characters written. If stdout or stderr is redirected |
| 307 | ** to a file, -1 is returned and nothing is written |
| 308 | ** to the console. |
| 309 | */ |
| 310 | int fossil_utf8_to_console( |
| 311 | const char *zUtf8, |
| 312 | int nByte, |
| 313 | int toStdErr |
| 314 | ){ |
| 315 | #ifdef _WIN32 |
| 316 | int nChar, written = 0; |
| 317 | wchar_t *zUnicode; /* Unicode version of zUtf8 */ |
| 318 | DWORD dummy; |
| 319 | Blob blob; |
| 320 | |
| @@ -352,9 +352,7 @@ | |
| 352 | zUnicode + written, size, &dummy, 0); |
| 353 | written += size; |
| 354 | } |
| 355 | fossil_free(zUnicode); |
| 356 | return nChar; |
| 357 | #else |
| 358 | return -1; /* No-op on unix */ |
| 359 | #endif |
| 360 | } |
| 361 |
| --- src/utf8.c | |
| +++ src/utf8.c | |
| @@ -305,16 +305,16 @@ | |
| 305 | ** Display UTF-8 on the console. Return the number of |
| 306 | ** Characters written. If stdout or stderr is redirected |
| 307 | ** to a file, -1 is returned and nothing is written |
| 308 | ** to the console. |
| 309 | */ |
| 310 | #ifdef _WIN32 |
| 311 | int fossil_utf8_to_console( |
| 312 | const char *zUtf8, |
| 313 | int nByte, |
| 314 | int toStdErr |
| 315 | ){ |
| 316 | int nChar, written = 0; |
| 317 | wchar_t *zUnicode; /* Unicode version of zUtf8 */ |
| 318 | DWORD dummy; |
| 319 | Blob blob; |
| 320 | |
| @@ -352,9 +352,7 @@ | |
| 352 | zUnicode + written, size, &dummy, 0); |
| 353 | written += size; |
| 354 | } |
| 355 | fossil_free(zUnicode); |
| 356 | return nChar; |
| 357 | } |
| 358 | #endif |
| 359 |