diff --git a/BUILD.gn b/BUILD.gn index ece2fd36ddc83b6f95ca5ddebfc472aab456eb56..46bbcdff8cb3db851170539d2726f6b3f45c0eca 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -20,8 +20,9 @@ config("libsoup_config") { "-DG_LOG_DOMAIN=\"libsoup\"", "-DLIBSOUP_COMPILATION", "-Wno-sign-compare", - "-Wno-pragma-messages", + "-Wno-#pragma-messages", "-DOHOS_GLIB_COMPATIBLE", + "-DOHOS_OPT_COMPAT", ] } diff --git a/libsoup/soup-content-sniffer.c b/libsoup/soup-content-sniffer.c index 967ec6141a3923e8cd531ddac568babc06362a56..76aab321c72f80e7888aa2822d283cb99c324504 100644 --- a/libsoup/soup-content-sniffer.c +++ b/libsoup/soup-content-sniffer.c @@ -638,8 +638,14 @@ sniff_feed_or_html (SoupContentSniffer *sniffer, SoupBuffer *buffer) goto text_html; /* Skip a leading UTF-8 BOM */ + // x86_64 -Wtautological-constant-out-of-range-compare +#ifdef OHOS_OPT_COMPAT + if (resource[0] == (char)0xEF && resource[1] == (char)0xBB && resource[2] == (char)0xBF) + pos = 3; +#else if (resource[0] == 0xEF && resource[1] == 0xBB && resource[2] == 0xBF) pos = 3; +#endif look_for_tag: if (pos > resource_length)