Silence shift-negative-value warnings only on POSIX/Clang.

R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1740103002 .
diff --git a/third_party/BUILD.gn b/third_party/BUILD.gn
index 933e92a..92fbcaa 100644
--- a/third_party/BUILD.gn
+++ b/third_party/BUILD.gn
@@ -179,7 +179,9 @@
 # This is only used for standalone builds.
 config("jpeg_warnings") {
   visibility = [ ":*" ]
-  cflags = [ "-Wno-shift-negative-value" ]
+  if (is_clang) {
+    cflags = [ "-Wno-shift-negative-value" ]
+  }
 }
 
 source_set("jpeg") {
@@ -364,7 +366,9 @@
 # TODO(dsinclair): Remove if fixed upstream. https://crbug.com/507712
 config("fx_zlib_warnings") {
   visibility = [ ":*" ]
-  cflags = [ "-Wno-shift-negative-value" ]
+  if (is_clang) {
+    cflags = [ "-Wno-shift-negative-value" ]
+  }
 }
 
 source_set("fx_zlib") {
diff --git a/third_party/third_party.gyp b/third_party/third_party.gyp
index 0208fa1..6746230 100644
--- a/third_party/third_party.gyp
+++ b/third_party/third_party.gyp
@@ -230,14 +230,12 @@
         'libjpeg/jversion.h',
         'libjpeg/transupp.h',
       ],
-      'cflags': [
-        '-Wno-shift-negative-value',
-      ],
       'conditions': [
         ['os_posix==1', {
           'cflags': [
             '-Wno-main',
             '-Wno-missing-braces',
+            '-Wno-shift-negative-value',
             '-Wno-unused',
           ],
         }],
@@ -316,9 +314,13 @@
         'zlib_v128/uncompr.c',
         'zlib_v128/zutil.c',
       ],
-      'cflags': [
-        # TODO(dsinclair): Remove if fixed upstream. https://crbug.com/507712
-        '-Wno-shift-negative-value',
+      'conditions': [
+        ['os_posix==1', {
+          'cflags': [
+            # TODO(dsinclair): Remove if fixed upstream. https://crbug.com/507712
+            '-Wno-shift-negative-value',
+          ],
+        }],
       ],
 
     },