Path: blob/master/thirdparty/libjpeg-turbo/patches/0001-cmake-generated-headers.patch
21798 views
diff --git a/thirdparty/libjpeg-turbo/src/jconfig.h b/thirdparty/libjpeg-turbo/src/jconfig.h1new file mode 1006442index 0000000000..50e5986c693--- /dev/null4+++ b/thirdparty/libjpeg-turbo/src/jconfig.h5@@ -0,0 +1,69 @@6+// Originally generated by libjpeg-turbo's cmake build, then modified to support multiple platforms.7+8+/* Version ID for the JPEG library.9+ * Might be useful for tests like "#if JPEG_LIB_VERSION >= 60".10+ */11+#define JPEG_LIB_VERSION 6212+13+/* libjpeg-turbo version */14+#define LIBJPEG_TURBO_VERSION 3.1.315+16+/* libjpeg-turbo version in integer form */17+#define LIBJPEG_TURBO_VERSION_NUMBER 300100318+19+/* Support arithmetic encoding when using 8-bit samples */20+#define C_ARITH_CODING_SUPPORTED 121+22+/* Support arithmetic decoding when using 8-bit samples */23+#define D_ARITH_CODING_SUPPORTED 124+25+/* Support in-memory source/destination managers */26+#define MEM_SRCDST_SUPPORTED 127+28+/* Use accelerated SIMD routines when using 8-bit samples */29+// Godot: Disabled for simplicity of compiling the library cross-platform.30+// Could be enabled if it's confirmed to be worth the effort.31+//#define WITH_SIMD 132+33+// Godot: Disable those as they're for forcing different SIMD CPU support34+// via environment variables, that's super niche and we don't build with SIMD.35+#define NO_GETENV36+#define NO_PUTENV37+38+/* This version of libjpeg-turbo supports run-time selection of data precision,39+ * so BITS_IN_JSAMPLE is no longer used to specify the data precision at build40+ * time. However, some downstream software expects the macro to be defined.41+ * Since 12-bit data precision is an opt-in feature that requires explicitly42+ * calling 12-bit-specific libjpeg API functions and using 12-bit-specific data43+ * types, the unmodified portion of the libjpeg API still behaves as if it were44+ * built for 8-bit precision, and JSAMPLE is still literally an 8-bit data45+ * type. Thus, it is correct to define BITS_IN_JSAMPLE to 8 here.46+ */47+#ifndef BITS_IN_JSAMPLE48+#define BITS_IN_JSAMPLE 849+#endif50+51+#ifdef _WIN3252+53+#undef RIGHT_SHIFT_IS_UNSIGNED54+55+/* Define "boolean" as unsigned char, not int, per Windows custom */56+#ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */57+typedef unsigned char boolean;58+#endif59+#define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */60+61+/* Define "INT32" as int, not long, per Windows custom */62+#if !(defined(_BASETSD_H_) || defined(_BASETSD_H)) /* don't conflict if basetsd.h already read */63+typedef short INT16;64+typedef signed int INT32;65+#endif66+#define XMD_H /* prevent jmorecfg.h from redefining it */67+68+#else69+70+/* Define if your (broken) compiler shifts signed values as if they were71+ unsigned. */72+/* #undef RIGHT_SHIFT_IS_UNSIGNED */73+74+#endif75diff --git a/thirdparty/libjpeg-turbo/src/jconfigint.h b/thirdparty/libjpeg-turbo/src/jconfigint.h76new file mode 10064477index 0000000000..38acc7510878--- /dev/null79+++ b/thirdparty/libjpeg-turbo/src/jconfigint.h80@@ -0,0 +1,103 @@81+// Originally generated by libjpeg-turbo's cmake build, then modified to support multiple platforms.82+83+/* libjpeg-turbo build number */84+#define BUILD "Godot"85+86+/* How to hide global symbols. */87+#if defined(__GNUC__)88+#define HIDDEN __attribute__((visibility("hidden")))89+#else90+#define HIDDEN91+#endif92+93+/* How to obtain function inlining. */94+#if defined(_MSC_VER)95+#define INLINE __forceinline96+#elif defined(__GNUC__)97+#define INLINE __inline__ __attribute__((always_inline))98+#else99+#define INLINE inline100+#endif101+102+/* How to obtain thread-local storage */103+#if defined(_MSC_VER)104+#define THREAD_LOCAL __declspec(thread)105+#else106+#define THREAD_LOCAL __thread107+#endif108+109+/* Define to the full name of this package. */110+#define PACKAGE_NAME "libjpeg-turbo"111+112+/* Version number of package */113+#define VERSION "3.1.3"114+115+/* The size of `size_t', as computed by sizeof. */116+#if defined(__SIZEOF_SIZE_T__)117+ #define SIZEOF_SIZE_T __SIZEOF_SIZE_T__118+#elif defined(_WIN64)119+ #define SIZEOF_SIZE_T 8120+#elif defined(_WIN32)121+ #define SIZEOF_SIZE_T 4122+#else123+ #error "Cannot determine size of size_t"124+#endif125+126+/* Define if your compiler has __builtin_ctzl() and sizeof(unsigned long) == sizeof(size_t). */127+#if defined(__GNUC__)128+ #define HAVE_BUILTIN_CTZL129+#endif130+131+/* Define to 1 if you have the <intrin.h> header file. */132+#if defined(_MSC_VER)133+ #define HAVE_INTRIN_H134+#endif135+136+#if defined(_MSC_VER) && defined(HAVE_INTRIN_H)137+#if (SIZEOF_SIZE_T == 8)138+#define HAVE_BITSCANFORWARD64139+#elif (SIZEOF_SIZE_T == 4)140+#define HAVE_BITSCANFORWARD141+#endif142+#endif143+144+#if defined(__has_attribute)145+#if __has_attribute(fallthrough)146+#define FALLTHROUGH __attribute__((fallthrough));147+#else148+#define FALLTHROUGH149+#endif150+#else151+#define FALLTHROUGH152+#endif153+154+/*155+ * Define BITS_IN_JSAMPLE as either156+ * 8 for 8-bit sample values (the usual setting)157+ * 12 for 12-bit sample values158+ * Only 8 and 12 are legal data precisions for lossy JPEG according to the159+ * JPEG standard, and the IJG code does not support anything else!160+ */161+162+#ifndef BITS_IN_JSAMPLE163+#define BITS_IN_JSAMPLE 8 /* use 8 or 12 */164+#endif165+166+#undef C_ARITH_CODING_SUPPORTED167+#undef D_ARITH_CODING_SUPPORTED168+#undef WITH_SIMD169+170+#if BITS_IN_JSAMPLE == 8171+172+/* Support arithmetic encoding */173+#define C_ARITH_CODING_SUPPORTED 1174+175+/* Support arithmetic decoding */176+#define D_ARITH_CODING_SUPPORTED 1177+178+/* Use accelerated SIMD routines. */179+// Godot: Disabled for simplicity of compiling the library cross-platform.180+// Could be enabled if it's confirmed to be worth the effort.181+//#define WITH_SIMD 1182+183+#endif184diff --git a/thirdparty/libjpeg-turbo/src/jversion.h b/thirdparty/libjpeg-turbo/src/jversion.h185new file mode 100644186index 0000000000..40f7a6cc82187--- /dev/null188+++ b/thirdparty/libjpeg-turbo/src/jversion.h189@@ -0,0 +1,58 @@190+// Originally generated by libjpeg-turbo's cmake build, then modified to support multiple platforms.191+192+/*193+ * jversion.h194+ *195+ * This file was part of the Independent JPEG Group's software:196+ * Copyright (C) 1991-2020, Thomas G. Lane, Guido Vollbeding.197+ * libjpeg-turbo Modifications:198+ * Copyright (C) 2010, 2012-2024, D. R. Commander.199+ * For conditions of distribution and use, see the accompanying README.ijg200+ * file.201+ *202+ * This file contains software version identification.203+ */204+205+206+#if JPEG_LIB_VERSION >= 80207+208+#define JVERSION "8d 15-Jan-2012"209+210+#elif JPEG_LIB_VERSION >= 70211+212+#define JVERSION "7 27-Jun-2009"213+214+#else215+216+#define JVERSION "6b 27-Mar-1998"217+218+#endif219+220+/*221+ * NOTE: It is our convention to place the authors in the following order:222+ * - libjpeg-turbo authors (2009-) in descending order of the date of their223+ * most recent contribution to the project, then in ascending order of the224+ * date of their first contribution to the project, then in alphabetical225+ * order226+ * - Upstream authors in descending order of the date of the first inclusion of227+ * their code228+ */229+230+#define JCOPYRIGHT1 \231+ "Copyright (C) 2009-2024 D. R. Commander\n" \232+ "Copyright (C) 2015, 2020 Google, Inc.\n" \233+ "Copyright (C) 2019-2020 Arm Limited\n" \234+ "Copyright (C) 2015-2016, 2018 Matthieu Darbois\n" \235+ "Copyright (C) 2011-2016 Siarhei Siamashka\n" \236+ "Copyright (C) 2015 Intel Corporation\n"237+#define JCOPYRIGHT2 \238+ "Copyright (C) 2013-2014 Linaro Limited\n" \239+ "Copyright (C) 2013-2014 MIPS Technologies, Inc.\n" \240+ "Copyright (C) 2009, 2012 Pierre Ossman for Cendio AB\n" \241+ "Copyright (C) 2009-2011 Nokia Corporation and/or its subsidiary(-ies)\n" \242+ "Copyright (C) 1999-2006 MIYASAKA Masaru\n" \243+ "Copyright (C) 1999 Ken Murchison\n" \244+ "Copyright (C) 1991-2020 Thomas G. Lane, Guido Vollbeding\n"245+246+#define JCOPYRIGHT_SHORT \247+ "Copyright (C) 1991-2024 The libjpeg-turbo Project and many others"248249250