Do not build opj_clock.c from OpenJPEG.

This code is not used in PDFium.

Change-Id: I64ecea04d6682340cdaa49f946c5e4386d10bd5c
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/90752
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/third_party/BUILD.gn b/third_party/BUILD.gn
index 6a8ec10..4ff6de5 100644
--- a/third_party/BUILD.gn
+++ b/third_party/BUILD.gn
@@ -406,7 +406,7 @@
     "libopenjpeg20/mct.c",
     "libopenjpeg20/mqc.c",
     "libopenjpeg20/openjpeg.c",
-    "libopenjpeg20/opj_clock.c",
+    # NOTE: libopenjpeg20/opj_clock.c is not used.
     "libopenjpeg20/opj_malloc.cc",
     "libopenjpeg20/opj_malloc.h",
     "libopenjpeg20/pi.c",
diff --git a/third_party/libopenjpeg20/0041-remove_opj_clock.patch b/third_party/libopenjpeg20/0041-remove_opj_clock.patch
new file mode 100644
index 0000000..02622f4
--- /dev/null
+++ b/third_party/libopenjpeg20/0041-remove_opj_clock.patch
@@ -0,0 +1,12 @@
+diff --git a/third_party/libopenjpeg20/opj_includes.h b/third_party/libopenjpeg20/opj_includes.h
+index 0a8628c96..43c00a556 100644
+--- a/third_party/libopenjpeg20/opj_includes.h
++++ b/third_party/libopenjpeg20/opj_includes.h
+@@ -219,7 +219,6 @@ typedef unsigned int OPJ_BITFIELD;
+ #define OPJ_UNUSED(x) (void)x
+ 
+ #include "opj_inttypes.h"
+-#include "opj_clock.h"
+ #include "opj_malloc.h"
+ #include "event.h"
+ #include "function_list.h"
diff --git a/third_party/libopenjpeg20/README.pdfium b/third_party/libopenjpeg20/README.pdfium
index ce299ea..30bbd34 100644
--- a/third_party/libopenjpeg20/README.pdfium
+++ b/third_party/libopenjpeg20/README.pdfium
@@ -29,3 +29,4 @@
 0035-opj_image_data_free.patch: Use the right free function in opj_jp2_apply_pclr.
 0039-opj_mqc_renorme.patch: Remove unused opj_mqc_renorme().
 0040-dwt_overflows.patch: Avoid integer overflows in DWT.
+0041-remove_opj_clock.patch: Remove unused opj_clock.h include.
diff --git a/third_party/libopenjpeg20/opj_includes.h b/third_party/libopenjpeg20/opj_includes.h
index 0a8628c..43c00a5 100644
--- a/third_party/libopenjpeg20/opj_includes.h
+++ b/third_party/libopenjpeg20/opj_includes.h
@@ -219,7 +219,6 @@
 #define OPJ_UNUSED(x) (void)x
 
 #include "opj_inttypes.h"
-#include "opj_clock.h"
 #include "opj_malloc.h"
 #include "event.h"
 #include "function_list.h"