diff --git a/BUILD.gn b/BUILD.gn index f1ac0bb32b..f299446d45 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -361,6 +361,13 @@ config("common_config") { # Used in Chromium's overrides to disable logging defines += [ "WEBRTC_UNSAFE_FUZZER_MODE" ] } + + if (!build_with_chromium && rtc_win_undef_unicode) { + cflags += [ + "/UUNICODE", + "/U_UNICODE", + ] + } } config("common_objc") { diff --git a/tools_webrtc/mb/mb_config.pyl b/tools_webrtc/mb/mb_config.pyl index e468bb0c95..b452f74ee2 100644 --- a/tools_webrtc/mb/mb_config.pyl +++ b/tools_webrtc/mb/mb_config.pyl @@ -99,7 +99,7 @@ 'dummy_audio_file_devices_no_protobuf': 'dummy_audio_file_devices_no_protobuf_x86', 'rtti_no_sctp': - 'rtti_no_sctp_x86', + 'rtti_no_sctp_no_unicode_win_x86', }, }, 'client.webrtc.perf': { @@ -241,7 +241,7 @@ 'dummy_audio_file_devices_no_protobuf': 'dummy_audio_file_devices_no_protobuf_x86', 'rtti_no_sctp': - 'rtti_no_sctp_x86', + 'rtti_no_sctp_no_unicode_win_x86', }, } }, @@ -432,8 +432,8 @@ 'dummy_audio_file_devices_no_protobuf_x86': [ 'debug_bot', 'x86', 'dummy_audio_file_devices', 'no_protobuf' ], - 'rtti_no_sctp_x86': [ - 'debug_bot', 'x86', 'rtti', 'no_sctp' + 'rtti_no_sctp_no_unicode_win_x86': [ + 'debug_bot', 'x86', 'rtti', 'no_sctp', 'win_undef_unicode' ], 'bwe_test_logging_android_arm': [ @@ -627,5 +627,9 @@ 'winuwp': { 'gn_args': 'target_os="winuwp"', }, + + 'win_undef_unicode': { + 'gn_args': 'rtc_win_undef_unicode=true', + }, }, } diff --git a/webrtc.gni b/webrtc.gni index 3a89a9a9c7..6ba8d0aeb3 100644 --- a/webrtc.gni +++ b/webrtc.gni @@ -187,6 +187,14 @@ declare_args() { # (they will still be included in libjingle_peerconnection_so.so and # WebRTC.framework) rtc_include_builtin_video_codecs = true + + # When set to true and in a standalone build, it will undefine UNICODE and + # _UNICODE (which are always defined globally by the Chromium Windows + # toolchain). + # This is only needed for testing purposes, WebRTC wants to be sure it + # doesn't assume /DUNICODE and /D_UNICODE but that it explicitly uses + # wide character functions. + rtc_win_undef_unicode = false } if (!build_with_mozilla) {