summaryrefslogtreecommitdiff
path: root/media
diff options
context:
space:
mode:
authorJob Bautista <jobbautista9@protonmail.com>2022-12-24 10:42:27 +0800
committerJob Bautista <jobbautista9@protonmail.com>2022-12-24 10:42:27 +0800
commitcfc61b4c5d3de7b4a92545925c609a70feb4ac77 (patch)
tree308629bf3090aba88eaf73452af1dde5da9516ba /media
parentfc4d64665f0e2cc1651062bac8738d96558e0e31 (diff)
downloaduxp-cfc61b4c5d3de7b4a92545925c609a70feb4ac77.tar.gz
Issue #2061 Follow-up: Export jxl/version.h.
Fixes building on Windows. I also decided to move the preprocessed jxl/version.h to our include/jxl instead of relying on moz.build in preprocessing the file. Future me should note to not forget to update the version number at that new file
Diffstat (limited to 'media')
-rw-r--r--media/libjxl/include/jxl/version.h39
-rw-r--r--media/libjxl/moz.build5
2 files changed, 40 insertions, 4 deletions
diff --git a/media/libjxl/include/jxl/version.h b/media/libjxl/include/jxl/version.h
new file mode 100644
index 0000000000..9be7a2f5a4
--- /dev/null
+++ b/media/libjxl/include/jxl/version.h
@@ -0,0 +1,39 @@
+/* Copyright (c) the JPEG XL Project Authors. All rights reserved.
+ *
+ * Use of this source code is governed by a BSD-style
+ * license that can be found in the LICENSE file.
+ */
+
+/** @addtogroup libjxl_common
+ * @{
+ * @file version.h
+ * @brief libjxl version information
+ */
+
+#ifndef JXL_VERSION_H_
+#define JXL_VERSION_H_
+
+#define JPEGXL_MAJOR_VERSION 0 ///< JPEG XL Major version
+#define JPEGXL_MINOR_VERSION 7 ///< JPEG XL Minor version
+#define JPEGXL_PATCH_VERSION 0 ///< JPEG XL Patch version
+
+/** Can be used to conditionally compile code for a specific JXL version
+ * @param[maj] major version
+ * @param[min] minor version
+ *
+ * @code
+ * #if JPEGXL_NUMERIC_VERSION < JPEGXL_COMPUTE_NUMERIC_VERSION(0,8,0)
+ * // use old/deprecated api
+ * #else
+ * // use current api
+ * #endif
+ * @endcode
+ */
+#define JPEGXL_COMPUTE_NUMERIC_VERSION(major,minor,patch) ((major<<24) | (minor<<16) | (patch<<8) | 0)
+
+/* Numeric representation of the version */
+#define JPEGXL_NUMERIC_VERSION JPEGXL_COMPUTE_NUMERIC_VERSION(JPEGXL_MAJOR_VERSION,JPEGXL_MINOR_VERSION,JPEGXL_PATCH_VERSION)
+
+#endif /* JXL_VERSION_H_ */
+
+/** @}*/
diff --git a/media/libjxl/moz.build b/media/libjxl/moz.build
index d3e8c4a988..dca27a004c 100644
--- a/media/libjxl/moz.build
+++ b/media/libjxl/moz.build
@@ -106,13 +106,10 @@ SOURCES += [
"/media/libjxl/src/lib/threads/thread_parallel_runner_internal.cc",
]
-DEFINES["JPEGXL_MAJOR_VERSION"] = "0"
-DEFINES["JPEGXL_MINOR_VERSION"] = "7"
-DEFINES["JPEGXL_PATCH_VERSION"] = "0"
-
EXPORTS.jxl += [
"./include/jxl/jxl_export.h",
"./include/jxl/jxl_threads_export.h",
+ "./include/jxl/version.h",
"/media/libjxl/src/lib/include/jxl/butteraugli.h",
"/media/libjxl/src/lib/include/jxl/butteraugli_cxx.h",
"/media/libjxl/src/lib/include/jxl/cms_interface.h",