[fuzz] Make libfuzzer defines backwards compatible for roll

This should fix the chrome roll.

Change-Id: I2de68f972996bf6124cf5cc27dfd538aa1161057
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316877
Auto-Submit: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
diff --git a/fuzz/oss_fuzz/FuzzImage.cpp b/fuzz/oss_fuzz/FuzzImage.cpp
index 046b915..473331a 100644
--- a/fuzz/oss_fuzz/FuzzImage.cpp
+++ b/fuzz/oss_fuzz/FuzzImage.cpp
@@ -28,7 +28,8 @@
     return true;
 }
 
-#if defined(SK_BUILD_FOR_LIBFUZZER)
+// TODO(kjlubick): remove IS_FUZZING... after https://crrev.com/c/2410304 lands
+#if defined(SK_BUILD_FOR_LIBFUZZER) || defined(IS_FUZZING_WITH_LIBFUZZER)
 extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
     if (size > 10240) {
         return 0;
diff --git a/fuzz/oss_fuzz/FuzzImageFilterDeserialize.cpp b/fuzz/oss_fuzz/FuzzImageFilterDeserialize.cpp
index 049a1de..4cac47d 100644
--- a/fuzz/oss_fuzz/FuzzImageFilterDeserialize.cpp
+++ b/fuzz/oss_fuzz/FuzzImageFilterDeserialize.cpp
@@ -39,7 +39,8 @@
     }
 }
 
-#if defined(SK_BUILD_FOR_LIBFUZZER)
+// TODO(kjlubick): remove IS_FUZZING... after https://crrev.com/c/2410304 lands
+#if defined(SK_BUILD_FOR_LIBFUZZER) || defined(IS_FUZZING_WITH_LIBFUZZER)
 extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
     if (size > 10024) {
         return 0;
diff --git a/fuzz/oss_fuzz/FuzzIncrementalImage.cpp b/fuzz/oss_fuzz/FuzzIncrementalImage.cpp
index 2890318..578d59c 100644
--- a/fuzz/oss_fuzz/FuzzIncrementalImage.cpp
+++ b/fuzz/oss_fuzz/FuzzIncrementalImage.cpp
@@ -45,7 +45,8 @@
     }
 }
 
-#if defined(SK_BUILD_FOR_LIBFUZZER)
+// TODO(kjlubick): remove IS_FUZZING... after https://crrev.com/c/2410304 lands
+#if defined(SK_BUILD_FOR_LIBFUZZER) || defined(IS_FUZZING_WITH_LIBFUZZER)
 extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
     if (size > 10240) {
         return 0;
diff --git a/fuzz/oss_fuzz/FuzzJSON.cpp b/fuzz/oss_fuzz/FuzzJSON.cpp
index 49bfd1d..d94676b 100644
--- a/fuzz/oss_fuzz/FuzzJSON.cpp
+++ b/fuzz/oss_fuzz/FuzzJSON.cpp
@@ -15,7 +15,8 @@
     dom.write(&wstream);
 }
 
-#if defined(SK_BUILD_FOR_LIBFUZZER)
+// TODO(kjlubick): remove IS_FUZZING... after https://crrev.com/c/2410304 lands
+#if defined(SK_BUILD_FOR_LIBFUZZER) || defined(IS_FUZZING_WITH_LIBFUZZER)
 extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
     auto bytes = SkData::MakeWithoutCopy(data, size);
     FuzzJSON(bytes);
diff --git a/fuzz/oss_fuzz/FuzzPathDeserialize.cpp b/fuzz/oss_fuzz/FuzzPathDeserialize.cpp
index 84127ef..cd3493b 100644
--- a/fuzz/oss_fuzz/FuzzPathDeserialize.cpp
+++ b/fuzz/oss_fuzz/FuzzPathDeserialize.cpp
@@ -26,7 +26,8 @@
     s->getCanvas()->drawPath(path, SkPaint());
 }
 
-#if defined(SK_BUILD_FOR_LIBFUZZER)
+// TODO(kjlubick): remove IS_FUZZING... after https://crrev.com/c/2410304 lands
+#if defined(SK_BUILD_FOR_LIBFUZZER) || defined(IS_FUZZING_WITH_LIBFUZZER)
 extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
     if (size < 4 || size > 2000) {
         return 0;
diff --git a/fuzz/oss_fuzz/FuzzRegionDeserialize.cpp b/fuzz/oss_fuzz/FuzzRegionDeserialize.cpp
index 2d3aac0..bdbde04 100644
--- a/fuzz/oss_fuzz/FuzzRegionDeserialize.cpp
+++ b/fuzz/oss_fuzz/FuzzRegionDeserialize.cpp
@@ -34,7 +34,8 @@
     return true;
 }
 
-#if defined(SK_BUILD_FOR_LIBFUZZER)
+// TODO(kjlubick): remove IS_FUZZING... after https://crrev.com/c/2410304 lands
+#if defined(SK_BUILD_FOR_LIBFUZZER) || defined(IS_FUZZING_WITH_LIBFUZZER)
 extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
     if (size > 512) {
         return 0;
diff --git a/fuzz/oss_fuzz/FuzzRegionSetPath.cpp b/fuzz/oss_fuzz/FuzzRegionSetPath.cpp
index 8a4d43b..9e131c7 100644
--- a/fuzz/oss_fuzz/FuzzRegionSetPath.cpp
+++ b/fuzz/oss_fuzz/FuzzRegionSetPath.cpp
@@ -36,7 +36,8 @@
     }
 }
 
-#if defined(SK_BUILD_FOR_LIBFUZZER)
+// TODO(kjlubick): remove IS_FUZZING... after https://crrev.com/c/2410304 lands
+#if defined(SK_BUILD_FOR_LIBFUZZER) || defined(IS_FUZZING_WITH_LIBFUZZER)
 extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
     if (size > 512) {
         return 0;
diff --git a/fuzz/oss_fuzz/FuzzTextBlobDeserialize.cpp b/fuzz/oss_fuzz/FuzzTextBlobDeserialize.cpp
index ba8f9be..3ace654 100644
--- a/fuzz/oss_fuzz/FuzzTextBlobDeserialize.cpp
+++ b/fuzz/oss_fuzz/FuzzTextBlobDeserialize.cpp
@@ -27,7 +27,8 @@
     s->getCanvas()->drawTextBlob(tb, 200, 200, SkPaint());
 }
 
-#if defined(SK_BUILD_FOR_LIBFUZZER)
+// TODO(kjlubick): remove IS_FUZZING... after https://crrev.com/c/2410304 lands
+#if defined(SK_BUILD_FOR_LIBFUZZER) || defined(IS_FUZZING_WITH_LIBFUZZER)
 extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
     if (size > 1024) {
         return 0;