Files
godot/thirdparty/libjpeg-turbo/patches/0001-cmake-generated-headers.patch
2025-12-12 18:49:20 +01:00

269 lines
8.6 KiB
Diff

diff --git a/thirdparty/libjpeg-turbo/src/jconfig.h b/thirdparty/libjpeg-turbo/src/jconfig.h
new file mode 100644
index 0000000000..42d9654c0f
--- /dev/null
+++ b/thirdparty/libjpeg-turbo/src/jconfig.h
@@ -0,0 +1,62 @@
+// Originally generated by libjpeg-turbo's cmake build, then modified to support multiple platforms.
+
+/* Version ID for the JPEG library.
+ * Might be useful for tests like "#if JPEG_LIB_VERSION >= 60".
+ */
+#define JPEG_LIB_VERSION 62
+
+/* libjpeg-turbo version */
+#define LIBJPEG_TURBO_VERSION 3.1.0
+
+/* libjpeg-turbo version in integer form */
+#define LIBJPEG_TURBO_VERSION_NUMBER 3001000
+
+/* Support arithmetic encoding when using 8-bit samples */
+#define C_ARITH_CODING_SUPPORTED 1
+
+/* Support arithmetic decoding when using 8-bit samples */
+#define D_ARITH_CODING_SUPPORTED 1
+
+/* Support in-memory source/destination managers */
+#define MEM_SRCDST_SUPPORTED 1
+
+/* Use accelerated SIMD routines when using 8-bit samples */
+//#define WITH_SIMD 1
+
+/* This version of libjpeg-turbo supports run-time selection of data precision,
+ * so BITS_IN_JSAMPLE is no longer used to specify the data precision at build
+ * time. However, some downstream software expects the macro to be defined.
+ * Since 12-bit data precision is an opt-in feature that requires explicitly
+ * calling 12-bit-specific libjpeg API functions and using 12-bit-specific data
+ * types, the unmodified portion of the libjpeg API still behaves as if it were
+ * built for 8-bit precision, and JSAMPLE is still literally an 8-bit data
+ * type. Thus, it is correct to define BITS_IN_JSAMPLE to 8 here.
+ */
+#ifndef BITS_IN_JSAMPLE
+#define BITS_IN_JSAMPLE 8
+#endif
+
+#ifdef _WIN32
+
+#undef RIGHT_SHIFT_IS_UNSIGNED
+
+/* Define "boolean" as unsigned char, not int, per Windows custom */
+#ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */
+typedef unsigned char boolean;
+#endif
+#define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */
+
+/* Define "INT32" as int, not long, per Windows custom */
+#if !(defined(_BASETSD_H_) || defined(_BASETSD_H)) /* don't conflict if basetsd.h already read */
+typedef short INT16;
+typedef signed int INT32;
+#endif
+#define XMD_H /* prevent jmorecfg.h from redefining it */
+
+#else
+
+/* Define if your (broken) compiler shifts signed values as if they were
+ unsigned. */
+/* #undef RIGHT_SHIFT_IS_UNSIGNED */
+
+#endif
diff --git a/thirdparty/libjpeg-turbo/src/jconfigint.h b/thirdparty/libjpeg-turbo/src/jconfigint.h
new file mode 100644
index 0000000000..45bd3ec321
--- /dev/null
+++ b/thirdparty/libjpeg-turbo/src/jconfigint.h
@@ -0,0 +1,102 @@
+// Originally generated by libjpeg-turbo's cmake build, then modified to support multiple platforms.
+
+/* libjpeg-turbo build number */
+#define BUILD "20250317"
+
+/* How to hide global symbols. */
+#ifndef HIDDEN
+ #if defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__MINGW32__)
+ #define HIDDEN __attribute__((visibility("hidden")))
+ #else
+ #define HIDDEN
+ #endif
+#endif
+
+/* Compiler's inline keyword */
+#undef inline
+
+/* How to obtain function inlining. */
+#if defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__MINGW32__)
+ #define INLINE __inline__ __attribute__((always_inline))
+#else
+ #define INLINE inline
+#endif
+
+/* How to obtain thread-local storage */
+#if defined(_MSC_VER)
+#define THREAD_LOCAL __declspec(thread)
+#else
+#define THREAD_LOCAL __thread
+#endif
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "libjpeg-turbo"
+
+/* Version number of package */
+#define VERSION "3.1.0"
+
+/* The size of `size_t', as computed by sizeof. */
+#if defined(__SIZEOF_SIZE_T__)
+ #define SIZEOF_SIZE_T __SIZEOF_SIZE_T__
+#elif defined(_WIN64)
+ #define SIZEOF_SIZE_T 8
+#elif defined(_WIN32)
+ #define SIZEOF_SIZE_T 4
+#else
+ #error "Cannot determine size of size_t"
+#endif
+
+/* Define if your compiler has __builtin_ctzl() and sizeof(unsigned long) == sizeof(size_t). */
+#if defined(__GNUC__)
+ #define HAVE_BUILTIN_CTZL
+#endif
+
+/* Define to 1 if you have the <intrin.h> header file. */
+/* #undef HAVE_INTRIN_H */
+
+#if defined(_MSC_VER) && defined(HAVE_INTRIN_H)
+#if (SIZEOF_SIZE_T == 8)
+#define HAVE_BITSCANFORWARD64
+#elif (SIZEOF_SIZE_T == 4)
+#define HAVE_BITSCANFORWARD
+#endif
+#endif
+
+#if defined(__has_attribute)
+#if __has_attribute(fallthrough)
+#define FALLTHROUGH __attribute__((fallthrough));
+#else
+#define FALLTHROUGH
+#endif
+#else
+#define FALLTHROUGH
+#endif
+
+/*
+ * Define BITS_IN_JSAMPLE as either
+ * 8 for 8-bit sample values (the usual setting)
+ * 12 for 12-bit sample values
+ * Only 8 and 12 are legal data precisions for lossy JPEG according to the
+ * JPEG standard, and the IJG code does not support anything else!
+ */
+
+#ifndef BITS_IN_JSAMPLE
+#define BITS_IN_JSAMPLE 8 /* use 8 or 12 */
+#endif
+
+#undef C_ARITH_CODING_SUPPORTED
+#undef D_ARITH_CODING_SUPPORTED
+#undef WITH_SIMD
+
+#if BITS_IN_JSAMPLE == 8
+
+/* Support arithmetic encoding */
+#define C_ARITH_CODING_SUPPORTED 1
+
+/* Support arithmetic decoding */
+#define D_ARITH_CODING_SUPPORTED 1
+
+/* Use accelerated SIMD routines. */
+//#define WITH_SIMD 1
+
+#endif
diff --git a/thirdparty/libjpeg-turbo/src/jmorecfg.h b/thirdparty/libjpeg-turbo/src/jmorecfg.h
index 89c7842c87..c96edd2300 100644
--- a/thirdparty/libjpeg-turbo/src/jmorecfg.h
+++ b/thirdparty/libjpeg-turbo/src/jmorecfg.h
@@ -1,3 +1,5 @@
+// Modified to remove lossless jpeg support.
+
/*
* jmorecfg.h
*
@@ -242,7 +244,7 @@ typedef int boolean;
#define C_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */
#define C_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/
-#define C_LOSSLESS_SUPPORTED /* Lossless JPEG? */
+//#define C_LOSSLESS_SUPPORTED /* Lossless JPEG? */
#define ENTROPY_OPT_SUPPORTED /* Optimization of entropy coding parms? */
/* Note: if you selected 12-bit data precision, it is dangerous to turn off
* ENTROPY_OPT_SUPPORTED. The standard Huffman tables are only good for 8-bit
@@ -259,7 +261,7 @@ typedef int boolean;
#define D_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */
#define D_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/
-#define D_LOSSLESS_SUPPORTED /* Lossless JPEG? */
+//#define D_LOSSLESS_SUPPORTED /* Lossless JPEG? */
#define SAVE_MARKERS_SUPPORTED /* jpeg_save_markers() needed? */
#define BLOCK_SMOOTHING_SUPPORTED /* Block smoothing? (Progressive only) */
#define IDCT_SCALING_SUPPORTED /* Output rescaling via IDCT? */
diff --git a/thirdparty/libjpeg-turbo/src/jversion.h b/thirdparty/libjpeg-turbo/src/jversion.h
new file mode 100644
index 0000000000..40f7a6cc82
--- /dev/null
+++ b/thirdparty/libjpeg-turbo/src/jversion.h
@@ -0,0 +1,58 @@
+// Originally generated by libjpeg-turbo's cmake build, then modified to support multiple platforms.
+
+/*
+ * jversion.h
+ *
+ * This file was part of the Independent JPEG Group's software:
+ * Copyright (C) 1991-2020, Thomas G. Lane, Guido Vollbeding.
+ * libjpeg-turbo Modifications:
+ * Copyright (C) 2010, 2012-2024, D. R. Commander.
+ * For conditions of distribution and use, see the accompanying README.ijg
+ * file.
+ *
+ * This file contains software version identification.
+ */
+
+
+#if JPEG_LIB_VERSION >= 80
+
+#define JVERSION "8d 15-Jan-2012"
+
+#elif JPEG_LIB_VERSION >= 70
+
+#define JVERSION "7 27-Jun-2009"
+
+#else
+
+#define JVERSION "6b 27-Mar-1998"
+
+#endif
+
+/*
+ * NOTE: It is our convention to place the authors in the following order:
+ * - libjpeg-turbo authors (2009-) in descending order of the date of their
+ * most recent contribution to the project, then in ascending order of the
+ * date of their first contribution to the project, then in alphabetical
+ * order
+ * - Upstream authors in descending order of the date of the first inclusion of
+ * their code
+ */
+
+#define JCOPYRIGHT1 \
+ "Copyright (C) 2009-2024 D. R. Commander\n" \
+ "Copyright (C) 2015, 2020 Google, Inc.\n" \
+ "Copyright (C) 2019-2020 Arm Limited\n" \
+ "Copyright (C) 2015-2016, 2018 Matthieu Darbois\n" \
+ "Copyright (C) 2011-2016 Siarhei Siamashka\n" \
+ "Copyright (C) 2015 Intel Corporation\n"
+#define JCOPYRIGHT2 \
+ "Copyright (C) 2013-2014 Linaro Limited\n" \
+ "Copyright (C) 2013-2014 MIPS Technologies, Inc.\n" \
+ "Copyright (C) 2009, 2012 Pierre Ossman for Cendio AB\n" \
+ "Copyright (C) 2009-2011 Nokia Corporation and/or its subsidiary(-ies)\n" \
+ "Copyright (C) 1999-2006 MIYASAKA Masaru\n" \
+ "Copyright (C) 1999 Ken Murchison\n" \
+ "Copyright (C) 1991-2020 Thomas G. Lane, Guido Vollbeding\n"
+
+#define JCOPYRIGHT_SHORT \
+ "Copyright (C) 1991-2024 The libjpeg-turbo Project and many others"