Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
godotengine
GitHub Repository: godotengine/godot
Path: blob/master/thirdparty/libjpeg-turbo/patches/0001-cmake-generated-headers.patch
21798 views
1
diff --git a/thirdparty/libjpeg-turbo/src/jconfig.h b/thirdparty/libjpeg-turbo/src/jconfig.h
2
new file mode 100644
3
index 0000000000..50e5986c69
4
--- /dev/null
5
+++ b/thirdparty/libjpeg-turbo/src/jconfig.h
6
@@ -0,0 +1,69 @@
7
+// Originally generated by libjpeg-turbo's cmake build, then modified to support multiple platforms.
8
+
9
+/* Version ID for the JPEG library.
10
+ * Might be useful for tests like "#if JPEG_LIB_VERSION >= 60".
11
+ */
12
+#define JPEG_LIB_VERSION 62
13
+
14
+/* libjpeg-turbo version */
15
+#define LIBJPEG_TURBO_VERSION 3.1.3
16
+
17
+/* libjpeg-turbo version in integer form */
18
+#define LIBJPEG_TURBO_VERSION_NUMBER 3001003
19
+
20
+/* Support arithmetic encoding when using 8-bit samples */
21
+#define C_ARITH_CODING_SUPPORTED 1
22
+
23
+/* Support arithmetic decoding when using 8-bit samples */
24
+#define D_ARITH_CODING_SUPPORTED 1
25
+
26
+/* Support in-memory source/destination managers */
27
+#define MEM_SRCDST_SUPPORTED 1
28
+
29
+/* Use accelerated SIMD routines when using 8-bit samples */
30
+// Godot: Disabled for simplicity of compiling the library cross-platform.
31
+// Could be enabled if it's confirmed to be worth the effort.
32
+//#define WITH_SIMD 1
33
+
34
+// Godot: Disable those as they're for forcing different SIMD CPU support
35
+// via environment variables, that's super niche and we don't build with SIMD.
36
+#define NO_GETENV
37
+#define NO_PUTENV
38
+
39
+/* This version of libjpeg-turbo supports run-time selection of data precision,
40
+ * so BITS_IN_JSAMPLE is no longer used to specify the data precision at build
41
+ * time. However, some downstream software expects the macro to be defined.
42
+ * Since 12-bit data precision is an opt-in feature that requires explicitly
43
+ * calling 12-bit-specific libjpeg API functions and using 12-bit-specific data
44
+ * types, the unmodified portion of the libjpeg API still behaves as if it were
45
+ * built for 8-bit precision, and JSAMPLE is still literally an 8-bit data
46
+ * type. Thus, it is correct to define BITS_IN_JSAMPLE to 8 here.
47
+ */
48
+#ifndef BITS_IN_JSAMPLE
49
+#define BITS_IN_JSAMPLE 8
50
+#endif
51
+
52
+#ifdef _WIN32
53
+
54
+#undef RIGHT_SHIFT_IS_UNSIGNED
55
+
56
+/* Define "boolean" as unsigned char, not int, per Windows custom */
57
+#ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */
58
+typedef unsigned char boolean;
59
+#endif
60
+#define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */
61
+
62
+/* Define "INT32" as int, not long, per Windows custom */
63
+#if !(defined(_BASETSD_H_) || defined(_BASETSD_H)) /* don't conflict if basetsd.h already read */
64
+typedef short INT16;
65
+typedef signed int INT32;
66
+#endif
67
+#define XMD_H /* prevent jmorecfg.h from redefining it */
68
+
69
+#else
70
+
71
+/* Define if your (broken) compiler shifts signed values as if they were
72
+ unsigned. */
73
+/* #undef RIGHT_SHIFT_IS_UNSIGNED */
74
+
75
+#endif
76
diff --git a/thirdparty/libjpeg-turbo/src/jconfigint.h b/thirdparty/libjpeg-turbo/src/jconfigint.h
77
new file mode 100644
78
index 0000000000..38acc75108
79
--- /dev/null
80
+++ b/thirdparty/libjpeg-turbo/src/jconfigint.h
81
@@ -0,0 +1,103 @@
82
+// Originally generated by libjpeg-turbo's cmake build, then modified to support multiple platforms.
83
+
84
+/* libjpeg-turbo build number */
85
+#define BUILD "Godot"
86
+
87
+/* How to hide global symbols. */
88
+#if defined(__GNUC__)
89
+#define HIDDEN __attribute__((visibility("hidden")))
90
+#else
91
+#define HIDDEN
92
+#endif
93
+
94
+/* How to obtain function inlining. */
95
+#if defined(_MSC_VER)
96
+#define INLINE __forceinline
97
+#elif defined(__GNUC__)
98
+#define INLINE __inline__ __attribute__((always_inline))
99
+#else
100
+#define INLINE inline
101
+#endif
102
+
103
+/* How to obtain thread-local storage */
104
+#if defined(_MSC_VER)
105
+#define THREAD_LOCAL __declspec(thread)
106
+#else
107
+#define THREAD_LOCAL __thread
108
+#endif
109
+
110
+/* Define to the full name of this package. */
111
+#define PACKAGE_NAME "libjpeg-turbo"
112
+
113
+/* Version number of package */
114
+#define VERSION "3.1.3"
115
+
116
+/* The size of `size_t', as computed by sizeof. */
117
+#if defined(__SIZEOF_SIZE_T__)
118
+ #define SIZEOF_SIZE_T __SIZEOF_SIZE_T__
119
+#elif defined(_WIN64)
120
+ #define SIZEOF_SIZE_T 8
121
+#elif defined(_WIN32)
122
+ #define SIZEOF_SIZE_T 4
123
+#else
124
+ #error "Cannot determine size of size_t"
125
+#endif
126
+
127
+/* Define if your compiler has __builtin_ctzl() and sizeof(unsigned long) == sizeof(size_t). */
128
+#if defined(__GNUC__)
129
+ #define HAVE_BUILTIN_CTZL
130
+#endif
131
+
132
+/* Define to 1 if you have the <intrin.h> header file. */
133
+#if defined(_MSC_VER)
134
+ #define HAVE_INTRIN_H
135
+#endif
136
+
137
+#if defined(_MSC_VER) && defined(HAVE_INTRIN_H)
138
+#if (SIZEOF_SIZE_T == 8)
139
+#define HAVE_BITSCANFORWARD64
140
+#elif (SIZEOF_SIZE_T == 4)
141
+#define HAVE_BITSCANFORWARD
142
+#endif
143
+#endif
144
+
145
+#if defined(__has_attribute)
146
+#if __has_attribute(fallthrough)
147
+#define FALLTHROUGH __attribute__((fallthrough));
148
+#else
149
+#define FALLTHROUGH
150
+#endif
151
+#else
152
+#define FALLTHROUGH
153
+#endif
154
+
155
+/*
156
+ * Define BITS_IN_JSAMPLE as either
157
+ * 8 for 8-bit sample values (the usual setting)
158
+ * 12 for 12-bit sample values
159
+ * Only 8 and 12 are legal data precisions for lossy JPEG according to the
160
+ * JPEG standard, and the IJG code does not support anything else!
161
+ */
162
+
163
+#ifndef BITS_IN_JSAMPLE
164
+#define BITS_IN_JSAMPLE 8 /* use 8 or 12 */
165
+#endif
166
+
167
+#undef C_ARITH_CODING_SUPPORTED
168
+#undef D_ARITH_CODING_SUPPORTED
169
+#undef WITH_SIMD
170
+
171
+#if BITS_IN_JSAMPLE == 8
172
+
173
+/* Support arithmetic encoding */
174
+#define C_ARITH_CODING_SUPPORTED 1
175
+
176
+/* Support arithmetic decoding */
177
+#define D_ARITH_CODING_SUPPORTED 1
178
+
179
+/* Use accelerated SIMD routines. */
180
+// Godot: Disabled for simplicity of compiling the library cross-platform.
181
+// Could be enabled if it's confirmed to be worth the effort.
182
+//#define WITH_SIMD 1
183
+
184
+#endif
185
diff --git a/thirdparty/libjpeg-turbo/src/jversion.h b/thirdparty/libjpeg-turbo/src/jversion.h
186
new file mode 100644
187
index 0000000000..40f7a6cc82
188
--- /dev/null
189
+++ b/thirdparty/libjpeg-turbo/src/jversion.h
190
@@ -0,0 +1,58 @@
191
+// Originally generated by libjpeg-turbo's cmake build, then modified to support multiple platforms.
192
+
193
+/*
194
+ * jversion.h
195
+ *
196
+ * This file was part of the Independent JPEG Group's software:
197
+ * Copyright (C) 1991-2020, Thomas G. Lane, Guido Vollbeding.
198
+ * libjpeg-turbo Modifications:
199
+ * Copyright (C) 2010, 2012-2024, D. R. Commander.
200
+ * For conditions of distribution and use, see the accompanying README.ijg
201
+ * file.
202
+ *
203
+ * This file contains software version identification.
204
+ */
205
+
206
+
207
+#if JPEG_LIB_VERSION >= 80
208
+
209
+#define JVERSION "8d 15-Jan-2012"
210
+
211
+#elif JPEG_LIB_VERSION >= 70
212
+
213
+#define JVERSION "7 27-Jun-2009"
214
+
215
+#else
216
+
217
+#define JVERSION "6b 27-Mar-1998"
218
+
219
+#endif
220
+
221
+/*
222
+ * NOTE: It is our convention to place the authors in the following order:
223
+ * - libjpeg-turbo authors (2009-) in descending order of the date of their
224
+ * most recent contribution to the project, then in ascending order of the
225
+ * date of their first contribution to the project, then in alphabetical
226
+ * order
227
+ * - Upstream authors in descending order of the date of the first inclusion of
228
+ * their code
229
+ */
230
+
231
+#define JCOPYRIGHT1 \
232
+ "Copyright (C) 2009-2024 D. R. Commander\n" \
233
+ "Copyright (C) 2015, 2020 Google, Inc.\n" \
234
+ "Copyright (C) 2019-2020 Arm Limited\n" \
235
+ "Copyright (C) 2015-2016, 2018 Matthieu Darbois\n" \
236
+ "Copyright (C) 2011-2016 Siarhei Siamashka\n" \
237
+ "Copyright (C) 2015 Intel Corporation\n"
238
+#define JCOPYRIGHT2 \
239
+ "Copyright (C) 2013-2014 Linaro Limited\n" \
240
+ "Copyright (C) 2013-2014 MIPS Technologies, Inc.\n" \
241
+ "Copyright (C) 2009, 2012 Pierre Ossman for Cendio AB\n" \
242
+ "Copyright (C) 2009-2011 Nokia Corporation and/or its subsidiary(-ies)\n" \
243
+ "Copyright (C) 1999-2006 MIYASAKA Masaru\n" \
244
+ "Copyright (C) 1999 Ken Murchison\n" \
245
+ "Copyright (C) 1991-2020 Thomas G. Lane, Guido Vollbeding\n"
246
+
247
+#define JCOPYRIGHT_SHORT \
248
+ "Copyright (C) 1991-2024 The libjpeg-turbo Project and many others"
249
250