Make chromeconf.h use opt-out instead of opt-in.

Code in src.git generally shouldn't be depended on by clients outside
of src.git, so that we're able to atomically change it, and so that
we're able to test changes in src.git with the CQ.

See also discussion on https://chromium-review.googlesource.com/c/chromium/src/+/1648737

Prerequisite for https://chromium-review.googlesource.com/c/chromium/src/+/1715975

No behavior change for Chromium.

Bug: 961769
Change-Id: I69e873528afc2c735b8fa28090449daae43853bb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1718785
Commit-Queue: Nico Weber <thakis@chromium.org>
Reviewed-by: Adenilson Cavalcanti <cavalcantii@chromium.org>
Auto-Submit: Nico Weber <thakis@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#680934}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 8efa4bab6c481bb52ca2ae9f53fab2d9734f2f6e
diff --git a/patches/0000-build.patch b/patches/0000-build.patch
index c27111d..b7c5996 100644
--- a/patches/0000-build.patch
+++ b/patches/0000-build.patch
@@ -149,9 +149,17 @@
  #ifndef ZCONF_H
  #define ZCONF_H
  
++/*
++ * This library is also built as a part of AOSP, which does not need to include
++ * chromeconf.h. This config does not want chromeconf.h, so it can set this
++ * macro to opt out. While this works today, there's no guarantee that building
++ * zlib outside of Chromium keeps working in the future.
++ */
++#if !defined(CHROMIUM_ZLIB_NO_CHROMECONF)
 +/* This include does prefixing as below, but with an updated set of names.  Also
 + * sets up export macros in component builds. */
 +#include "chromeconf.h"
++#endif
 +
  /*
   * If you *really* need a unique prefix for all types and library functions,
diff --git a/zconf.h b/zconf.h
index 1664387..2d1d03f 100644
--- a/zconf.h
+++ b/zconf.h
@@ -10,9 +10,11 @@
 
 /*
  * This library is also built as a part of AOSP, which does not need to include
- * chromeconf.h. In that case, neither of these macros will be defined.
+ * chromeconf.h. This config does not want chromeconf.h, so it can set this
+ * macro to opt out. While this works today, there's no guarantee that building
+ * zlib outside of Chromium keeps working in the future.
  */
-#if defined(CHROMIUM_BUILD) || defined(GOOGLE_CHROME_BUILD)
+#if !defined(CHROMIUM_ZLIB_NO_CHROMECONF)
 /* This include does prefixing as below, but with an updated set of names.  Also
  * sets up export macros in component builds. */
 #include "chromeconf.h"