From 771ba0c057252d53955665ea1150e365e731543e Mon Sep 17 00:00:00 2001 From: Spencer Low Date: Mon, 30 Jul 2018 19:53:23 -0700 Subject: [PATCH] adb: win32: fix Unicode console output commandline.cpp includes commandline.h which defines StandardStreamsCallbackInterface which calls fwrite(). In the compilation unit for commandline.cpp, fwrite is getting remapped to adb_fwrite (good), but the compilation unit for bugreport.cpp includes sysdeps.h pretty late, which prevents fwrite from getting remapped to adb_fwrite. Apparently when linking, the version of StandardStreamsCallbackInterface that gets used is the one from bugreport.cpp's compilation unit, which doesn't call adb_fwrite(). And it's necessary to call adb_fwrite() to get Unicode console output on Windows. The fix is to #include "sysdeps.h" earlier in bugreport.cpp. I searched the other object files for other unremapped calls to printf/fwrite/etc. and didn't find any. Bug: https://issuetracker.google.com/issues/111972753 Test: mma, manual test on Windows 10 x64 Change-Id: I322dff75a878397f5e10227e746e77b0024129d0 Signed-off-by: Spencer Low --- adb/client/bugreport.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adb/client/bugreport.cpp b/adb/client/bugreport.cpp index 346bb4b2c..fe9873725 100644 --- a/adb/client/bugreport.cpp +++ b/adb/client/bugreport.cpp @@ -16,6 +16,8 @@ #define TRACE_TAG ADB +#include "sysdeps.h" + #include "bugreport.h" #include @@ -24,8 +26,6 @@ #include #include -#include "sysdeps.h" - #include "adb_utils.h" #include "client/file_sync_client.h"