mirror of
https://github.com/GerbilSoft/rom-properties.git
synced 2025-06-18 19:45:41 -04:00
Compare commits
330 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
19e50372da | ||
![]() |
37dcb72e6b | ||
![]() |
2613201bb3 | ||
![]() |
aeb568dda3 | ||
![]() |
a138b123e3 | ||
![]() |
4badcf4bfb | ||
![]() |
b0d5e05cce | ||
![]() |
523de9913c | ||
![]() |
f0ee7bee10 | ||
![]() |
c3643b9244 | ||
![]() |
72b628d8ba | ||
![]() |
933b3d2f4e | ||
![]() |
eee8b83f9a | ||
![]() |
b19f128903 | ||
![]() |
73eb28c4ee | ||
![]() |
e5c512ca92 | ||
![]() |
1da1c39c18 | ||
![]() |
da852e5d50 | ||
![]() |
f157be4a97 | ||
![]() |
a19815f744 | ||
![]() |
a5554fd244 | ||
![]() |
0c512deed6 | ||
![]() |
704a5eead5 | ||
![]() |
783d384b04 | ||
![]() |
9ca7daf9c8 | ||
![]() |
c31919826b | ||
![]() |
bf2d3af7c3 | ||
![]() |
e2eede76f7 | ||
![]() |
e12bb51b47 | ||
![]() |
417825cd6f | ||
![]() |
da94256a37 | ||
![]() |
222f2456fd | ||
![]() |
11da731ef7 | ||
![]() |
a4efadbc56 | ||
![]() |
0e1a5ce237 | ||
![]() |
d557b607c2 | ||
![]() |
1897ac198f | ||
![]() |
5083161c23 | ||
![]() |
22da0c2e21 | ||
![]() |
8f762b7c78 | ||
![]() |
acdf3544e1 | ||
![]() |
bb2e0b5e87 | ||
![]() |
65a3855b98 | ||
![]() |
847342306a | ||
![]() |
3fdd98929d | ||
![]() |
41765be492 | ||
![]() |
4342ce8a1b | ||
![]() |
6e7d57282f | ||
![]() |
3f1f92b18a | ||
![]() |
a5d22511e0 | ||
![]() |
618c7c6a8d | ||
![]() |
9a4ab48ccb | ||
![]() |
64fe76a285 | ||
![]() |
993e52084d | ||
![]() |
55cad0ad98 | ||
![]() |
93e78417e0 | ||
![]() |
453461e8fb | ||
![]() |
f5be3c81a4 | ||
![]() |
9994c2df94 | ||
![]() |
6026b40df5 | ||
![]() |
409915591d | ||
![]() |
8c5888e9e5 | ||
![]() |
d0fb8dc73e | ||
![]() |
a837c883ee | ||
![]() |
44ad904c71 | ||
![]() |
b3b6eb5b37 | ||
![]() |
95bcbc25fb | ||
![]() |
821155bd83 | ||
![]() |
e765792ebb | ||
![]() |
194b3dcf61 | ||
![]() |
8378697be1 | ||
![]() |
1caf44d15e | ||
![]() |
fbdeae25a5 | ||
![]() |
de802835f7 | ||
![]() |
1c96133917 | ||
![]() |
d01201a184 | ||
![]() |
f6e5229b72 | ||
![]() |
fe85d93fc3 | ||
![]() |
7edb6df2e4 | ||
![]() |
eb5300413b | ||
![]() |
37dd0c3ffe | ||
![]() |
af2c512181 | ||
![]() |
b02a2b8009 | ||
![]() |
081d4a4b87 | ||
![]() |
776998d0ed | ||
![]() |
e84ccfd53d | ||
![]() |
e2f0b41964 | ||
![]() |
c65ea8c0ed | ||
![]() |
988df314e6 | ||
![]() |
a49fb884f1 | ||
![]() |
c7ccd7a39a | ||
![]() |
6b30dd5b70 | ||
![]() |
5ed38edbec | ||
![]() |
b884747254 | ||
![]() |
1aad707f88 | ||
![]() |
5fd65dc7e2 | ||
![]() |
50ae166484 | ||
![]() |
6577715f73 | ||
![]() |
2c17a8e727 | ||
![]() |
cff7086b3d | ||
![]() |
981c173142 | ||
![]() |
df719e959a | ||
![]() |
3af7964b0c | ||
![]() |
723712102a | ||
![]() |
3416f16ad2 | ||
![]() |
3db391e8c1 | ||
![]() |
4ab931b127 | ||
![]() |
e1ef6e6d2f | ||
![]() |
e9625cb876 | ||
![]() |
79c3a2e34d | ||
![]() |
8650f2b1c2 | ||
![]() |
e2f4ddde72 | ||
![]() |
88a9a603ce | ||
![]() |
60b18c408f | ||
![]() |
ed799a1cc2 | ||
![]() |
407fb36461 | ||
![]() |
55fac18b76 | ||
![]() |
440bb7aeb5 | ||
![]() |
c0c8b2582c | ||
![]() |
7e51a47609 | ||
![]() |
b72bd8a436 | ||
![]() |
7d6c7064d2 | ||
![]() |
065c86149a | ||
![]() |
32ac318236 | ||
![]() |
5de651dbbe | ||
![]() |
34f76050cb | ||
![]() |
223cee6c9c | ||
![]() |
fc44e1da01 | ||
![]() |
7c96eb5381 | ||
![]() |
54a7b12523 | ||
![]() |
443df8a7ab | ||
![]() |
86638f478c | ||
![]() |
55cb219a17 | ||
![]() |
05f08c2d32 | ||
![]() |
8e841026e9 | ||
![]() |
46c83d92c1 | ||
![]() |
44eba93a3e | ||
![]() |
ade40a4965 | ||
![]() |
0f2eccd3ac | ||
![]() |
99942e6a04 | ||
![]() |
1912c62551 | ||
![]() |
43a7bd4a49 | ||
![]() |
665a9f878c | ||
![]() |
94470e319a | ||
![]() |
9a5550f1f5 | ||
![]() |
f13bde810f | ||
![]() |
f6d9394da8 | ||
![]() |
a83c05459d | ||
![]() |
18b7ec55d3 | ||
![]() |
53648f1ffa | ||
![]() |
03df42456c | ||
![]() |
d241d33537 | ||
![]() |
e495796ee8 | ||
![]() |
e81f24cc39 | ||
![]() |
381980d13e | ||
![]() |
23f71c4f9c | ||
![]() |
78da45fb5d | ||
![]() |
f2c3b6c5ba | ||
![]() |
d5ede2ee5b | ||
![]() |
23c473e5e3 | ||
![]() |
1f856117ec | ||
![]() |
3efdc825d9 | ||
![]() |
611fea3782 | ||
![]() |
44608520b8 | ||
![]() |
0328879a01 | ||
![]() |
53b74e0467 | ||
![]() |
c632a35c62 | ||
![]() |
1f246e4ff6 | ||
![]() |
f5334daa78 | ||
![]() |
9d50275042 | ||
![]() |
8c00596598 | ||
![]() |
7efa014ba8 | ||
![]() |
3d0fd3627b | ||
![]() |
9e2aff3d1a | ||
![]() |
05e95ec9a8 | ||
![]() |
4a85bc7be4 | ||
![]() |
ae3dd69c78 | ||
![]() |
b32ddb101e | ||
![]() |
d58918f101 | ||
![]() |
25c5aa02cc | ||
![]() |
29aa2dacc9 | ||
![]() |
10785d08fb | ||
![]() |
c66cd83539 | ||
![]() |
425f5a77e4 | ||
![]() |
050380db45 | ||
![]() |
b4ba027439 | ||
![]() |
66e75f5a40 | ||
![]() |
e804c1236f | ||
![]() |
91e4a39eb1 | ||
![]() |
cbbe2e1a3d | ||
![]() |
85e9ca4fad | ||
![]() |
a077d26d67 | ||
![]() |
c706f7ba9b | ||
![]() |
e07a45be0e | ||
![]() |
45e049168e | ||
![]() |
6056d61f2c | ||
![]() |
21cc92b9c6 | ||
![]() |
594f379fe3 | ||
![]() |
4c944a2add | ||
![]() |
88b9552cca | ||
![]() |
6a425154a2 | ||
![]() |
dd75ff80ca | ||
![]() |
c9588a89f7 | ||
![]() |
147f9c745d | ||
![]() |
bca1c48b59 | ||
![]() |
ce01475b3d | ||
![]() |
2982457dcc | ||
![]() |
1e094fdb8e | ||
![]() |
1875c9da7e | ||
![]() |
b080caa4bf | ||
![]() |
9f03ee8d45 | ||
![]() |
d4b1693c49 | ||
![]() |
6f9f6b9cff | ||
![]() |
e9dcd3f131 | ||
![]() |
917f0a497a | ||
![]() |
6e80ad584a | ||
![]() |
836985e6ed | ||
![]() |
2386a99cf3 | ||
![]() |
ff63ed7ec9 | ||
![]() |
6213569763 | ||
![]() |
2566f1302a | ||
![]() |
d258332227 | ||
![]() |
20b994cc99 | ||
![]() |
59cb37c893 | ||
![]() |
3a318c5924 | ||
![]() |
94c69214e7 | ||
![]() |
bf61261b85 | ||
![]() |
b4a81e5410 | ||
![]() |
1a23dc8464 | ||
![]() |
365a7d5302 | ||
![]() |
fb032f03ea | ||
![]() |
16ad403a81 | ||
![]() |
397afc7166 | ||
![]() |
a7c119805f | ||
![]() |
191cbab172 | ||
![]() |
bd5b649bf3 | ||
![]() |
3e853a59da | ||
![]() |
1dc3609bc7 | ||
![]() |
b347c4fad6 | ||
![]() |
7d379f826d | ||
![]() |
3b8d47fa0b | ||
![]() |
91d51920df | ||
![]() |
21e692e9cf | ||
![]() |
faeca807bd | ||
![]() |
7726fc6dfd | ||
![]() |
de6252e2d4 | ||
![]() |
abee829b01 | ||
![]() |
dc2649beff | ||
![]() |
2be8490e97 | ||
![]() |
8d7f709f8b | ||
![]() |
62ef8c18f4 | ||
![]() |
eefaf5040d | ||
![]() |
81555db6b5 | ||
![]() |
64d66c038f | ||
![]() |
edd89a0b1c | ||
![]() |
02d7fbfdfa | ||
![]() |
48a98edc13 | ||
![]() |
755a28f910 | ||
![]() |
e5cc30dc03 | ||
![]() |
c175d25696 | ||
![]() |
d379fda1d3 | ||
![]() |
2e09b9ae3f | ||
![]() |
5a738f8277 | ||
![]() |
8e78811e8a | ||
![]() |
cb3ada3e88 | ||
![]() |
83b5dddfd5 | ||
![]() |
2934ccd46a | ||
![]() |
4a1287da34 | ||
![]() |
141048d453 | ||
![]() |
f044ef5559 | ||
![]() |
91d7fa8584 | ||
![]() |
740da2d882 | ||
![]() |
ca67d8c20d | ||
![]() |
aa6cbba46e | ||
![]() |
7990dd3364 | ||
![]() |
deb63624bc | ||
![]() |
9a799984a9 | ||
![]() |
0728d16649 | ||
![]() |
73bc840583 | ||
![]() |
953d80e483 | ||
![]() |
4a238c2f1e | ||
![]() |
166e773f3f | ||
![]() |
7273c8b658 | ||
![]() |
539bdcd2b3 | ||
![]() |
6cb4cbb503 | ||
![]() |
5cb7db18ea | ||
![]() |
2cd5fc45f4 | ||
![]() |
3f285b2762 | ||
![]() |
b1227d7699 | ||
![]() |
6a62448232 | ||
![]() |
ec7df32cda | ||
![]() |
f8d6e76510 | ||
![]() |
d29169b35c | ||
![]() |
a2a61e6141 | ||
![]() |
aa6f1aba07 | ||
![]() |
03d3400e27 | ||
![]() |
8e48fd28f1 | ||
![]() |
3bbe0f63c5 | ||
![]() |
bb5213ab60 | ||
![]() |
5a6309417c | ||
![]() |
5833175378 | ||
![]() |
8f23cc85d9 | ||
![]() |
18d005bb2b | ||
![]() |
602165f822 | ||
![]() |
684ef662a7 | ||
![]() |
384c3d5abb | ||
![]() |
9493b2c374 | ||
![]() |
a3f4a3861d | ||
![]() |
e1c90493e2 | ||
![]() |
ee887913a6 | ||
![]() |
36da8b7168 | ||
![]() |
3780a5b2e7 | ||
![]() |
d60312e3eb | ||
![]() |
7513c2f45d | ||
![]() |
c5331ad0e4 | ||
![]() |
cdfdf04d7e | ||
![]() |
18e2cdffa4 | ||
![]() |
28b649388d | ||
![]() |
3022868577 | ||
![]() |
328c0047c8 | ||
![]() |
108c853840 | ||
![]() |
d6fc415460 | ||
![]() |
7e9dbb514d | ||
![]() |
daa42d5201 | ||
![]() |
bdaa74058a | ||
![]() |
ac5838e4fc | ||
![]() |
6f510ffb57 | ||
![]() |
fc9bcc275f | ||
![]() |
f5d34d97cb | ||
![]() |
fc85e53318 |
@ -1,5 +1,5 @@
|
||||
# ROM Properties Page Shell Extension
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 3.5)
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 3.5...3.10)
|
||||
|
||||
# CMP0048: Set VERSION variables based on the project version specified in PROJECT().
|
||||
# Introduced in CMake 3.0.
|
||||
@ -27,6 +27,12 @@ IF(POLICY CMP0151)
|
||||
CMAKE_POLICY(SET CMP0151 NEW)
|
||||
ENDIF(POLICY CMP0151)
|
||||
|
||||
# CMP0177: Normalize INSTALL() destination paths.
|
||||
# Introduced in CMake 3.31.
|
||||
IF(POLICY CMP0177)
|
||||
CMAKE_POLICY(SET CMP0177 NEW)
|
||||
ENDIF(POLICY CMP0177)
|
||||
|
||||
# Read the project version.
|
||||
CONFIGURE_FILE(version.txt version.txt.tmp)
|
||||
FILE(STRINGS version.txt RP_VERSION_FILE)
|
||||
@ -89,13 +95,13 @@ SET(CMAKE_C_STANDARD_REQUIRED OFF)
|
||||
SET(CMAKE_C_EXTENSIONS ON)
|
||||
SET(CMAKE_CXX_STANDARD_REQUIRED OFF)
|
||||
SET(CMAKE_CXX_EXTENSIONS ON)
|
||||
IF(CMAKE_VERSION VERSION_GREATER 3.20) # >= 3.21
|
||||
IF(CMAKE_VERSION VERSION_GREATER 3.20.99) # >= 3.21
|
||||
SET(CMAKE_C_STANDARD 17)
|
||||
SET(CMAKE_CXX_STANDARD 20)
|
||||
ELSEIF(CMAKE_VERSION VERSION_GREATER 3.11) # >= 3.12
|
||||
ELSEIF(CMAKE_VERSION VERSION_GREATER 3.11.99) # >= 3.12
|
||||
SET(CMAKE_C_STANDARD 11)
|
||||
SET(CMAKE_CXX_STANDARD 20)
|
||||
ELSEIF(CMAKE_VERSION VERSION_GREATER 3.7) # >= 3.8
|
||||
ELSEIF(CMAKE_VERSION VERSION_GREATER 3.7.99) # >= 3.8
|
||||
SET(CMAKE_C_STANDARD 11)
|
||||
SET(CMAKE_CXX_STANDARD 17)
|
||||
ELSE()
|
||||
|
99
NEWS.md
99
NEWS.md
@ -1,5 +1,103 @@
|
||||
# Changes
|
||||
|
||||
## v2.6 (released 2025/??/??)
|
||||
|
||||
* New parsers:
|
||||
* ICO: Windows icons and cursors. Supports most icons and cursors designed
|
||||
for Windows 3.x and later (including Windows Vista PNG-format icons),
|
||||
plus the old Windows 1.x format. Only the "best" version for each icon
|
||||
is selected for thumbnailing. (Largest size and highest color depth.)
|
||||
* Icon thumbnailing is not actually enabled on Windows and Linux systems
|
||||
at the moment, since it may conflict with system icon handling.
|
||||
It's mostly only usable for rpcli and for use as a subclass elsewhere.
|
||||
* Partially fixes #170: Icon files: ICNS, ICO, EXE
|
||||
|
||||
* New parser features:
|
||||
* Xbox360_STFS: Fix titles for some packages that were authored incorrectly
|
||||
and have mojibake titles. Specifically, the titles were originally encoded
|
||||
as UTF-8, but when building the package, they were handled as if they were
|
||||
cp1252 when being converted to UTF-16BE.
|
||||
* Fixes #450: X360 - Non-Latin Titles appearing as mojibake
|
||||
* Reported by @Masamune3210.
|
||||
* EXE: The application icon can now be extracted using rpcli.
|
||||
* ISO: AUTORUN.INF is now parsed. This includes a tab showing the contents
|
||||
of AUTORUN.INF, as well as the disc icon from a .ico or .exe/.dll file.
|
||||
* Fixes #232: ISO: Parse autorun.inf
|
||||
* ISO: Joliet file systems are now partially supported. This was added to
|
||||
handle older Windows disc images that use a long filename for the icon,
|
||||
and the disc is authored with Joliet for long filenames but an old version
|
||||
of ISO-9660, resulting in 8.3 filenames in the ISO-9660 directories.
|
||||
|
||||
* Bug fixes:
|
||||
* Windows: Work around a potential libpng crash when attempting to read
|
||||
empty data as a PNG image. (Needs more debugging for a proper fix...)
|
||||
* See #451: libpng errors crash due to libpng setjmp/longjmp (Windows 10, release builds only)
|
||||
* Reported by @Masamune3210.
|
||||
* Qoi: R/B channels were incorrectly swapped when this was first added in v2.5.
|
||||
* Affects: v2.5 - v2.5.1
|
||||
* Fix an issue where an 'abgr' swizzle might fail on little-endian systems.
|
||||
|
||||
* Other changes:
|
||||
* rpcli: Added more colorization for warning messages.
|
||||
* rpcli: Refactored console handling into a separate library, libgsvt.
|
||||
* IsoPartition: Implemented readdir(). Not currently used by anything, though.
|
||||
* KDE (KF5, KF6): Improved image quality for RFT_LISTDATA fields with icons.
|
||||
|
||||
## v2.5.1 (released 2025/05/10)
|
||||
|
||||
* New parser features:
|
||||
* ISO: Show the sector mode in addition to sector sizes.
|
||||
* Fixes #322: Underlying CD image type for ISO
|
||||
* Requested by @DankRank.
|
||||
* SNES: List the Nintendo Power directory for full NP cartridge dumps.
|
||||
* Fixes #154: SNES: Nintendo Power directory
|
||||
* MegaDrive: Add external image URL support for the Teradrive TMSS ROM.
|
||||
|
||||
* Bug fixes:
|
||||
* NintendoDS_BNR: Animated icons were missing the animated icon flag.
|
||||
* Affects: v2.4 - v2.5
|
||||
* EXE: Don't show the "XML parsing failed" warning if the EXE doesn't
|
||||
actually have a manifest.
|
||||
* Affects: v2.5
|
||||
* rpcli: SCSI inquiry was accidentally broken during a code cleanup.
|
||||
* Affects: v2.3 - v2.5
|
||||
* ISO: Get the sector size from the underlying disc reader classes if
|
||||
not reading directly from a file.
|
||||
* The SparseDiscReader changes in v2.3 broke this, so anything that
|
||||
uses an ISO-9660 format showed 2048-byte sectors, even if this
|
||||
wasn't the case.
|
||||
* KDE: On KF6, ListData widgets that didn't specify a default sorting
|
||||
method ended up being sorted in reverse-order by default. Not sure
|
||||
why this changed in Qt6. A workaround has been applied to fix it.
|
||||
* ISO: Fix a typo that broke "Volume Size" on CD-i volumes.
|
||||
* Affects: v1.8 - v2.5
|
||||
* Build system: DT_RELR detection was broken and didn't work properly
|
||||
since it was implemented in v2.0. It now works properly.
|
||||
* GTK4: Fix a potential crash in DragImage when using `rp-stub -R`.
|
||||
* WiiUPackage: vWii packages are now handled properly.
|
||||
|
||||
* Other changes:
|
||||
* Added support for localsearch-3.8, the new name of Tracker.
|
||||
This is internally handled as API "3L".
|
||||
* Fixes #446: Use `localsearch` paths instead of `tracker3-miners`
|
||||
* Reported by @lufog.
|
||||
* rpcli: Improved Unicode output such that it works properly on older versions
|
||||
of Windows, including Windows XP and Windows 7, by using WriteConsoleW().
|
||||
This requires converting from UTF-8 to UTF-16, but it turns out doing this
|
||||
is actually faster than printf/cout, even on versions of Windows that support
|
||||
UTF-8 properly, so now it's used on Windows 10 as well.
|
||||
* rpcli: Some more status and error messages are now colorized if printing to
|
||||
a console. (Cyan for status messages; red for error messages.)
|
||||
* Colorization is now disabled on non-Windows systems if TERM is not set to
|
||||
a terminal that supports color.
|
||||
* URLs are now colorized and marked up using "OSC 8", which makes them
|
||||
clickable on terminals that support it.
|
||||
* The xattr tab now supports displaying file compression algorithms in some
|
||||
cases. On Windows, it will indicate LZNT1 ("standard" NTFS compression) on
|
||||
all versions, and if using Windows 10 or later, it will indicate newer
|
||||
algorithms in use, e.g. the XPRESS and LZX algorithms. On Linux, btrfs's
|
||||
zlib, lzo, and zstd algorithms will be displayed.
|
||||
|
||||
## v2.5 (released 2025/04/19)
|
||||
|
||||
* New parsers:
|
||||
@ -86,6 +184,7 @@
|
||||
can get tripped up because it uses C-style varargs.
|
||||
* rpcli: Text output for "warning" messages is now colorized if
|
||||
printing to a terminal.
|
||||
* rpcli: On Windows, enable UTF-8 console output if using Windows 7 or later.
|
||||
* Removed IFUNC support. It's only supported by glibc on Linux (and possibly
|
||||
some of the BSDs), and it adds a lot of complexity. The regular C dispatch
|
||||
functions only have a few instructions of overhead in most cases.
|
||||
|
@ -11,10 +11,12 @@ video game ROM and disc images.
|
||||
[](https://www.codefactor.io/repository/github/gerbilsoft/rom-properties/overview)
|
||||
[](https://codecov.io/gh/GerbilSoft/rom-properties)
|
||||
|
||||
## v2.5
|
||||
## v2.5.1
|
||||
|
||||

|
||||
|
||||
v2.5.1 is a bugfix release with no significant new features.
|
||||
|
||||
Major additions in v2.5 include:
|
||||
|
||||
* J2ME packages
|
||||
@ -37,7 +39,7 @@ language, check out the [Crowdin project](https://crowdin.com/project/rom-proper
|
||||
Crowdin project page, file an issue here on GitHub with the requested
|
||||
language.)
|
||||
|
||||
See [`NEWS.md`](NEWS.md) for a full list of changes in v2.5.
|
||||
See [`NEWS.md`](NEWS.md) for a full list of changes in v2.5.1.
|
||||
|
||||
## Feedback
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
# AppVeyor configuration file.
|
||||
version: '2.5.0.{build}'
|
||||
version: '2.5.1.{build}'
|
||||
|
||||
# Build worker image (VM template)
|
||||
image:
|
||||
|
@ -17,7 +17,13 @@ IF(NOT USE_INTERNAL_XML)
|
||||
# Found system PugiXML.
|
||||
SET(HAVE_XML 1)
|
||||
# NOTE: PugiXML's CMake configuration files don't set pugixml_LIBRARY.
|
||||
SET(pugixml_LIBRARY pugixml::pugixml CACHE INTERNAL "PugiXML library" FORCE)
|
||||
IF(TARGET pugixml::pugixml)
|
||||
SET(pugixml_LIBRARY pugixml::pugixml CACHE INTERNAL "PugiXML library" FORCE)
|
||||
ELSEIF(TARGET pugixml)
|
||||
SET(pugixml_LIBRARY pugixml CACHE INTERNAL "PugiXML library" FORCE)
|
||||
ELSE()
|
||||
MESSAGE(FATAL_ERROR "Unable to find the correct PugiXML target.")
|
||||
ENDIF()
|
||||
ELSE()
|
||||
# System PugiXML was not found.
|
||||
# NOTE: Some older versions, e.g. 1.7-2 (Ubuntu 16.04), lack both
|
||||
|
@ -111,9 +111,15 @@ IF(CPU_i386 OR CPU_amd64)
|
||||
ENDIF()
|
||||
ENDIF(CPU_i386 OR CPU_amd64)
|
||||
|
||||
IF(CPU_arm OR CPU_arm64 OR CPU_arm64ec)
|
||||
# FIXME: NEON on Ubuntu armhf is complaining when using LTO.
|
||||
# Disable NEON on armhf for now, except for MSVC.
|
||||
IF((CPU_arm AND MSVC) OR CPU_arm64 OR CPU_arm64ec)
|
||||
# Check for arm_neon.h.
|
||||
# NOTE: Should always be present for arm64, but check anyway.
|
||||
INCLUDE(CheckIncludeFile)
|
||||
CHECK_INCLUDE_FILE("arm_neon.h" HAVE_ARM_NEON_H)
|
||||
ENDIF(CPU_arm OR CPU_arm64 OR CPU_arm64ec)
|
||||
|
||||
IF(CPU_arm AND NOT MSVC)
|
||||
SET(NEON_FLAG "-marm -mfpu=neon")
|
||||
ENDIF(CPU_arm AND NOT MSVC)
|
||||
ENDIF((CPU_arm AND MSVC) OR CPU_arm64 OR CPU_arm64ec)
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Build options.
|
||||
|
||||
OPTION(ENABLE_WERROR "Treat all compile warnings as errors. (Enable for development!)" OFF)
|
||||
|
||||
# Platform options.
|
||||
# NOTE: If a platform is specified but it isn't found,
|
||||
# that plugin will not be built. There doesn't seem to
|
||||
|
@ -219,12 +219,12 @@ IF(UNIX AND NOT APPLE)
|
||||
SET(TMP_HAVE_DT_RELR FALSE)
|
||||
MESSAGE(STATUS "Checking if the system supports DT_RELR - no, needs glibc-2.36 or later")
|
||||
ENDIF()
|
||||
UNSET(TMP_HAVE_DT_RELR)
|
||||
ELSE(_ld_out MATCHES "-z pack-relative-relocs")
|
||||
SET(TMP_HAVE_DT_RELR FALSE)
|
||||
MESSAGE(STATUS "Checking if the system supports DT_RELR - no, needs binutils-2.38 or later")
|
||||
ENDIF(_ld_out MATCHES "-z pack-relative-relocs")
|
||||
SET(HAVE_DT_RELR ${TMP_HAVE_DT_RELR} CACHE INTERNAL "System supports DT_RELR")
|
||||
UNSET(TMP_HAVE_DT_RELR)
|
||||
ENDIF(NOT DEFINED HAVE_DT_RELR)
|
||||
|
||||
IF(HAVE_DT_RELR)
|
||||
@ -274,20 +274,23 @@ IF(CFLAG_OPTIMIZE_FTREE_VECTORIZE)
|
||||
ENDIF(CFLAG_OPTIMIZE_FTREE_VECTORIZE)
|
||||
|
||||
# Add "-Werror" *after* checking for everything else.
|
||||
SET(RP_C_FLAGS_COMMON "${RP_C_FLAGS_COMMON} -Werror")
|
||||
SET(RP_CXX_FLAGS_COMMON "${RP_CXX_FLAGS_COMMON} -Werror")
|
||||
SET(CFLAGS_WNO_ERROR -Wno-error=unknown-pragmas -Wno-error=address -Wno-error=attributes -Wno-error=unused-parameter -Wno-error=unused-but-set-variable -Wno-error=ignored-qualifiers -Wno-error=missing-field-initializers -Wno-error=unused-variable -Wno-error=unused-function -Wno-error=type-limits -Wno-error=empty-body -Wno-error=address-of-packed-member -Wno-error=shift-negative-value -Wno-error=clobbered -Wno-error=overloaded-virtual -Wno-error=header-hygiene)
|
||||
FOREACH(FLAG_TEST ${CFLAGS_WNO_ERROR})
|
||||
# CMake doesn't like certain characters in variable names.
|
||||
STRING(REGEX REPLACE "/|:|=" "_" FLAG_TEST_VARNAME "${FLAG_TEST}")
|
||||
IF(ENABLE_WERROR)
|
||||
SET(RP_C_FLAGS_COMMON "${RP_C_FLAGS_COMMON} -Werror")
|
||||
SET(RP_CXX_FLAGS_COMMON "${RP_CXX_FLAGS_COMMON} -Werror")
|
||||
|
||||
CHECK_C_COMPILER_FLAG("${FLAG_TEST}" CFLAG_${FLAG_TEST_VARNAME})
|
||||
IF(CFLAG_${FLAG_TEST_VARNAME})
|
||||
SET(RP_C_FLAGS_COMMON "${RP_C_FLAGS_COMMON} ${FLAG_TEST}")
|
||||
SET(RP_CXX_FLAGS_COMMON "${RP_CXX_FLAGS_COMMON} ${FLAG_TEST}")
|
||||
ENDIF(CFLAG_${FLAG_TEST_VARNAME})
|
||||
UNSET(CFLAG_${FLAG_TEST_VARNAME})
|
||||
ENDFOREACH(FLAG_TEST)
|
||||
SET(CFLAGS_WNO_ERROR -Wno-error=unknown-pragmas -Wno-error=address -Wno-error=attributes -Wno-error=unused-parameter -Wno-error=unused-but-set-variable -Wno-error=ignored-qualifiers -Wno-error=missing-field-initializers -Wno-error=unused-variable -Wno-error=unused-function -Wno-error=type-limits -Wno-error=empty-body -Wno-error=address-of-packed-member -Wno-error=shift-negative-value -Wno-error=clobbered -Wno-error=overloaded-virtual -Wno-error=header-hygiene -Wno-error=cast-align -Wno-error=stringop-overread)
|
||||
FOREACH(FLAG_TEST ${CFLAGS_WNO_ERROR})
|
||||
# CMake doesn't like certain characters in variable names.
|
||||
STRING(REGEX REPLACE "/|:|=" "_" FLAG_TEST_VARNAME "${FLAG_TEST}")
|
||||
|
||||
CHECK_C_COMPILER_FLAG("${FLAG_TEST}" CFLAG_${FLAG_TEST_VARNAME})
|
||||
IF(CFLAG_${FLAG_TEST_VARNAME})
|
||||
SET(RP_C_FLAGS_COMMON "${RP_C_FLAGS_COMMON} ${FLAG_TEST}")
|
||||
SET(RP_CXX_FLAGS_COMMON "${RP_CXX_FLAGS_COMMON} ${FLAG_TEST}")
|
||||
ENDIF(CFLAG_${FLAG_TEST_VARNAME})
|
||||
UNSET(CFLAG_${FLAG_TEST_VARNAME})
|
||||
ENDFOREACH(FLAG_TEST)
|
||||
ENDIF(ENABLE_WERROR)
|
||||
|
||||
### Debug/Release flags ###
|
||||
|
||||
@ -300,10 +303,24 @@ SET(RP_CXX_FLAGS_RELEASE "-O2 -DNDEBUG ${CFLAGS_VECTORIZE}")
|
||||
SET(RP_C_FLAGS_RELWITHDEBINFO "-O2 -ggdb -DNDEBUG ${CFLAGS_VECTORIZE}")
|
||||
SET(RP_CXX_FLAGS_RELWITHDEBINFO "-O2 -ggdb -DNDEBUG ${CFLAGS_VECTORIZE}")
|
||||
|
||||
# Enable C++ assertions. (libstdc++ / libc++)
|
||||
# Also enable C++ debug mode. (libstdc++ only)
|
||||
# TODO: Only enable GLIBCXX for libstdc++, and LIBCPP for libc++.
|
||||
SET(RP_CXX_FLAGS_DEBUG "${RP_CXX_FLAGS_DEBUG} -D_GLIBCXX_ASSERTIONS -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC -D_LIBCPP_ENABLE_ASSERTIONS -D_LIBCPP_ENABLE_HARDENED_MODE")
|
||||
# Enable C++ assertions and other hardening options. (libstdc++ / libc++)
|
||||
# TODO: Check for the actual C++ runtime being used instead of
|
||||
# assuming libc++ is only used with Clang.
|
||||
SET(RP_CXX_FLAGS_DEBUG "${RP_CXX_FLAGS_DEBUG} -D_GLIBCXX_ASSERTIONS -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC")
|
||||
|
||||
# libc++ (clang only)
|
||||
IF(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
SET(RP_CXX_FLAGS_DEBUG "${RP_CXX_FLAGS_DEBUG} -D_LIBCPP_ASSERT=1 -D_LIBCPP_DEBUG=1 -D_LIBCPP_ENABLE_HARDENED_MODE=1")
|
||||
|
||||
IF(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 16.50)
|
||||
# clang-17: Use _LIBCPP_HARDENING_MODE.
|
||||
SET(RP_CXX_FLAGS_DEBUG "${RP_CXX_FLAGS_DEBUG} -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG")
|
||||
ELSE(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 16.50)
|
||||
# clang-16 or earlier: Use _LIBCPP_ENABLE_ASSERTIONS.
|
||||
# NOTE: _LIBCPP_ENABLE_ASSERTIONS causes an error if using clang-17 or later.
|
||||
SET(RP_CXX_FLAGS_DEBUG "${RP_CXX_FLAGS_DEBUG} -D_LIBCPP_ENABLE_ASSERTIONS=1")
|
||||
ENDIF(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 16.50)
|
||||
ENDIF(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
|
||||
# Unset temporary variables.
|
||||
UNSET(CFLAG_OPTIMIZE_DEBUG)
|
||||
|
@ -23,8 +23,12 @@ ENDIF(NOT CMAKE_SYSTEM_VERSION)
|
||||
# - C4024: 'function': different types for formal and actual parameter n
|
||||
# - C4047: 'function': 'parameter' differs in levels of indirection from 'argument'
|
||||
# - C4477: 'function' : format string 'string' requires an argument of type 'type', but variadic argument number has type 'type'
|
||||
SET(RP_C_FLAGS_COMMON "/nologo /W3 /WX /wd4005 /wd4091 /wd4355 /wd4503 /wd4800 /we4013 /we4024 /we4047 /we4477")
|
||||
SET(RP_CXX_FLAGS_COMMON "${RP_C_FLAGS_COMMON} -D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING")
|
||||
SET(RP_C_FLAGS_COMMON "/nologo /W3")
|
||||
IF(ENABLE_WERROR)
|
||||
SET(RP_C_FLAGS_COMMON "${RP_C_FLAGS_COMMON} /WX")
|
||||
ENDIF(ENABLE_WERROR)
|
||||
SET(RP_C_FLAGS_COMMON "${RP_C_FLAGS_COMMON} /wd4005 /wd4091 /wd4355 /wd4503 /wd4800 /we4013 /we4024 /we4047 /we4477")
|
||||
SET(RP_CXX_FLAGS_COMMON "${RP_C_FLAGS_COMMON}")
|
||||
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS)
|
||||
# NOTE: /TSAWARE is automatically set for Windows 2000 and later. (as of at least Visual Studio .NET 2003)
|
||||
# NOTE 2: /TSAWARE is not applicable for DLLs.
|
||||
|
14
debian/changelog
vendored
14
debian/changelog
vendored
@ -1,3 +1,17 @@
|
||||
rom-properties (2.5.1-1ppa1~xenial2) xenial; urgency=medium
|
||||
|
||||
* Explicitly specify the Tracker API version.
|
||||
|
||||
NOTE: This must be updated for each Ubuntu version!
|
||||
|
||||
-- David Korth <gerbilsoft@gerbilsoft.com> Sat, 10 May 2025 16:52:48 -0400
|
||||
|
||||
rom-properties (2.5.1-1ppa1~xenial1) xenial; urgency=medium
|
||||
|
||||
* 2.5.1 release.
|
||||
|
||||
-- David Korth <gerbilsoft@gerbilsoft.com> Sat, 10 May 2025 15:29:49 -0400
|
||||
|
||||
rom-properties (2.5-1ppa5~xenial4) xenial; urgency=medium
|
||||
|
||||
* 2.5 release.
|
||||
|
20
debian/control
vendored
20
debian/control
vendored
@ -42,7 +42,7 @@ Vcs-Browser: https://github.com/GerbilSoft/rom-properties
|
||||
|
||||
Package: rom-properties-all
|
||||
Architecture: any
|
||||
Depends: ${misc:Depends}, libromdata6, rom-properties-kde4, rom-properties-kf5, rom-properties-xfce, rom-properties-gtk3, rom-properties-cli, rom-properties-tracker, rom-properties-utils, rom-properties-lang, rom-properties-thumbnailer-dbus
|
||||
Depends: ${misc:Depends}, libromdata7, rom-properties-kde4, rom-properties-kf5, rom-properties-xfce, rom-properties-gtk3, rom-properties-cli, rom-properties-tracker, rom-properties-utils, rom-properties-lang, rom-properties-thumbnailer-dbus
|
||||
Description: ROM Properties Page shell extension (meta package)
|
||||
This shell extension provides thumbnailing and property page functionality
|
||||
for ROM images, disc images, and save files for various game consoles,
|
||||
@ -50,9 +50,9 @@ Description: ROM Properties Page shell extension (meta package)
|
||||
.
|
||||
This is a meta-package that installs all rom-properties packages.
|
||||
|
||||
Package: libromdata6
|
||||
Package: libromdata7
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}, rom-properties-data
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}, rom-properties-data, liblz4-1, liblzo2-2
|
||||
Description: ROM Properties Page shell extension (shared library)
|
||||
This shell extension provides thumbnailing and property page functionality
|
||||
for ROM images, disc images, and save files for various game consoles,
|
||||
@ -63,7 +63,7 @@ Description: ROM Properties Page shell extension (shared library)
|
||||
|
||||
Package: rom-properties-kde4
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}, libromdata6, rom-properties-utils, rom-properties-xdg
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}, libromdata7, rom-properties-utils, rom-properties-xdg
|
||||
Recommends: rom-properties-lang
|
||||
Description: ROM Properties Page shell extension (KDE4 UI frontend)
|
||||
This shell extension provides thumbnailing and property page functionality
|
||||
@ -74,7 +74,7 @@ Description: ROM Properties Page shell extension (KDE4 UI frontend)
|
||||
|
||||
Package: rom-properties-kio-servicemenus
|
||||
Architecture: all
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}, libromdata6, rom-properties-utils
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}, libromdata7, rom-properties-utils
|
||||
Conflicts: rom-properties-kf5 (<< 2.3)
|
||||
Replaces: rom-properties-kf5 (<< 2.3)
|
||||
Description: ROM Properties Page shell extension (KF5/KF6 service menus)
|
||||
@ -86,7 +86,7 @@ Description: ROM Properties Page shell extension (KF5/KF6 service menus)
|
||||
|
||||
Package: rom-properties-kf5
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}, libromdata6, rom-properties-utils, rom-properties-xdg, rom-properties-kio-servicemenus
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}, libromdata7, rom-properties-utils, rom-properties-xdg, rom-properties-kio-servicemenus
|
||||
Recommends: rom-properties-lang
|
||||
Conflicts: rom-properties-kde5
|
||||
Replaces: rom-properties-kde5
|
||||
@ -99,7 +99,7 @@ Description: ROM Properties Page shell extension (KF5 UI frontend)
|
||||
|
||||
Package: rom-properties-xfce
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}, libromdata6, rom-properties-utils, rom-properties-xdg, rom-properties-thumbnailer-dbus
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}, libromdata7, rom-properties-utils, rom-properties-xdg, rom-properties-thumbnailer-dbus
|
||||
Recommends: rom-properties-lang, rom-properties-tracker
|
||||
Description: ROM Properties Page shell extension (GTK2 XFCE UI frontend)
|
||||
This shell extension provides thumbnailing and property page functionality
|
||||
@ -113,7 +113,7 @@ Description: ROM Properties Page shell extension (GTK2 XFCE UI frontend)
|
||||
|
||||
Package: rom-properties-gtk3
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}, libromdata6, rom-properties-utils, rom-properties-xdg, rom-properties-thumbnailer-dbus
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}, libromdata7, rom-properties-utils, rom-properties-xdg, rom-properties-thumbnailer-dbus
|
||||
Recommends: rom-properties-lang, rom-properties-tracker
|
||||
Conflicts: rom-properties-gnome, rom-properties-mate, rom-properties-cinnamon, rom-properties-gtk3-common
|
||||
Replaces: rom-properties-gnome, rom-properties-mate, rom-properties-cinnamon, rom-properties-gtk3-common
|
||||
@ -132,7 +132,7 @@ Description: ROM Properties Page shell extension (GTK3 UI frontend)
|
||||
|
||||
Package: rom-properties-cli
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}, libromdata6
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}, libromdata7
|
||||
Recommends: rom-properties-lang
|
||||
Description: ROM Properties Page shell extension (command line version)
|
||||
This shell extension provides thumbnailing and property page functionality
|
||||
@ -143,7 +143,7 @@ Description: ROM Properties Page shell extension (command line version)
|
||||
|
||||
Package: rom-properties-tracker
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}, libromdata6
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}, libromdata7
|
||||
Description: ROM Properties Page shell extension (Tracker metadata extractor module)
|
||||
This shell extension provides thumbnailing and property page functionality
|
||||
for ROM images, disc images, and save files for various game consoles,
|
||||
|
10
extlib/CMakeLists.txt
vendored
10
extlib/CMakeLists.txt
vendored
@ -189,12 +189,14 @@ SET(USE_INTERNAL_MINIZIP TRUE PARENT_SCOPE)
|
||||
SET(SKIP_INSTALL_HDR ON)
|
||||
IF(WIN32)
|
||||
SET(USE_INTERNAL_MINIZIP_DLL TRUE PARENT_SCOPE)
|
||||
SET(SKIP_INSTALL_BINARIES ON)
|
||||
SET(SKIP_INSTALL_LIBRARIES OFF)
|
||||
SET(SKIP_INSTALL_ALL OFF)
|
||||
SET(BUILD_SHARED_LIBS ON)
|
||||
SET(BUILD_STATIC_LIBS OFF)
|
||||
ELSE()
|
||||
UNSET(USE_INTERNAL_MINIZIP_DLL PARENT_SCOPE)
|
||||
SET(SKIP_INSTALL_BINARIES ON)
|
||||
SET(SKIP_INSTALL_LIBRARIES ON)
|
||||
SET(SKIP_INSTALL_ALL ON)
|
||||
SET(BUILD_SHARED_LIBS OFF)
|
||||
@ -269,10 +271,10 @@ IF(USE_INTERNAL_XML)
|
||||
SET(PUGIXML_COMPACT OFF)
|
||||
SET(PUGIXML_INSTALL ON)
|
||||
|
||||
# TODO: Investigate these.
|
||||
SET(PUGIXML_NO_XPATH OFF)
|
||||
SET(PUGIXML_NO_STL OFF)
|
||||
SET(PUGIXML_NO_EXCEPTIONS OFF)
|
||||
# Disable functionality we don't need.
|
||||
SET(PUGIXML_NO_XPATH ON)
|
||||
SET(PUGIXML_NO_STL ON)
|
||||
SET(PUGIXML_NO_EXCEPTIONS ON)
|
||||
|
||||
# Build PugiXML.
|
||||
ADD_SUBDIRECTORY(pugixml)
|
||||
|
1
extlib/fmt/.clang-format
vendored
1
extlib/fmt/.clang-format
vendored
@ -7,6 +7,7 @@ IndentCaseLabels: false
|
||||
AlwaysBreakTemplateDeclarations: false
|
||||
DerivePointerAlignment: false
|
||||
AllowShortCaseLabelsOnASingleLine: true
|
||||
QualifierAlignment: Left
|
||||
AlignConsecutiveShortCaseStatements:
|
||||
Enabled: true
|
||||
AcrossEmptyLines: true
|
||||
|
3
extlib/fmt/CMakeLists.txt
vendored
3
extlib/fmt/CMakeLists.txt
vendored
@ -244,8 +244,7 @@ if (NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
|
||||
endif ()
|
||||
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/support/cmake")
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/support/cmake")
|
||||
|
||||
include(CheckCXXCompilerFlag)
|
||||
include(JoinPaths)
|
||||
|
100
extlib/fmt/ChangeLog.md
vendored
100
extlib/fmt/ChangeLog.md
vendored
@ -1,3 +1,103 @@
|
||||
# 11.2.0 - 2025-05-03
|
||||
|
||||
- Added the `s` specifier for `std::error_code`. It allows formatting an error
|
||||
message as a string. For example:
|
||||
|
||||
```c++
|
||||
#include <fmt/std.h>
|
||||
|
||||
int main() {
|
||||
auto ec = std::make_error_code(std::errc::no_such_file_or_directory);
|
||||
fmt::print("{:s}\n", ec);
|
||||
}
|
||||
```
|
||||
|
||||
prints
|
||||
|
||||
```
|
||||
No such file or directory
|
||||
```
|
||||
(The actual message is platform-specific.)
|
||||
|
||||
- Fixed formatting of `std::chrono::local_time` and `tm`
|
||||
(https://github.com/fmtlib/fmt/issues/3815,
|
||||
https://github.com/fmtlib/fmt/issues/4350).
|
||||
For example ([godbolt](https://www.godbolt.org/z/8o4b1PPn5)):
|
||||
|
||||
```c++
|
||||
#include <fmt/chrono.h>
|
||||
|
||||
int main() {
|
||||
std::chrono::zoned_time zt(
|
||||
std::chrono::current_zone(),
|
||||
std::chrono::system_clock::now());
|
||||
fmt::print("{}", zt.get_local_time());
|
||||
}
|
||||
```
|
||||
|
||||
is now formatted consistenly across platforms.
|
||||
|
||||
- Added diagnostics for cases when timezone information is not available.
|
||||
For example:
|
||||
|
||||
```c++
|
||||
fmt::print("{:Z}", std::chrono::local_seconds());
|
||||
```
|
||||
|
||||
now gives a compile-time error.
|
||||
|
||||
- Deprecated `fmt::localtime` in favor of `std::localtime`.
|
||||
|
||||
- Fixed compilation with GCC 15 and C++20 modules enabled
|
||||
(https://github.com/fmtlib/fmt/pull/4347). Thanks @tkhyn.
|
||||
|
||||
- Fixed handling of named arguments in format specs
|
||||
(https://github.com/fmtlib/fmt/issues/4360,
|
||||
https://github.com/fmtlib/fmt/pull/4361). Thanks @dinomight.
|
||||
|
||||
- Added error reporting for duplicate named arguments
|
||||
(https://github.com/fmtlib/fmt/pull/4367). Thanks @dinomight.
|
||||
|
||||
- Fixed formatting of `long` with `FMT_BUILTIN_TYPES=0`
|
||||
(https://github.com/fmtlib/fmt/issues/4375,
|
||||
https://github.com/fmtlib/fmt/issues/4394).
|
||||
|
||||
- Optimized `text_style` using bit packing
|
||||
(https://github.com/fmtlib/fmt/pull/4363). Thanks @LocalSpook.
|
||||
|
||||
- Added support for incomplete types (https://github.com/fmtlib/fmt/issues/3180,
|
||||
https://github.com/fmtlib/fmt/pull/4383). Thanks @LocalSpook.
|
||||
|
||||
- Fixed a flush issue in `fmt::print` when using libstdc++
|
||||
(https://github.com/fmtlib/fmt/issues/4398).
|
||||
|
||||
- Fixed `fmt::println` usage with `FMT_ENFORCE_COMPILE_STRING` and legacy
|
||||
compile-time checks (https://github.com/fmtlib/fmt/pull/4407).
|
||||
Thanks @madmaxoft.
|
||||
|
||||
- Removed legacy header `fmt/core.h` from docs
|
||||
(https://github.com/fmtlib/fmt/pull/4421,
|
||||
https://github.com/fmtlib/fmt/pull/4422). Thanks @krzysztofkortas.
|
||||
|
||||
- Worked around limitations of `__builtin_strlen` during constant evaluation
|
||||
(https://github.com/fmtlib/fmt/issues/4423,
|
||||
https://github.com/fmtlib/fmt/pull/4429). Thanks @BRevzin.
|
||||
|
||||
- Worked around a bug in MSVC v141 (https://github.com/fmtlib/fmt/issues/4412,
|
||||
https://github.com/fmtlib/fmt/pull/4413). Thanks @hirohira9119.
|
||||
|
||||
- Removed the `fmt_detail` namespace
|
||||
(https://github.com/fmtlib/fmt/issues/4324).
|
||||
|
||||
- Removed specializations of `std::is_floating_point` in tests
|
||||
(https://github.com/fmtlib/fmt/issues/4417).
|
||||
|
||||
- Fixed a CMake error when setting `CMAKE_MODULE_PATH` in the pedantic mode
|
||||
(https://github.com/fmtlib/fmt/pull/4426). Thanks @rlalik.
|
||||
|
||||
- Updated the Bazel config (https://github.com/fmtlib/fmt/pull/4400).
|
||||
Thanks @Vertexwahn.
|
||||
|
||||
# 11.1.4 - 2025-02-26
|
||||
|
||||
- Fixed ABI compatibility with earlier 11.x versions on Windows
|
||||
|
4
extlib/fmt/README.md
vendored
4
extlib/fmt/README.md
vendored
@ -47,7 +47,7 @@ Try {fmt} in [Compiler Explorer](https://godbolt.org/z/8Mx1EW73v).
|
||||
hundred million integers to strings per
|
||||
second](http://www.zverovich.net/2020/06/13/fast-int-to-string-revisited.html)
|
||||
- Small code size both in terms of source code with the minimum
|
||||
configuration consisting of just three files, `core.h`, `format.h`
|
||||
configuration consisting of just three files, `base.h`, `format.h`
|
||||
and `format-inl.h`, and compiled code; see [Compile time and code
|
||||
bloat](#compile-time-and-code-bloat)
|
||||
- Reliability: the library has an extensive set of
|
||||
@ -74,7 +74,7 @@ See the [documentation](https://fmt.dev) for more details.
|
||||
**Print to stdout** ([run](https://godbolt.org/z/Tevcjh))
|
||||
|
||||
``` c++
|
||||
#include <fmt/core.h>
|
||||
#include <fmt/base.h>
|
||||
|
||||
int main() {
|
||||
fmt::print("Hello, world!\n");
|
||||
|
8
extlib/fmt/_MODIFIED_LIBFMT.txt
vendored
8
extlib/fmt/_MODIFIED_LIBFMT.txt
vendored
@ -1,13 +1,13 @@
|
||||
This copy of libfmt 11.1.4 is a modified version of the original.
|
||||
This copy of libfmt 11.2.0 is a modified version of the original.
|
||||
|
||||
commit 123913715afeb8a437e6388b4473fcc4753e1c9a
|
||||
commit 40626af88bd7df9a5fb80be7b25ac85b122d6c21
|
||||
Update version
|
||||
|
||||
Tag: 11.1.4
|
||||
Tag: 11.2.0
|
||||
|
||||
The following changes have been made to the original:
|
||||
|
||||
- Removed documentation and test suites.
|
||||
|
||||
To obtain the original libfmt-11.1.4, visit:
|
||||
To obtain the original libfmt-11.2.0, visit:
|
||||
https://github.com/fmtlib/fmt
|
||||
|
12
extlib/fmt/doc/api.md
vendored
12
extlib/fmt/doc/api.md
vendored
@ -220,7 +220,7 @@ You can also write a formatter for a hierarchy of classes:
|
||||
```c++
|
||||
// demo.h:
|
||||
#include <type_traits>
|
||||
#include <fmt/core.h>
|
||||
#include <fmt/format.h>
|
||||
|
||||
struct A {
|
||||
virtual ~A() {}
|
||||
@ -403,7 +403,7 @@ All formatting is locale-independent by default. Use the `'L'` format
|
||||
specifier to insert the appropriate number separator characters from the
|
||||
locale:
|
||||
|
||||
#include <fmt/core.h>
|
||||
#include <fmt/format.h>
|
||||
#include <locale>
|
||||
|
||||
std::locale::global(std::locale("en_US.UTF-8"));
|
||||
@ -473,9 +473,9 @@ chrono-format-specifications).
|
||||
#include <fmt/chrono.h>
|
||||
|
||||
int main() {
|
||||
std::time_t t = std::time(nullptr);
|
||||
auto now = std::chrono::system_clock::now();
|
||||
|
||||
fmt::print("The date is {:%Y-%m-%d}.", fmt::localtime(t));
|
||||
fmt::print("The date is {:%Y-%m-%d}.\n", now);
|
||||
// Output: The date is 2020-11-07.
|
||||
// (with 2020-11-07 replaced by the current date)
|
||||
|
||||
@ -488,8 +488,6 @@ chrono-format-specifications).
|
||||
// Output: strftime-like format: 03:15:30
|
||||
}
|
||||
|
||||
::: localtime(std::time_t)
|
||||
|
||||
::: gmtime(std::time_t)
|
||||
|
||||
<a id="std-api"></a>
|
||||
@ -580,7 +578,7 @@ performance bottleneck.
|
||||
|
||||
`fmt/color.h` provides support for terminal color and text style output.
|
||||
|
||||
::: print(const text_style&, format_string<T...>, T&&...)
|
||||
::: print(text_style, format_string<T...>, T&&...)
|
||||
|
||||
::: fg(detail::color_type)
|
||||
|
||||
|
2
extlib/fmt/doc/index.md
vendored
2
extlib/fmt/doc/index.md
vendored
@ -122,7 +122,7 @@ hide:
|
||||
</p>
|
||||
<p>
|
||||
The library is highly portable and requires only a minimal <b>subset of
|
||||
C++11</b> features which are available in GCC 4.9, Clang 3.4, MSVC 19.10
|
||||
C++11</b> features which are available in GCC 4.9, Clang 3.6, MSVC 19.10
|
||||
(2017) and later. Newer compiler and standard library features are used
|
||||
if available, and enable additional functionality.
|
||||
</p>
|
||||
|
97
extlib/fmt/include/fmt/base.h
vendored
97
extlib/fmt/include/fmt/base.h
vendored
@ -21,7 +21,7 @@
|
||||
#endif
|
||||
|
||||
// The fmt library version in the form major * 10000 + minor * 100 + patch.
|
||||
#define FMT_VERSION 110104
|
||||
#define FMT_VERSION 110200
|
||||
|
||||
// Detect compiler versions.
|
||||
#if defined(__clang__) && !defined(__ibmxl__)
|
||||
@ -209,20 +209,6 @@
|
||||
# define FMT_DEPRECATED /* deprecated */
|
||||
#endif
|
||||
|
||||
#ifdef FMT_ALWAYS_INLINE
|
||||
// Use the provided definition.
|
||||
#elif FMT_GCC_VERSION || FMT_CLANG_VERSION
|
||||
# define FMT_ALWAYS_INLINE inline __attribute__((always_inline))
|
||||
#else
|
||||
# define FMT_ALWAYS_INLINE inline
|
||||
#endif
|
||||
// A version of FMT_ALWAYS_INLINE to prevent code bloat in debug mode.
|
||||
#ifdef NDEBUG
|
||||
# define FMT_INLINE FMT_ALWAYS_INLINE
|
||||
#else
|
||||
# define FMT_INLINE inline
|
||||
#endif
|
||||
|
||||
#if FMT_GCC_VERSION || FMT_CLANG_VERSION
|
||||
# define FMT_VISIBILITY(value) __attribute__((visibility(value)))
|
||||
#else
|
||||
@ -249,6 +235,28 @@
|
||||
# define FMT_MSC_WARNING(...)
|
||||
#endif
|
||||
|
||||
// Enable minimal optimizations for more compact code in debug mode.
|
||||
FMT_PRAGMA_GCC(push_options)
|
||||
#if !defined(__OPTIMIZE__) && !defined(__CUDACC__) && !defined(FMT_MODULE)
|
||||
FMT_PRAGMA_GCC(optimize("Og"))
|
||||
# define FMT_GCC_OPTIMIZED
|
||||
#endif
|
||||
FMT_PRAGMA_CLANG(diagnostic push)
|
||||
|
||||
#ifdef FMT_ALWAYS_INLINE
|
||||
// Use the provided definition.
|
||||
#elif FMT_GCC_VERSION || FMT_CLANG_VERSION
|
||||
# define FMT_ALWAYS_INLINE inline __attribute__((always_inline))
|
||||
#else
|
||||
# define FMT_ALWAYS_INLINE inline
|
||||
#endif
|
||||
// A version of FMT_ALWAYS_INLINE to prevent code bloat in debug mode.
|
||||
#if defined(NDEBUG) || defined(FMT_GCC_OPTIMIZED)
|
||||
# define FMT_INLINE FMT_ALWAYS_INLINE
|
||||
#else
|
||||
# define FMT_INLINE inline
|
||||
#endif
|
||||
|
||||
#ifndef FMT_BEGIN_NAMESPACE
|
||||
# define FMT_BEGIN_NAMESPACE \
|
||||
namespace fmt { \
|
||||
@ -297,13 +305,6 @@
|
||||
using unused = int[]; \
|
||||
(void)unused { 0, (expr, 0)... }
|
||||
|
||||
// Enable minimal optimizations for more compact code in debug mode.
|
||||
FMT_PRAGMA_GCC(push_options)
|
||||
#if !defined(__OPTIMIZE__) && !defined(__CUDACC__) && !defined(FMT_MODULE)
|
||||
FMT_PRAGMA_GCC(optimize("Og"))
|
||||
#endif
|
||||
FMT_PRAGMA_CLANG(diagnostic push)
|
||||
|
||||
FMT_BEGIN_NAMESPACE
|
||||
|
||||
// Implementations of enable_if_t and other metafunctions for older systems.
|
||||
@ -325,8 +326,8 @@ using underlying_t = typename std::underlying_type<T>::type;
|
||||
template <typename T> using decay_t = typename std::decay<T>::type;
|
||||
using nullptr_t = decltype(nullptr);
|
||||
|
||||
#if FMT_GCC_VERSION && FMT_GCC_VERSION < 500
|
||||
// A workaround for gcc 4.9 to make void_t work in a SFINAE context.
|
||||
#if (FMT_GCC_VERSION && FMT_GCC_VERSION < 500) || FMT_MSC_VERSION
|
||||
// A workaround for gcc 4.9 & MSVC v141 to make void_t work in a SFINAE context.
|
||||
template <typename...> struct void_t_impl {
|
||||
using type = void;
|
||||
};
|
||||
@ -526,20 +527,20 @@ template <typename Char> class basic_string_view {
|
||||
|
||||
constexpr basic_string_view() noexcept : data_(nullptr), size_(0) {}
|
||||
|
||||
/// Constructs a string reference object from a C string and a size.
|
||||
/// Constructs a string view object from a C string and a size.
|
||||
constexpr basic_string_view(const Char* s, size_t count) noexcept
|
||||
: data_(s), size_(count) {}
|
||||
|
||||
constexpr basic_string_view(nullptr_t) = delete;
|
||||
|
||||
/// Constructs a string reference object from a C string.
|
||||
/// Constructs a string view object from a C string.
|
||||
#if FMT_GCC_VERSION
|
||||
FMT_ALWAYS_INLINE
|
||||
#endif
|
||||
FMT_CONSTEXPR20 basic_string_view(const Char* s) : data_(s) {
|
||||
#if FMT_HAS_BUILTIN(__builtin_strlen) || FMT_GCC_VERSION || FMT_CLANG_VERSION
|
||||
if (std::is_same<Char, char>::value) {
|
||||
size_ = __builtin_strlen(detail::narrow(s));
|
||||
if (std::is_same<Char, char>::value && !detail::is_constant_evaluated()) {
|
||||
size_ = __builtin_strlen(detail::narrow(s)); // strlen is not costexpr.
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
@ -548,7 +549,7 @@ template <typename Char> class basic_string_view {
|
||||
size_ = len;
|
||||
}
|
||||
|
||||
/// Constructs a string reference from a `std::basic_string` or a
|
||||
/// Constructs a string view from a `std::basic_string` or a
|
||||
/// `std::basic_string_view` object.
|
||||
template <typename S,
|
||||
FMT_ENABLE_IF(detail::is_std_string_like<S>::value&& std::is_same<
|
||||
@ -585,7 +586,6 @@ template <typename Char> class basic_string_view {
|
||||
return starts_with(basic_string_view<Char>(s));
|
||||
}
|
||||
|
||||
// Lexicographically compare this string reference to other.
|
||||
FMT_CONSTEXPR auto compare(basic_string_view other) const -> int {
|
||||
int result =
|
||||
detail::compare(data_, other.data_, min_of(size_, other.size_));
|
||||
@ -616,7 +616,7 @@ template <typename Char> class basic_string_view {
|
||||
|
||||
using string_view = basic_string_view<char>;
|
||||
|
||||
/// Specifies if `T` is an extended character type. Can be specialized by users.
|
||||
// DEPRECATED! Will be merged with is_char and moved to detail.
|
||||
template <typename T> struct is_xchar : std::false_type {};
|
||||
template <> struct is_xchar<wchar_t> : std::true_type {};
|
||||
template <> struct is_xchar<char16_t> : std::true_type {};
|
||||
@ -625,7 +625,7 @@ template <> struct is_xchar<char32_t> : std::true_type {};
|
||||
template <> struct is_xchar<char8_t> : std::true_type {};
|
||||
#endif
|
||||
|
||||
// DEPRECATED! Will be replaced with an alias to prevent specializations.
|
||||
// Specifies if `T` is a character (code unit) type.
|
||||
template <typename T> struct is_char : is_xchar<T> {};
|
||||
template <> struct is_char<char> : std::true_type {};
|
||||
|
||||
@ -1032,6 +1032,11 @@ enum {
|
||||
|
||||
struct view {};
|
||||
|
||||
template <typename T, typename Enable = std::true_type>
|
||||
struct is_view : std::false_type {};
|
||||
template <typename T>
|
||||
struct is_view<T, bool_constant<sizeof(T) != 0>> : std::is_base_of<view, T> {};
|
||||
|
||||
template <typename Char, typename T> struct named_arg;
|
||||
template <typename T> struct is_named_arg : std::false_type {};
|
||||
template <typename T> struct is_static_named_arg : std::false_type {};
|
||||
@ -1064,6 +1069,16 @@ template <typename Char> struct named_arg_info {
|
||||
int id;
|
||||
};
|
||||
|
||||
// named_args is non-const to suppress a bogus -Wmaybe-uninitalized in gcc 13.
|
||||
template <typename Char>
|
||||
FMT_CONSTEXPR void check_for_duplicate(named_arg_info<Char>* named_args,
|
||||
int named_arg_index,
|
||||
basic_string_view<Char> arg_name) {
|
||||
for (int i = 0; i < named_arg_index; ++i) {
|
||||
if (named_args[i].name == arg_name) report_error("duplicate named arg");
|
||||
}
|
||||
}
|
||||
|
||||
template <typename Char, typename T, FMT_ENABLE_IF(!is_named_arg<T>::value)>
|
||||
void init_named_arg(named_arg_info<Char>*, int& arg_index, int&, const T&) {
|
||||
++arg_index;
|
||||
@ -1071,6 +1086,7 @@ void init_named_arg(named_arg_info<Char>*, int& arg_index, int&, const T&) {
|
||||
template <typename Char, typename T, FMT_ENABLE_IF(is_named_arg<T>::value)>
|
||||
void init_named_arg(named_arg_info<Char>* named_args, int& arg_index,
|
||||
int& named_arg_index, const T& arg) {
|
||||
check_for_duplicate<Char>(named_args, named_arg_index, arg.name);
|
||||
named_args[named_arg_index++] = {arg.name, arg_index++};
|
||||
}
|
||||
|
||||
@ -1084,12 +1100,13 @@ template <typename T, typename Char,
|
||||
FMT_ENABLE_IF(is_static_named_arg<T>::value)>
|
||||
FMT_CONSTEXPR void init_static_named_arg(named_arg_info<Char>* named_args,
|
||||
int& arg_index, int& named_arg_index) {
|
||||
check_for_duplicate<Char>(named_args, named_arg_index, T::name);
|
||||
named_args[named_arg_index++] = {T::name, arg_index++};
|
||||
}
|
||||
|
||||
// To minimize the number of types we need to deal with, long is translated
|
||||
// either to int or to long long depending on its size.
|
||||
enum { long_short = sizeof(long) == sizeof(int) };
|
||||
enum { long_short = sizeof(long) == sizeof(int) && FMT_BUILTIN_TYPES };
|
||||
using long_type = conditional_t<long_short, int, long long>;
|
||||
using ulong_type = conditional_t<long_short, unsigned, unsigned long long>;
|
||||
|
||||
@ -1706,7 +1723,17 @@ class format_string_checker {
|
||||
-> const Char* {
|
||||
context_.advance_to(begin);
|
||||
if (id >= 0 && id < NUM_ARGS) return parse_funcs_[id](context_);
|
||||
while (begin != end && *begin != '}') ++begin;
|
||||
|
||||
// If id is out of range, it means we do not know the type and cannot parse
|
||||
// the format at compile time. Instead, skip over content until we finish
|
||||
// the format spec, accounting for any nested replacements.
|
||||
for (int bracket_count = 0;
|
||||
begin != end && (bracket_count > 0 || *begin != '}'); ++begin) {
|
||||
if (*begin == '{')
|
||||
++bracket_count;
|
||||
else if (*begin == '}')
|
||||
--bracket_count;
|
||||
}
|
||||
return begin;
|
||||
}
|
||||
|
||||
@ -2703,7 +2730,7 @@ template <typename... T> struct fstring {
|
||||
template <size_t N>
|
||||
FMT_CONSTEVAL FMT_ALWAYS_INLINE fstring(const char (&s)[N]) : str(s, N - 1) {
|
||||
using namespace detail;
|
||||
static_assert(count<(std::is_base_of<view, remove_reference_t<T>>::value &&
|
||||
static_assert(count<(is_view<remove_cvref_t<T>>::value &&
|
||||
std::is_reference<T>::value)...>() == 0,
|
||||
"passing views as lvalues is disallowed");
|
||||
if (FMT_USE_CONSTEVAL) parse_format_string<char>(s, checker(s, arg_pack()));
|
||||
|
408
extlib/fmt/include/fmt/chrono.h
vendored
408
extlib/fmt/include/fmt/chrono.h
vendored
@ -22,21 +22,6 @@
|
||||
|
||||
#include "format.h"
|
||||
|
||||
namespace fmt_detail {
|
||||
struct time_zone {
|
||||
template <typename Duration, typename T>
|
||||
auto to_sys(T)
|
||||
-> std::chrono::time_point<std::chrono::system_clock, Duration> {
|
||||
return {};
|
||||
}
|
||||
};
|
||||
template <typename... T> inline auto current_zone(T...) -> time_zone* {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
template <typename... T> inline void _tzset(T...) {}
|
||||
} // namespace fmt_detail
|
||||
|
||||
FMT_BEGIN_NAMESPACE
|
||||
|
||||
// Enable safe chrono durations, unless explicitly disabled.
|
||||
@ -435,14 +420,11 @@ auto write(OutputIt out, const std::tm& time, const std::locale& loc,
|
||||
return write_encoded_tm_str(out, string_view(buf.data(), buf.size()), loc);
|
||||
}
|
||||
|
||||
template <typename Rep1, typename Rep2>
|
||||
struct is_same_arithmetic_type
|
||||
: public std::integral_constant<bool,
|
||||
(std::is_integral<Rep1>::value &&
|
||||
std::is_integral<Rep2>::value) ||
|
||||
(std::is_floating_point<Rep1>::value &&
|
||||
std::is_floating_point<Rep2>::value)> {
|
||||
};
|
||||
template <typename T, typename U>
|
||||
using is_similar_arithmetic_type =
|
||||
bool_constant<(std::is_integral<T>::value && std::is_integral<U>::value) ||
|
||||
(std::is_floating_point<T>::value &&
|
||||
std::is_floating_point<U>::value)>;
|
||||
|
||||
FMT_NORETURN inline void throw_duration_error() {
|
||||
FMT_THROW(format_error("cannot format duration"));
|
||||
@ -501,9 +483,9 @@ auto duration_cast(std::chrono::duration<FromRep, FromPeriod> from) -> To {
|
||||
#endif
|
||||
}
|
||||
|
||||
template <
|
||||
typename To, typename FromRep, typename FromPeriod,
|
||||
FMT_ENABLE_IF(!is_same_arithmetic_type<FromRep, typename To::rep>::value)>
|
||||
template <typename To, typename FromRep, typename FromPeriod,
|
||||
FMT_ENABLE_IF(
|
||||
!is_similar_arithmetic_type<FromRep, typename To::rep>::value)>
|
||||
auto duration_cast(std::chrono::duration<FromRep, FromPeriod> from) -> To {
|
||||
// Mixed integer <-> float cast is not supported by safe_duration_cast.
|
||||
return std::chrono::duration_cast<To>(from);
|
||||
@ -519,12 +501,30 @@ auto to_time_t(sys_time<Duration> time_point) -> std::time_t {
|
||||
.count();
|
||||
}
|
||||
|
||||
// Workaround a bug in libstdc++ which sets __cpp_lib_chrono to 201907 without
|
||||
// providing current_zone(): https://github.com/fmtlib/fmt/issues/4160.
|
||||
template <typename T> FMT_CONSTEXPR auto has_current_zone() -> bool {
|
||||
using namespace std::chrono;
|
||||
using namespace fmt_detail;
|
||||
return !std::is_same<decltype(current_zone()), fmt_detail::time_zone*>::value;
|
||||
namespace tz {
|
||||
|
||||
// DEPRECATED!
|
||||
struct time_zone {
|
||||
template <typename Duration, typename LocalTime>
|
||||
auto to_sys(LocalTime) -> sys_time<Duration> {
|
||||
return {};
|
||||
}
|
||||
};
|
||||
template <typename... T> auto current_zone(T...) -> time_zone* {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
template <typename... T> void _tzset(T...) {}
|
||||
} // namespace tz
|
||||
|
||||
// DEPRECATED!
|
||||
inline void tzset_once() {
|
||||
static bool init = []() {
|
||||
using namespace tz;
|
||||
_tzset();
|
||||
return false;
|
||||
}();
|
||||
ignore_unused(init);
|
||||
}
|
||||
} // namespace detail
|
||||
|
||||
@ -535,7 +535,7 @@ FMT_BEGIN_EXPORT
|
||||
* expressed in local time. Unlike `std::localtime`, this function is
|
||||
* thread-safe on most platforms.
|
||||
*/
|
||||
inline auto localtime(std::time_t time) -> std::tm {
|
||||
FMT_DEPRECATED inline auto localtime(std::time_t time) -> std::tm {
|
||||
struct dispatcher {
|
||||
std::time_t time_;
|
||||
std::tm tm_;
|
||||
@ -572,11 +572,11 @@ inline auto localtime(std::time_t time) -> std::tm {
|
||||
}
|
||||
|
||||
#if FMT_USE_LOCAL_TIME
|
||||
template <typename Duration,
|
||||
FMT_ENABLE_IF(detail::has_current_zone<Duration>())>
|
||||
inline auto localtime(std::chrono::local_time<Duration> time) -> std::tm {
|
||||
template <typename Duration>
|
||||
FMT_DEPRECATED auto localtime(std::chrono::local_time<Duration> time)
|
||||
-> std::tm {
|
||||
using namespace std::chrono;
|
||||
using namespace fmt_detail;
|
||||
using namespace detail::tz;
|
||||
return localtime(detail::to_time_t(current_zone()->to_sys<Duration>(time)));
|
||||
}
|
||||
#endif
|
||||
@ -911,7 +911,14 @@ template <typename Derived> struct null_chrono_spec_handler {
|
||||
FMT_CONSTEXPR void on_tz_name() { unsupported(); }
|
||||
};
|
||||
|
||||
struct tm_format_checker : null_chrono_spec_handler<tm_format_checker> {
|
||||
class tm_format_checker : public null_chrono_spec_handler<tm_format_checker> {
|
||||
private:
|
||||
bool has_timezone_ = false;
|
||||
|
||||
public:
|
||||
constexpr explicit tm_format_checker(bool has_timezone)
|
||||
: has_timezone_(has_timezone) {}
|
||||
|
||||
FMT_NORETURN inline void unsupported() {
|
||||
FMT_THROW(format_error("no format"));
|
||||
}
|
||||
@ -949,8 +956,12 @@ struct tm_format_checker : null_chrono_spec_handler<tm_format_checker> {
|
||||
FMT_CONSTEXPR void on_24_hour_time() {}
|
||||
FMT_CONSTEXPR void on_iso_time() {}
|
||||
FMT_CONSTEXPR void on_am_pm() {}
|
||||
FMT_CONSTEXPR void on_utc_offset(numeric_system) {}
|
||||
FMT_CONSTEXPR void on_tz_name() {}
|
||||
FMT_CONSTEXPR void on_utc_offset(numeric_system) {
|
||||
if (!has_timezone_) FMT_THROW(format_error("no timezone"));
|
||||
}
|
||||
FMT_CONSTEXPR void on_tz_name() {
|
||||
if (!has_timezone_) FMT_THROW(format_error("no timezone"));
|
||||
}
|
||||
};
|
||||
|
||||
inline auto tm_wday_full_name(int wday) -> const char* {
|
||||
@ -980,24 +991,27 @@ inline auto tm_mon_short_name(int mon) -> const char* {
|
||||
}
|
||||
|
||||
template <typename T, typename = void>
|
||||
struct has_member_data_tm_gmtoff : std::false_type {};
|
||||
struct has_tm_gmtoff : std::false_type {};
|
||||
template <typename T>
|
||||
struct has_member_data_tm_gmtoff<T, void_t<decltype(T::tm_gmtoff)>>
|
||||
: std::true_type {};
|
||||
struct has_tm_gmtoff<T, void_t<decltype(T::tm_gmtoff)>> : std::true_type {};
|
||||
|
||||
template <typename T, typename = void>
|
||||
struct has_member_data_tm_zone : std::false_type {};
|
||||
template <typename T, typename = void> struct has_tm_zone : std::false_type {};
|
||||
template <typename T>
|
||||
struct has_member_data_tm_zone<T, void_t<decltype(T::tm_zone)>>
|
||||
: std::true_type {};
|
||||
struct has_tm_zone<T, void_t<decltype(T::tm_zone)>> : std::true_type {};
|
||||
|
||||
inline void tzset_once() {
|
||||
static bool init = []() {
|
||||
using namespace fmt_detail;
|
||||
_tzset();
|
||||
return false;
|
||||
}();
|
||||
ignore_unused(init);
|
||||
template <typename T, FMT_ENABLE_IF(has_tm_zone<T>::value)>
|
||||
bool set_tm_zone(T& time, char* tz) {
|
||||
time.tm_zone = tz;
|
||||
return true;
|
||||
}
|
||||
template <typename T, FMT_ENABLE_IF(!has_tm_zone<T>::value)>
|
||||
bool set_tm_zone(T&, char*) {
|
||||
return false;
|
||||
}
|
||||
|
||||
inline char* utc() {
|
||||
static char tz[] = "UTC";
|
||||
return tz;
|
||||
}
|
||||
|
||||
// Converts value to Int and checks that it's in the range [0, upper).
|
||||
@ -1005,7 +1019,7 @@ template <typename T, typename Int, FMT_ENABLE_IF(std::is_integral<T>::value)>
|
||||
inline auto to_nonnegative_int(T value, Int upper) -> Int {
|
||||
if (!std::is_unsigned<Int>::value &&
|
||||
(value < 0 || to_unsigned(value) > to_unsigned(upper))) {
|
||||
FMT_THROW(fmt::format_error("chrono value is out of range"));
|
||||
FMT_THROW(format_error("chrono value is out of range"));
|
||||
}
|
||||
return static_cast<Int>(value);
|
||||
}
|
||||
@ -1090,7 +1104,7 @@ void write_fractional_seconds(OutputIt& out, Duration d, int precision = -1) {
|
||||
|
||||
// Format subseconds which are given as a floating point type with an
|
||||
// appropriate number of digits. We cannot pass the Duration here, as we
|
||||
// explicitly need to pass the Rep value in the chrono_formatter.
|
||||
// explicitly need to pass the Rep value in the duration_formatter.
|
||||
template <typename Duration>
|
||||
void write_floating_seconds(memory_buffer& buf, Duration duration,
|
||||
int num_fractional_digits = -1) {
|
||||
@ -1124,7 +1138,7 @@ class tm_writer {
|
||||
static constexpr int days_per_week = 7;
|
||||
|
||||
const std::locale& loc_;
|
||||
const bool is_classic_;
|
||||
bool is_classic_;
|
||||
OutputIt out_;
|
||||
const Duration* subsecs_;
|
||||
const std::tm& tm_;
|
||||
@ -1160,8 +1174,8 @@ class tm_writer {
|
||||
}
|
||||
|
||||
auto tm_hour12() const noexcept -> int {
|
||||
const auto h = tm_hour();
|
||||
const auto z = h < 12 ? h : h - 12;
|
||||
auto h = tm_hour();
|
||||
auto z = h < 12 ? h : h - 12;
|
||||
return z == 0 ? 12 : z;
|
||||
}
|
||||
|
||||
@ -1177,11 +1191,11 @@ class tm_writer {
|
||||
|
||||
// Algorithm: https://en.wikipedia.org/wiki/ISO_week_date.
|
||||
auto iso_year_weeks(long long curr_year) const noexcept -> int {
|
||||
const auto prev_year = curr_year - 1;
|
||||
const auto curr_p =
|
||||
auto prev_year = curr_year - 1;
|
||||
auto curr_p =
|
||||
(curr_year + curr_year / 4 - curr_year / 100 + curr_year / 400) %
|
||||
days_per_week;
|
||||
const auto prev_p =
|
||||
auto prev_p =
|
||||
(prev_year + prev_year / 4 - prev_year / 100 + prev_year / 400) %
|
||||
days_per_week;
|
||||
return 52 + ((curr_p == 4 || prev_p == 3) ? 1 : 0);
|
||||
@ -1191,15 +1205,15 @@ class tm_writer {
|
||||
days_per_week;
|
||||
}
|
||||
auto tm_iso_week_year() const noexcept -> long long {
|
||||
const auto year = tm_year();
|
||||
const auto w = iso_week_num(tm_yday(), tm_wday());
|
||||
auto year = tm_year();
|
||||
auto w = iso_week_num(tm_yday(), tm_wday());
|
||||
if (w < 1) return year - 1;
|
||||
if (w > iso_year_weeks(year)) return year + 1;
|
||||
return year;
|
||||
}
|
||||
auto tm_iso_week_of_year() const noexcept -> int {
|
||||
const auto year = tm_year();
|
||||
const auto w = iso_week_num(tm_yday(), tm_wday());
|
||||
auto year = tm_year();
|
||||
auto w = iso_week_num(tm_yday(), tm_wday());
|
||||
if (w < 1) return iso_year_weeks(year - 1);
|
||||
if (w > iso_year_weeks(year)) return 1;
|
||||
return w;
|
||||
@ -1236,9 +1250,8 @@ class tm_writer {
|
||||
uint32_or_64_or_128_t<long long> n = to_unsigned(year);
|
||||
const int num_digits = count_digits(n);
|
||||
if (negative && pad == pad_type::zero) *out_++ = '-';
|
||||
if (width > num_digits) {
|
||||
if (width > num_digits)
|
||||
out_ = detail::write_padding(out_, pad, width - num_digits);
|
||||
}
|
||||
if (negative && pad != pad_type::zero) *out_++ = '-';
|
||||
out_ = format_decimal<Char>(out_, n, num_digits);
|
||||
}
|
||||
@ -1259,45 +1272,22 @@ class tm_writer {
|
||||
write2(static_cast<int>(offset % 60));
|
||||
}
|
||||
|
||||
template <typename T, FMT_ENABLE_IF(has_member_data_tm_gmtoff<T>::value)>
|
||||
void format_utc_offset_impl(const T& tm, numeric_system ns) {
|
||||
template <typename T, FMT_ENABLE_IF(has_tm_gmtoff<T>::value)>
|
||||
void format_utc_offset(const T& tm, numeric_system ns) {
|
||||
write_utc_offset(tm.tm_gmtoff, ns);
|
||||
}
|
||||
template <typename T, FMT_ENABLE_IF(!has_member_data_tm_gmtoff<T>::value)>
|
||||
void format_utc_offset_impl(const T& tm, numeric_system ns) {
|
||||
#if defined(_WIN32) && defined(_UCRT)
|
||||
tzset_once();
|
||||
long offset = 0;
|
||||
_get_timezone(&offset);
|
||||
if (tm.tm_isdst) {
|
||||
long dstbias = 0;
|
||||
_get_dstbias(&dstbias);
|
||||
offset += dstbias;
|
||||
}
|
||||
write_utc_offset(-offset, ns);
|
||||
#else
|
||||
if (ns == numeric_system::standard) return format_localized('z');
|
||||
|
||||
// Extract timezone offset from timezone conversion functions.
|
||||
std::tm gtm = tm;
|
||||
std::time_t gt = std::mktime(>m);
|
||||
std::tm ltm = gmtime(gt);
|
||||
std::time_t lt = std::mktime(<m);
|
||||
long long offset = gt - lt;
|
||||
write_utc_offset(offset, ns);
|
||||
#endif
|
||||
template <typename T, FMT_ENABLE_IF(!has_tm_gmtoff<T>::value)>
|
||||
void format_utc_offset(const T&, numeric_system ns) {
|
||||
write_utc_offset(0, ns);
|
||||
}
|
||||
|
||||
template <typename T, FMT_ENABLE_IF(has_member_data_tm_zone<T>::value)>
|
||||
void format_tz_name_impl(const T& tm) {
|
||||
if (is_classic_)
|
||||
out_ = write_tm_str<Char>(out_, tm.tm_zone, loc_);
|
||||
else
|
||||
format_localized('Z');
|
||||
template <typename T, FMT_ENABLE_IF(has_tm_zone<T>::value)>
|
||||
void format_tz_name(const T& tm) {
|
||||
out_ = write_tm_str<Char>(out_, tm.tm_zone, loc_);
|
||||
}
|
||||
template <typename T, FMT_ENABLE_IF(!has_member_data_tm_zone<T>::value)>
|
||||
void format_tz_name_impl(const T&) {
|
||||
format_localized('Z');
|
||||
template <typename T, FMT_ENABLE_IF(!has_tm_zone<T>::value)>
|
||||
void format_tz_name(const T&) {
|
||||
out_ = std::copy_n(utc(), 3, out_);
|
||||
}
|
||||
|
||||
void format_localized(char format, char modifier = 0) {
|
||||
@ -1408,8 +1398,8 @@ class tm_writer {
|
||||
out_ = copy<Char>(std::begin(buf) + offset, std::end(buf), out_);
|
||||
}
|
||||
|
||||
void on_utc_offset(numeric_system ns) { format_utc_offset_impl(tm_, ns); }
|
||||
void on_tz_name() { format_tz_name_impl(tm_); }
|
||||
void on_utc_offset(numeric_system ns) { format_utc_offset(tm_, ns); }
|
||||
void on_tz_name() { format_tz_name(tm_); }
|
||||
|
||||
void on_year(numeric_system ns, pad_type pad) {
|
||||
if (is_classic_ || ns == numeric_system::standard)
|
||||
@ -1483,11 +1473,10 @@ class tm_writer {
|
||||
void on_day_of_year(pad_type pad) {
|
||||
auto yday = tm_yday() + 1;
|
||||
auto digit1 = yday / 100;
|
||||
if (digit1 != 0) {
|
||||
if (digit1 != 0)
|
||||
write1(digit1);
|
||||
} else {
|
||||
else
|
||||
out_ = detail::write_padding(out_, pad);
|
||||
}
|
||||
write2(yday % 100, pad);
|
||||
}
|
||||
|
||||
@ -1624,18 +1613,16 @@ template <typename Rep, typename Period,
|
||||
FMT_ENABLE_IF(std::is_integral<Rep>::value)>
|
||||
inline auto get_milliseconds(std::chrono::duration<Rep, Period> d)
|
||||
-> std::chrono::duration<Rep, std::milli> {
|
||||
// this may overflow and/or the result may not fit in the
|
||||
// target type.
|
||||
// This may overflow and/or the result may not fit in the target type.
|
||||
#if FMT_SAFE_DURATION_CAST
|
||||
using CommonSecondsType =
|
||||
using common_seconds_type =
|
||||
typename std::common_type<decltype(d), std::chrono::seconds>::type;
|
||||
const auto d_as_common = detail::duration_cast<CommonSecondsType>(d);
|
||||
const auto d_as_whole_seconds =
|
||||
auto d_as_common = detail::duration_cast<common_seconds_type>(d);
|
||||
auto d_as_whole_seconds =
|
||||
detail::duration_cast<std::chrono::seconds>(d_as_common);
|
||||
// this conversion should be nonproblematic
|
||||
const auto diff = d_as_common - d_as_whole_seconds;
|
||||
const auto ms =
|
||||
detail::duration_cast<std::chrono::duration<Rep, std::milli>>(diff);
|
||||
// This conversion should be nonproblematic.
|
||||
auto diff = d_as_common - d_as_whole_seconds;
|
||||
auto ms = detail::duration_cast<std::chrono::duration<Rep, std::milli>>(diff);
|
||||
return ms;
|
||||
#else
|
||||
auto s = detail::duration_cast<std::chrono::seconds>(d);
|
||||
@ -1707,32 +1694,28 @@ class get_locale {
|
||||
}
|
||||
};
|
||||
|
||||
template <typename FormatContext, typename OutputIt, typename Rep,
|
||||
typename Period>
|
||||
struct chrono_formatter {
|
||||
FormatContext& context;
|
||||
OutputIt out;
|
||||
int precision;
|
||||
bool localized = false;
|
||||
template <typename Char, typename Rep, typename Period>
|
||||
struct duration_formatter {
|
||||
using iterator = basic_appender<Char>;
|
||||
iterator out;
|
||||
// rep is unsigned to avoid overflow.
|
||||
using rep =
|
||||
conditional_t<std::is_integral<Rep>::value && sizeof(Rep) < sizeof(int),
|
||||
unsigned, typename make_unsigned_or_unchanged<Rep>::type>;
|
||||
rep val;
|
||||
int precision;
|
||||
locale_ref locale;
|
||||
bool localized = false;
|
||||
using seconds = std::chrono::duration<rep>;
|
||||
seconds s;
|
||||
using milliseconds = std::chrono::duration<rep, std::milli>;
|
||||
bool negative;
|
||||
|
||||
using char_type = typename FormatContext::char_type;
|
||||
using tm_writer_type = tm_writer<OutputIt, char_type>;
|
||||
using tm_writer_type = tm_writer<iterator, Char>;
|
||||
|
||||
chrono_formatter(FormatContext& ctx, OutputIt o,
|
||||
std::chrono::duration<Rep, Period> d)
|
||||
: context(ctx),
|
||||
out(o),
|
||||
val(static_cast<rep>(d.count())),
|
||||
negative(false) {
|
||||
duration_formatter(iterator o, std::chrono::duration<Rep, Period> d,
|
||||
locale_ref loc)
|
||||
: out(o), val(static_cast<rep>(d.count())), locale(loc), negative(false) {
|
||||
if (d.count() < 0) {
|
||||
val = 0 - val;
|
||||
negative = true;
|
||||
@ -1746,19 +1729,16 @@ struct chrono_formatter {
|
||||
|
||||
// returns true if nan or inf, writes to out.
|
||||
auto handle_nan_inf() -> bool {
|
||||
if (isfinite(val)) {
|
||||
return false;
|
||||
}
|
||||
if (isfinite(val)) return false;
|
||||
if (isnan(val)) {
|
||||
write_nan();
|
||||
return true;
|
||||
}
|
||||
// must be +-inf
|
||||
if (val > 0) {
|
||||
write_pinf();
|
||||
} else {
|
||||
write_ninf();
|
||||
}
|
||||
if (val > 0)
|
||||
std::copy_n("inf", 3, out);
|
||||
else
|
||||
std::copy_n("-inf", 4, out);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -1786,10 +1766,9 @@ struct chrono_formatter {
|
||||
}
|
||||
|
||||
void write_sign() {
|
||||
if (negative) {
|
||||
*out++ = '-';
|
||||
negative = false;
|
||||
}
|
||||
if (!negative) return;
|
||||
*out++ = '-';
|
||||
negative = false;
|
||||
}
|
||||
|
||||
void write(Rep value, int width, pad_type pad = pad_type::zero) {
|
||||
@ -1801,24 +1780,22 @@ struct chrono_formatter {
|
||||
if (width > num_digits) {
|
||||
out = detail::write_padding(out, pad, width - num_digits);
|
||||
}
|
||||
out = format_decimal<char_type>(out, n, num_digits);
|
||||
out = format_decimal<Char>(out, n, num_digits);
|
||||
}
|
||||
|
||||
void write_nan() { std::copy_n("nan", 3, out); }
|
||||
void write_pinf() { std::copy_n("inf", 3, out); }
|
||||
void write_ninf() { std::copy_n("-inf", 4, out); }
|
||||
|
||||
template <typename Callback, typename... Args>
|
||||
void format_tm(const tm& time, Callback cb, Args... args) {
|
||||
if (isnan(val)) return write_nan();
|
||||
get_locale loc(localized, context.locale());
|
||||
get_locale loc(localized, locale);
|
||||
auto w = tm_writer_type(loc, out, time);
|
||||
(w.*cb)(args...);
|
||||
out = w.out();
|
||||
}
|
||||
|
||||
void on_text(const char_type* begin, const char_type* end) {
|
||||
copy<char_type>(begin, end, out);
|
||||
void on_text(const Char* begin, const Char* end) {
|
||||
copy<Char>(begin, end, out);
|
||||
}
|
||||
|
||||
// These are not implemented because durations don't have date information.
|
||||
@ -1888,13 +1865,12 @@ struct chrono_formatter {
|
||||
write_floating_seconds(buf, std::chrono::duration<rep, Period>(val),
|
||||
precision);
|
||||
if (negative) *out++ = '-';
|
||||
if (buf.size() < 2 || buf[1] == '.') {
|
||||
if (buf.size() < 2 || buf[1] == '.')
|
||||
out = detail::write_padding(out, pad);
|
||||
}
|
||||
out = copy<char_type>(buf.begin(), buf.end(), out);
|
||||
out = copy<Char>(buf.begin(), buf.end(), out);
|
||||
} else {
|
||||
write(second(), 2, pad);
|
||||
write_fractional_seconds<char_type>(
|
||||
write_fractional_seconds<Char>(
|
||||
out, std::chrono::duration<rep, Period>(val), precision);
|
||||
}
|
||||
return;
|
||||
@ -1936,12 +1912,10 @@ struct chrono_formatter {
|
||||
void on_duration_value() {
|
||||
if (handle_nan_inf()) return;
|
||||
write_sign();
|
||||
out = format_duration_value<char_type>(out, val, precision);
|
||||
out = format_duration_value<Char>(out, val, precision);
|
||||
}
|
||||
|
||||
void on_duration_unit() {
|
||||
out = format_duration_unit<char_type, Period>(out);
|
||||
}
|
||||
void on_duration_unit() { out = format_duration_unit<Char, Period>(out); }
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
@ -2011,12 +1985,11 @@ class year_month_day {
|
||||
constexpr auto month() const noexcept -> fmt::month { return month_; }
|
||||
constexpr auto day() const noexcept -> fmt::day { return day_; }
|
||||
};
|
||||
#endif
|
||||
#endif // __cpp_lib_chrono >= 201907
|
||||
|
||||
template <typename Char>
|
||||
struct formatter<weekday, Char> : private formatter<std::tm, Char> {
|
||||
private:
|
||||
bool localized_ = false;
|
||||
bool use_tm_formatter_ = false;
|
||||
|
||||
public:
|
||||
@ -2024,8 +1997,7 @@ struct formatter<weekday, Char> : private formatter<std::tm, Char> {
|
||||
auto it = ctx.begin(), end = ctx.end();
|
||||
if (it != end && *it == 'L') {
|
||||
++it;
|
||||
localized_ = true;
|
||||
return it;
|
||||
this->set_localized();
|
||||
}
|
||||
use_tm_formatter_ = it != end && *it != '}';
|
||||
return use_tm_formatter_ ? formatter<std::tm, Char>::parse(ctx) : it;
|
||||
@ -2036,7 +2008,7 @@ struct formatter<weekday, Char> : private formatter<std::tm, Char> {
|
||||
auto time = std::tm();
|
||||
time.tm_wday = static_cast<int>(wd.c_encoding());
|
||||
if (use_tm_formatter_) return formatter<std::tm, Char>::format(time, ctx);
|
||||
detail::get_locale loc(localized_, ctx.locale());
|
||||
detail::get_locale loc(this->localized(), ctx.locale());
|
||||
auto w = detail::tm_writer<decltype(ctx.out()), Char>(loc, ctx.out(), time);
|
||||
w.on_abbr_weekday();
|
||||
return w.out();
|
||||
@ -2070,7 +2042,6 @@ struct formatter<day, Char> : private formatter<std::tm, Char> {
|
||||
template <typename Char>
|
||||
struct formatter<month, Char> : private formatter<std::tm, Char> {
|
||||
private:
|
||||
bool localized_ = false;
|
||||
bool use_tm_formatter_ = false;
|
||||
|
||||
public:
|
||||
@ -2078,8 +2049,7 @@ struct formatter<month, Char> : private formatter<std::tm, Char> {
|
||||
auto it = ctx.begin(), end = ctx.end();
|
||||
if (it != end && *it == 'L') {
|
||||
++it;
|
||||
localized_ = true;
|
||||
return it;
|
||||
this->set_localized();
|
||||
}
|
||||
use_tm_formatter_ = it != end && *it != '}';
|
||||
return use_tm_formatter_ ? formatter<std::tm, Char>::parse(ctx) : it;
|
||||
@ -2090,7 +2060,7 @@ struct formatter<month, Char> : private formatter<std::tm, Char> {
|
||||
auto time = std::tm();
|
||||
time.tm_mon = static_cast<int>(static_cast<unsigned>(m)) - 1;
|
||||
if (use_tm_formatter_) return formatter<std::tm, Char>::format(time, ctx);
|
||||
detail::get_locale loc(localized_, ctx.locale());
|
||||
detail::get_locale loc(this->localized(), ctx.locale());
|
||||
auto w = detail::tm_writer<decltype(ctx.out()), Char>(loc, ctx.out(), time);
|
||||
w.on_abbr_month();
|
||||
return w.out();
|
||||
@ -2154,7 +2124,6 @@ struct formatter<std::chrono::duration<Rep, Period>, Char> {
|
||||
format_specs specs_;
|
||||
detail::arg_ref<Char> width_ref_;
|
||||
detail::arg_ref<Char> precision_ref_;
|
||||
bool localized_ = false;
|
||||
basic_string_view<Char> fmt_;
|
||||
|
||||
public:
|
||||
@ -2177,7 +2146,7 @@ struct formatter<std::chrono::duration<Rep, Period>, Char> {
|
||||
it = detail::parse_precision(it, end, specs_, precision_ref_, ctx);
|
||||
}
|
||||
if (it != end && *it == 'L') {
|
||||
localized_ = true;
|
||||
specs_.set_localized();
|
||||
++it;
|
||||
}
|
||||
end = detail::parse_chrono_format(it, end, checker);
|
||||
@ -2204,11 +2173,10 @@ struct formatter<std::chrono::duration<Rep, Period>, Char> {
|
||||
out = detail::format_duration_value<Char>(out, d.count(), precision);
|
||||
detail::format_duration_unit<Char, Period>(out);
|
||||
} else {
|
||||
using chrono_formatter =
|
||||
detail::chrono_formatter<FormatContext, decltype(out), Rep, Period>;
|
||||
auto f = chrono_formatter(ctx, out, d);
|
||||
auto f =
|
||||
detail::duration_formatter<Char, Rep, Period>(out, d, ctx.locale());
|
||||
f.precision = precision;
|
||||
f.localized = localized_;
|
||||
f.localized = specs_.localized();
|
||||
detail::parse_chrono_format(begin, end, f);
|
||||
}
|
||||
return detail::write(
|
||||
@ -2220,30 +2188,15 @@ template <typename Char> struct formatter<std::tm, Char> {
|
||||
private:
|
||||
format_specs specs_;
|
||||
detail::arg_ref<Char> width_ref_;
|
||||
basic_string_view<Char> fmt_ =
|
||||
detail::string_literal<Char, '%', 'F', ' ', '%', 'T'>();
|
||||
|
||||
protected:
|
||||
basic_string_view<Char> fmt_;
|
||||
auto localized() const -> bool { return specs_.localized(); }
|
||||
FMT_CONSTEXPR void set_localized() { specs_.set_localized(); }
|
||||
|
||||
template <typename Duration, typename FormatContext>
|
||||
auto do_format(const std::tm& tm, FormatContext& ctx,
|
||||
const Duration* subsecs) const -> decltype(ctx.out()) {
|
||||
auto specs = specs_;
|
||||
auto buf = basic_memory_buffer<Char>();
|
||||
auto out = basic_appender<Char>(buf);
|
||||
detail::handle_dynamic_spec(specs.dynamic_width(), specs.width, width_ref_,
|
||||
ctx);
|
||||
|
||||
auto loc_ref = ctx.locale();
|
||||
detail::get_locale loc(static_cast<bool>(loc_ref), loc_ref);
|
||||
auto w =
|
||||
detail::tm_writer<decltype(out), Char, Duration>(loc, out, tm, subsecs);
|
||||
detail::parse_chrono_format(fmt_.begin(), fmt_.end(), w);
|
||||
return detail::write(
|
||||
ctx.out(), basic_string_view<Char>(buf.data(), buf.size()), specs);
|
||||
}
|
||||
|
||||
public:
|
||||
FMT_CONSTEXPR auto parse(parse_context<Char>& ctx) -> const Char* {
|
||||
FMT_CONSTEXPR auto do_parse(parse_context<Char>& ctx, bool has_timezone)
|
||||
-> const Char* {
|
||||
auto it = ctx.begin(), end = ctx.end();
|
||||
if (it == end || *it == '}') return it;
|
||||
|
||||
@ -2256,12 +2209,41 @@ template <typename Char> struct formatter<std::tm, Char> {
|
||||
if (it == end) return it;
|
||||
}
|
||||
|
||||
end = detail::parse_chrono_format(it, end, detail::tm_format_checker());
|
||||
if (*it == 'L') {
|
||||
specs_.set_localized();
|
||||
++it;
|
||||
}
|
||||
|
||||
end = detail::parse_chrono_format(it, end,
|
||||
detail::tm_format_checker(has_timezone));
|
||||
// Replace the default format string only if the new spec is not empty.
|
||||
if (end != it) fmt_ = {it, detail::to_unsigned(end - it)};
|
||||
return end;
|
||||
}
|
||||
|
||||
template <typename Duration, typename FormatContext>
|
||||
auto do_format(const std::tm& tm, FormatContext& ctx,
|
||||
const Duration* subsecs) const -> decltype(ctx.out()) {
|
||||
auto specs = specs_;
|
||||
auto buf = basic_memory_buffer<Char>();
|
||||
auto out = basic_appender<Char>(buf);
|
||||
detail::handle_dynamic_spec(specs.dynamic_width(), specs.width, width_ref_,
|
||||
ctx);
|
||||
|
||||
auto loc_ref = specs.localized() ? ctx.locale() : detail::locale_ref();
|
||||
detail::get_locale loc(static_cast<bool>(loc_ref), loc_ref);
|
||||
auto w = detail::tm_writer<basic_appender<Char>, Char, Duration>(
|
||||
loc, out, tm, subsecs);
|
||||
detail::parse_chrono_format(fmt_.begin(), fmt_.end(), w);
|
||||
return detail::write(
|
||||
ctx.out(), basic_string_view<Char>(buf.data(), buf.size()), specs);
|
||||
}
|
||||
|
||||
public:
|
||||
FMT_CONSTEXPR auto parse(parse_context<Char>& ctx) -> const Char* {
|
||||
return do_parse(ctx, detail::has_tm_gmtoff<std::tm>::value);
|
||||
}
|
||||
|
||||
template <typename FormatContext>
|
||||
auto format(const std::tm& tm, FormatContext& ctx) const
|
||||
-> decltype(ctx.out()) {
|
||||
@ -2269,10 +2251,11 @@ template <typename Char> struct formatter<std::tm, Char> {
|
||||
}
|
||||
};
|
||||
|
||||
// DEPRECATED! Reversed order of template parameters.
|
||||
template <typename Char, typename Duration>
|
||||
struct formatter<sys_time<Duration>, Char> : formatter<std::tm, Char> {
|
||||
FMT_CONSTEXPR formatter() {
|
||||
this->fmt_ = detail::string_literal<Char, '%', 'F', ' ', '%', 'T'>();
|
||||
struct formatter<sys_time<Duration>, Char> : private formatter<std::tm, Char> {
|
||||
FMT_CONSTEXPR auto parse(parse_context<Char>& ctx) -> const Char* {
|
||||
return this->do_parse(ctx, true);
|
||||
}
|
||||
|
||||
template <typename FormatContext>
|
||||
@ -2283,6 +2266,7 @@ struct formatter<sys_time<Duration>, Char> : formatter<std::tm, Char> {
|
||||
if (detail::const_check(
|
||||
period::num == 1 && period::den == 1 &&
|
||||
!std::is_floating_point<typename Duration::rep>::value)) {
|
||||
detail::set_tm_zone(tm, detail::utc());
|
||||
return formatter<std::tm, Char>::format(tm, ctx);
|
||||
}
|
||||
Duration epoch = val.time_since_epoch();
|
||||
@ -2290,11 +2274,13 @@ struct formatter<sys_time<Duration>, Char> : formatter<std::tm, Char> {
|
||||
epoch - detail::duration_cast<std::chrono::seconds>(epoch));
|
||||
if (subsecs.count() < 0) {
|
||||
auto second = detail::duration_cast<Duration>(std::chrono::seconds(1));
|
||||
if (tm.tm_sec != 0)
|
||||
if (tm.tm_sec != 0) {
|
||||
--tm.tm_sec;
|
||||
else
|
||||
} else {
|
||||
tm = gmtime(val - second);
|
||||
subsecs += detail::duration_cast<Duration>(std::chrono::seconds(1));
|
||||
detail::set_tm_zone(tm, detail::utc());
|
||||
}
|
||||
subsecs += second;
|
||||
}
|
||||
return formatter<std::tm, Char>::do_format(tm, ctx, &subsecs);
|
||||
}
|
||||
@ -2312,23 +2298,29 @@ struct formatter<utc_time<Duration>, Char>
|
||||
};
|
||||
|
||||
template <typename Duration, typename Char>
|
||||
struct formatter<local_time<Duration>, Char> : formatter<std::tm, Char> {
|
||||
FMT_CONSTEXPR formatter() {
|
||||
this->fmt_ = detail::string_literal<Char, '%', 'F', ' ', '%', 'T'>();
|
||||
struct formatter<local_time<Duration>, Char>
|
||||
: private formatter<std::tm, Char> {
|
||||
FMT_CONSTEXPR auto parse(parse_context<Char>& ctx) -> const Char* {
|
||||
return this->do_parse(ctx, false);
|
||||
}
|
||||
|
||||
template <typename FormatContext>
|
||||
auto format(local_time<Duration> val, FormatContext& ctx) const
|
||||
-> decltype(ctx.out()) {
|
||||
auto time_since_epoch = val.time_since_epoch();
|
||||
auto seconds_since_epoch =
|
||||
detail::duration_cast<std::chrono::seconds>(time_since_epoch);
|
||||
// Use gmtime to prevent time zone conversion since local_time has an
|
||||
// unspecified time zone.
|
||||
std::tm t = gmtime(seconds_since_epoch.count());
|
||||
using period = typename Duration::period;
|
||||
if (period::num == 1 && period::den == 1 &&
|
||||
!std::is_floating_point<typename Duration::rep>::value) {
|
||||
return formatter<std::tm, Char>::format(localtime(val), ctx);
|
||||
return formatter<std::tm, Char>::format(t, ctx);
|
||||
}
|
||||
auto epoch = val.time_since_epoch();
|
||||
auto subsecs = detail::duration_cast<Duration>(
|
||||
epoch - detail::duration_cast<std::chrono::seconds>(epoch));
|
||||
return formatter<std::tm, Char>::do_format(localtime(val), ctx, &subsecs);
|
||||
auto subsecs =
|
||||
detail::duration_cast<Duration>(time_since_epoch - seconds_since_epoch);
|
||||
return formatter<std::tm, Char>::do_format(t, ctx, &subsecs);
|
||||
}
|
||||
};
|
||||
|
||||
|
203
extlib/fmt/include/fmt/color.h
vendored
203
extlib/fmt/include/fmt/color.h
vendored
@ -190,11 +190,11 @@ enum class emphasis : uint8_t {
|
||||
// rgb is a struct for red, green and blue colors.
|
||||
// Using the name "rgb" makes some editors show the color in a tooltip.
|
||||
struct rgb {
|
||||
FMT_CONSTEXPR rgb() : r(0), g(0), b(0) {}
|
||||
FMT_CONSTEXPR rgb(uint8_t r_, uint8_t g_, uint8_t b_) : r(r_), g(g_), b(b_) {}
|
||||
FMT_CONSTEXPR rgb(uint32_t hex)
|
||||
constexpr rgb() : r(0), g(0), b(0) {}
|
||||
constexpr rgb(uint8_t r_, uint8_t g_, uint8_t b_) : r(r_), g(g_), b(b_) {}
|
||||
constexpr rgb(uint32_t hex)
|
||||
: r((hex >> 16) & 0xFF), g((hex >> 8) & 0xFF), b(hex & 0xFF) {}
|
||||
FMT_CONSTEXPR rgb(color hex)
|
||||
constexpr rgb(color hex)
|
||||
: r((uint32_t(hex) >> 16) & 0xFF),
|
||||
g((uint32_t(hex) >> 8) & 0xFF),
|
||||
b(uint32_t(hex) & 0xFF) {}
|
||||
@ -205,97 +205,135 @@ struct rgb {
|
||||
|
||||
namespace detail {
|
||||
|
||||
// color is a struct of either a rgb color or a terminal color.
|
||||
// A bit-packed variant of an RGB color, a terminal color, or unset color.
|
||||
// see text_style for the bit-packing scheme.
|
||||
struct color_type {
|
||||
FMT_CONSTEXPR color_type() noexcept : is_rgb(), value{} {}
|
||||
FMT_CONSTEXPR color_type(color rgb_color) noexcept : is_rgb(true), value{} {
|
||||
value.rgb_color = static_cast<uint32_t>(rgb_color);
|
||||
constexpr color_type() noexcept = default;
|
||||
constexpr color_type(color rgb_color) noexcept
|
||||
: value_(static_cast<uint32_t>(rgb_color) | (1 << 24)) {}
|
||||
constexpr color_type(rgb rgb_color) noexcept
|
||||
: color_type(static_cast<color>(
|
||||
(static_cast<uint32_t>(rgb_color.r) << 16) |
|
||||
(static_cast<uint32_t>(rgb_color.g) << 8) | rgb_color.b)) {}
|
||||
constexpr color_type(terminal_color term_color) noexcept
|
||||
: value_(static_cast<uint32_t>(term_color) | (3 << 24)) {}
|
||||
|
||||
constexpr auto is_terminal_color() const noexcept -> bool {
|
||||
return (value_ & (1 << 25)) != 0;
|
||||
}
|
||||
FMT_CONSTEXPR color_type(rgb rgb_color) noexcept : is_rgb(true), value{} {
|
||||
value.rgb_color = (static_cast<uint32_t>(rgb_color.r) << 16) |
|
||||
(static_cast<uint32_t>(rgb_color.g) << 8) | rgb_color.b;
|
||||
|
||||
constexpr auto value() const noexcept -> uint32_t {
|
||||
return value_ & 0xFFFFFF;
|
||||
}
|
||||
FMT_CONSTEXPR color_type(terminal_color term_color) noexcept
|
||||
: is_rgb(), value{} {
|
||||
value.term_color = static_cast<uint8_t>(term_color);
|
||||
}
|
||||
bool is_rgb;
|
||||
union color_union {
|
||||
uint8_t term_color;
|
||||
uint32_t rgb_color;
|
||||
} value;
|
||||
|
||||
constexpr color_type(uint32_t value) noexcept : value_(value) {}
|
||||
|
||||
uint32_t value_ = 0;
|
||||
};
|
||||
} // namespace detail
|
||||
|
||||
/// A text style consisting of foreground and background colors and emphasis.
|
||||
class text_style {
|
||||
// The information is packed as follows:
|
||||
// ┌──┐
|
||||
// │ 0│─┐
|
||||
// │..│ ├── foreground color value
|
||||
// │23│─┘
|
||||
// ├──┤
|
||||
// │24│─┬── discriminator for the above value. 00 if unset, 01 if it's
|
||||
// │25│─┘ an RGB color, or 11 if it's a terminal color (10 is unused)
|
||||
// ├──┤
|
||||
// │26│──── overflow bit, always zero (see below)
|
||||
// ├──┤
|
||||
// │27│─┐
|
||||
// │..│ │
|
||||
// │50│ │
|
||||
// ├──┤ │
|
||||
// │51│ ├── background color (same format as the foreground color)
|
||||
// │52│ │
|
||||
// ├──┤ │
|
||||
// │53│─┘
|
||||
// ├──┤
|
||||
// │54│─┐
|
||||
// │..│ ├── emphases
|
||||
// │61│─┘
|
||||
// ├──┤
|
||||
// │62│─┬── unused
|
||||
// │63│─┘
|
||||
// └──┘
|
||||
// The overflow bits are there to make operator|= efficient.
|
||||
// When ORing, we must throw if, for either the foreground or background,
|
||||
// one style specifies a terminal color and the other specifies any color
|
||||
// (terminal or RGB); in other words, if one discriminator is 11 and the
|
||||
// other is 11 or 01.
|
||||
//
|
||||
// We do that check by adding the styles. Consider what adding does to each
|
||||
// possible pair of discriminators:
|
||||
// 00 + 00 = 000
|
||||
// 01 + 00 = 001
|
||||
// 11 + 00 = 011
|
||||
// 01 + 01 = 010
|
||||
// 11 + 01 = 100 (!!)
|
||||
// 11 + 11 = 110 (!!)
|
||||
// In the last two cases, the ones we want to catch, the third bit——the
|
||||
// overflow bit——is set. Bingo.
|
||||
//
|
||||
// We must take into account the possible carry bit from the bits
|
||||
// before the discriminator. The only potentially problematic case is
|
||||
// 11 + 00 = 011 (a carry bit would make it 100, not good!), but a carry
|
||||
// bit is impossible in that case, because 00 (unset color) means the
|
||||
// 24 bits that precede the discriminator are all zero.
|
||||
//
|
||||
// This test can be applied to both colors simultaneously.
|
||||
|
||||
public:
|
||||
FMT_CONSTEXPR text_style(emphasis em = emphasis()) noexcept
|
||||
: set_foreground_color(), set_background_color(), ems(em) {}
|
||||
: style_(static_cast<uint64_t>(em) << 54) {}
|
||||
|
||||
FMT_CONSTEXPR auto operator|=(const text_style& rhs) -> text_style& {
|
||||
if (!set_foreground_color) {
|
||||
set_foreground_color = rhs.set_foreground_color;
|
||||
foreground_color = rhs.foreground_color;
|
||||
} else if (rhs.set_foreground_color) {
|
||||
if (!foreground_color.is_rgb || !rhs.foreground_color.is_rgb)
|
||||
report_error("can't OR a terminal color");
|
||||
foreground_color.value.rgb_color |= rhs.foreground_color.value.rgb_color;
|
||||
}
|
||||
|
||||
if (!set_background_color) {
|
||||
set_background_color = rhs.set_background_color;
|
||||
background_color = rhs.background_color;
|
||||
} else if (rhs.set_background_color) {
|
||||
if (!background_color.is_rgb || !rhs.background_color.is_rgb)
|
||||
report_error("can't OR a terminal color");
|
||||
background_color.value.rgb_color |= rhs.background_color.value.rgb_color;
|
||||
}
|
||||
|
||||
ems = static_cast<emphasis>(static_cast<uint8_t>(ems) |
|
||||
static_cast<uint8_t>(rhs.ems));
|
||||
FMT_CONSTEXPR auto operator|=(text_style rhs) -> text_style& {
|
||||
if (((style_ + rhs.style_) & ((1ULL << 26) | (1ULL << 53))) != 0)
|
||||
report_error("can't OR a terminal color");
|
||||
style_ |= rhs.style_;
|
||||
return *this;
|
||||
}
|
||||
|
||||
friend FMT_CONSTEXPR auto operator|(text_style lhs, const text_style& rhs)
|
||||
friend FMT_CONSTEXPR auto operator|(text_style lhs, text_style rhs)
|
||||
-> text_style {
|
||||
return lhs |= rhs;
|
||||
}
|
||||
|
||||
FMT_CONSTEXPR auto operator==(text_style rhs) const noexcept -> bool {
|
||||
return style_ == rhs.style_;
|
||||
}
|
||||
|
||||
FMT_CONSTEXPR auto operator!=(text_style rhs) const noexcept -> bool {
|
||||
return !(*this == rhs);
|
||||
}
|
||||
|
||||
FMT_CONSTEXPR auto has_foreground() const noexcept -> bool {
|
||||
return set_foreground_color;
|
||||
return (style_ & (1 << 24)) != 0;
|
||||
}
|
||||
FMT_CONSTEXPR auto has_background() const noexcept -> bool {
|
||||
return set_background_color;
|
||||
return (style_ & (1ULL << 51)) != 0;
|
||||
}
|
||||
FMT_CONSTEXPR auto has_emphasis() const noexcept -> bool {
|
||||
return static_cast<uint8_t>(ems) != 0;
|
||||
return (style_ >> 54) != 0;
|
||||
}
|
||||
FMT_CONSTEXPR auto get_foreground() const noexcept -> detail::color_type {
|
||||
FMT_ASSERT(has_foreground(), "no foreground specified for this style");
|
||||
return foreground_color;
|
||||
return style_ & 0x3FFFFFF;
|
||||
}
|
||||
FMT_CONSTEXPR auto get_background() const noexcept -> detail::color_type {
|
||||
FMT_ASSERT(has_background(), "no background specified for this style");
|
||||
return background_color;
|
||||
return (style_ >> 27) & 0x3FFFFFF;
|
||||
}
|
||||
FMT_CONSTEXPR auto get_emphasis() const noexcept -> emphasis {
|
||||
FMT_ASSERT(has_emphasis(), "no emphasis specified for this style");
|
||||
return ems;
|
||||
return static_cast<emphasis>(style_ >> 54);
|
||||
}
|
||||
|
||||
private:
|
||||
FMT_CONSTEXPR text_style(bool is_foreground,
|
||||
detail::color_type text_color) noexcept
|
||||
: set_foreground_color(), set_background_color(), ems() {
|
||||
if (is_foreground) {
|
||||
foreground_color = text_color;
|
||||
set_foreground_color = true;
|
||||
} else {
|
||||
background_color = text_color;
|
||||
set_background_color = true;
|
||||
}
|
||||
}
|
||||
FMT_CONSTEXPR text_style(uint64_t style) noexcept : style_(style) {}
|
||||
|
||||
friend FMT_CONSTEXPR auto fg(detail::color_type foreground) noexcept
|
||||
-> text_style;
|
||||
@ -303,23 +341,19 @@ class text_style {
|
||||
friend FMT_CONSTEXPR auto bg(detail::color_type background) noexcept
|
||||
-> text_style;
|
||||
|
||||
detail::color_type foreground_color;
|
||||
detail::color_type background_color;
|
||||
bool set_foreground_color;
|
||||
bool set_background_color;
|
||||
emphasis ems;
|
||||
uint64_t style_ = 0;
|
||||
};
|
||||
|
||||
/// Creates a text style from the foreground (text) color.
|
||||
FMT_CONSTEXPR inline auto fg(detail::color_type foreground) noexcept
|
||||
-> text_style {
|
||||
return text_style(true, foreground);
|
||||
return foreground.value_;
|
||||
}
|
||||
|
||||
/// Creates a text style from the background color.
|
||||
FMT_CONSTEXPR inline auto bg(detail::color_type background) noexcept
|
||||
-> text_style {
|
||||
return text_style(false, background);
|
||||
return static_cast<uint64_t>(background.value_) << 27;
|
||||
}
|
||||
|
||||
FMT_CONSTEXPR inline auto operator|(emphasis lhs, emphasis rhs) noexcept
|
||||
@ -334,9 +368,9 @@ template <typename Char> struct ansi_color_escape {
|
||||
const char* esc) noexcept {
|
||||
// If we have a terminal color, we need to output another escape code
|
||||
// sequence.
|
||||
if (!text_color.is_rgb) {
|
||||
if (text_color.is_terminal_color()) {
|
||||
bool is_background = esc == string_view("\x1b[48;2;");
|
||||
uint32_t value = text_color.value.term_color;
|
||||
uint32_t value = text_color.value();
|
||||
// Background ASCII codes are the same as the foreground ones but with
|
||||
// 10 more.
|
||||
if (is_background) value += 10u;
|
||||
@ -360,7 +394,7 @@ template <typename Char> struct ansi_color_escape {
|
||||
for (int i = 0; i < 7; i++) {
|
||||
buffer[i] = static_cast<Char>(esc[i]);
|
||||
}
|
||||
rgb color(text_color.value.rgb_color);
|
||||
rgb color(text_color.value());
|
||||
to_esc(color.r, buffer + 7, ';');
|
||||
to_esc(color.g, buffer + 11, ';');
|
||||
to_esc(color.b, buffer + 15, 'm');
|
||||
@ -448,32 +482,26 @@ template <typename T> struct styled_arg : view {
|
||||
};
|
||||
|
||||
template <typename Char>
|
||||
void vformat_to(buffer<Char>& buf, const text_style& ts,
|
||||
basic_string_view<Char> fmt,
|
||||
void vformat_to(buffer<Char>& buf, text_style ts, basic_string_view<Char> fmt,
|
||||
basic_format_args<buffered_context<Char>> args) {
|
||||
bool has_style = false;
|
||||
if (ts.has_emphasis()) {
|
||||
has_style = true;
|
||||
auto emphasis = make_emphasis<Char>(ts.get_emphasis());
|
||||
buf.append(emphasis.begin(), emphasis.end());
|
||||
}
|
||||
if (ts.has_foreground()) {
|
||||
has_style = true;
|
||||
auto foreground = make_foreground_color<Char>(ts.get_foreground());
|
||||
buf.append(foreground.begin(), foreground.end());
|
||||
}
|
||||
if (ts.has_background()) {
|
||||
has_style = true;
|
||||
auto background = make_background_color<Char>(ts.get_background());
|
||||
buf.append(background.begin(), background.end());
|
||||
}
|
||||
vformat_to(buf, fmt, args);
|
||||
if (has_style) reset_color<Char>(buf);
|
||||
if (ts != text_style()) reset_color<Char>(buf);
|
||||
}
|
||||
} // namespace detail
|
||||
|
||||
inline void vprint(FILE* f, const text_style& ts, string_view fmt,
|
||||
format_args args) {
|
||||
inline void vprint(FILE* f, text_style ts, string_view fmt, format_args args) {
|
||||
auto buf = memory_buffer();
|
||||
detail::vformat_to(buf, ts, fmt, args);
|
||||
print(f, FMT_STRING("{}"), string_view(buf.begin(), buf.size()));
|
||||
@ -489,8 +517,7 @@ inline void vprint(FILE* f, const text_style& ts, string_view fmt,
|
||||
* "Elapsed time: {0:.2f} seconds", 1.23);
|
||||
*/
|
||||
template <typename... T>
|
||||
void print(FILE* f, const text_style& ts, format_string<T...> fmt,
|
||||
T&&... args) {
|
||||
void print(FILE* f, text_style ts, format_string<T...> fmt, T&&... args) {
|
||||
vprint(f, ts, fmt.str, vargs<T...>{{args...}});
|
||||
}
|
||||
|
||||
@ -504,11 +531,11 @@ void print(FILE* f, const text_style& ts, format_string<T...> fmt,
|
||||
* "Elapsed time: {0:.2f} seconds", 1.23);
|
||||
*/
|
||||
template <typename... T>
|
||||
void print(const text_style& ts, format_string<T...> fmt, T&&... args) {
|
||||
void print(text_style ts, format_string<T...> fmt, T&&... args) {
|
||||
return print(stdout, ts, fmt, std::forward<T>(args)...);
|
||||
}
|
||||
|
||||
inline auto vformat(const text_style& ts, string_view fmt, format_args args)
|
||||
inline auto vformat(text_style ts, string_view fmt, format_args args)
|
||||
-> std::string {
|
||||
auto buf = memory_buffer();
|
||||
detail::vformat_to(buf, ts, fmt, args);
|
||||
@ -528,7 +555,7 @@ inline auto vformat(const text_style& ts, string_view fmt, format_args args)
|
||||
* ```
|
||||
*/
|
||||
template <typename... T>
|
||||
inline auto format(const text_style& ts, format_string<T...> fmt, T&&... args)
|
||||
inline auto format(text_style ts, format_string<T...> fmt, T&&... args)
|
||||
-> std::string {
|
||||
return fmt::vformat(ts, fmt.str, vargs<T...>{{args...}});
|
||||
}
|
||||
@ -536,8 +563,8 @@ inline auto format(const text_style& ts, format_string<T...> fmt, T&&... args)
|
||||
/// Formats a string with the given text_style and writes the output to `out`.
|
||||
template <typename OutputIt,
|
||||
FMT_ENABLE_IF(detail::is_output_iterator<OutputIt, char>::value)>
|
||||
auto vformat_to(OutputIt out, const text_style& ts, string_view fmt,
|
||||
format_args args) -> OutputIt {
|
||||
auto vformat_to(OutputIt out, text_style ts, string_view fmt, format_args args)
|
||||
-> OutputIt {
|
||||
auto&& buf = detail::get_buffer<char>(out);
|
||||
detail::vformat_to(buf, ts, fmt, args);
|
||||
return detail::get_iterator(buf, out);
|
||||
@ -555,8 +582,8 @@ auto vformat_to(OutputIt out, const text_style& ts, string_view fmt,
|
||||
*/
|
||||
template <typename OutputIt, typename... T,
|
||||
FMT_ENABLE_IF(detail::is_output_iterator<OutputIt, char>::value)>
|
||||
inline auto format_to(OutputIt out, const text_style& ts,
|
||||
format_string<T...> fmt, T&&... args) -> OutputIt {
|
||||
inline auto format_to(OutputIt out, text_style ts, format_string<T...> fmt,
|
||||
T&&... args) -> OutputIt {
|
||||
return vformat_to(out, ts, fmt.str, vargs<T...>{{args...}});
|
||||
}
|
||||
|
||||
|
7
extlib/fmt/include/fmt/format-inl.h
vendored
7
extlib/fmt/include/fmt/format-inl.h
vendored
@ -212,7 +212,7 @@ inline auto floor_log10_pow2_minus_log10_4_over_3(int e) noexcept -> int {
|
||||
return (e * 631305 - 261663) >> 21;
|
||||
}
|
||||
|
||||
FMT_INLINE_VARIABLE constexpr struct {
|
||||
FMT_INLINE_VARIABLE constexpr struct div_small_pow10_infos_struct {
|
||||
uint32_t divisor;
|
||||
int shift_amount;
|
||||
} div_small_pow10_infos[] = {{10, 16}, {100, 16}};
|
||||
@ -1097,7 +1097,7 @@ template <> struct cache_accessor<double> {
|
||||
return {r.high(), r.low() == 0};
|
||||
}
|
||||
|
||||
static auto compute_delta(cache_entry_type const& cache, int beta) noexcept
|
||||
static auto compute_delta(const cache_entry_type& cache, int beta) noexcept
|
||||
-> uint32_t {
|
||||
return static_cast<uint32_t>(cache.high() >> (64 - 1 - beta));
|
||||
}
|
||||
@ -1526,9 +1526,8 @@ template <typename F> class glibc_file : public file_base<F> {
|
||||
}
|
||||
|
||||
void init_buffer() {
|
||||
if (this->file_->_IO_write_ptr) return;
|
||||
if (this->file_->_IO_write_ptr < this->file_->_IO_write_end) return;
|
||||
// Force buffer initialization by placing and removing a char in a buffer.
|
||||
assume(this->file_->_IO_write_ptr >= this->file_->_IO_write_end);
|
||||
putc_unlocked(0, this->file_);
|
||||
--this->file_->_IO_write_ptr;
|
||||
}
|
||||
|
16
extlib/fmt/include/fmt/format.h
vendored
16
extlib/fmt/include/fmt/format.h
vendored
@ -117,6 +117,7 @@
|
||||
# define FMT_NOINLINE
|
||||
#endif
|
||||
|
||||
// GCC 4.9 doesn't support qualified names in specializations.
|
||||
namespace std {
|
||||
template <typename T> struct iterator_traits<fmt::basic_appender<T>> {
|
||||
using iterator_category = output_iterator_tag;
|
||||
@ -705,7 +706,7 @@ using is_integer =
|
||||
|
||||
#if defined(FMT_USE_FLOAT128)
|
||||
// Use the provided definition.
|
||||
#elif FMT_CLANG_VERSION && FMT_HAS_INCLUDE(<quadmath.h>)
|
||||
#elif FMT_CLANG_VERSION >= 309 && FMT_HAS_INCLUDE(<quadmath.h>)
|
||||
# define FMT_USE_FLOAT128 1
|
||||
#elif FMT_GCC_VERSION && defined(_GLIBCXX_USE_FLOAT128) && \
|
||||
!defined(__STRICT_ANSI__)
|
||||
@ -721,11 +722,10 @@ struct float128 {};
|
||||
|
||||
template <typename T> using is_float128 = std::is_same<T, float128>;
|
||||
|
||||
template <typename T>
|
||||
using is_floating_point =
|
||||
bool_constant<std::is_floating_point<T>::value || is_float128<T>::value>;
|
||||
template <typename T> struct is_floating_point : std::is_floating_point<T> {};
|
||||
template <> struct is_floating_point<float128> : std::true_type {};
|
||||
|
||||
template <typename T, bool = std::is_floating_point<T>::value>
|
||||
template <typename T, bool = is_floating_point<T>::value>
|
||||
struct is_fast_float : bool_constant<std::numeric_limits<T>::is_iec559 &&
|
||||
sizeof(T) <= sizeof(double)> {};
|
||||
template <typename T> struct is_fast_float<T, false> : std::false_type {};
|
||||
@ -1613,7 +1613,7 @@ constexpr auto convert_float(T value) -> convert_float_result<T> {
|
||||
}
|
||||
|
||||
template <typename Char, typename OutputIt>
|
||||
FMT_NOINLINE FMT_CONSTEXPR auto fill(OutputIt it, size_t n,
|
||||
FMT_CONSTEXPR FMT_NOINLINE auto fill(OutputIt it, size_t n,
|
||||
const basic_specs& specs) -> OutputIt {
|
||||
auto fill_size = specs.fill_size();
|
||||
if (fill_size == 1) return detail::fill_n(it, n, specs.fill_unit<Char>());
|
||||
@ -2472,8 +2472,8 @@ template <typename T>
|
||||
struct has_isfinite<T, enable_if_t<sizeof(std::isfinite(T())) != 0>>
|
||||
: std::true_type {};
|
||||
|
||||
template <typename T, FMT_ENABLE_IF(std::is_floating_point<T>::value&&
|
||||
has_isfinite<T>::value)>
|
||||
template <typename T,
|
||||
FMT_ENABLE_IF(is_floating_point<T>::value&& has_isfinite<T>::value)>
|
||||
FMT_CONSTEXPR20 auto isfinite(T value) -> bool {
|
||||
constexpr T inf = T(std::numeric_limits<double>::infinity());
|
||||
if (is_constant_evaluated())
|
||||
|
3
extlib/fmt/include/fmt/ostream.h
vendored
3
extlib/fmt/include/fmt/ostream.h
vendored
@ -158,7 +158,8 @@ void print(std::ostream& os, format_string<T...> fmt, T&&... args) {
|
||||
|
||||
FMT_EXPORT template <typename... T>
|
||||
void println(std::ostream& os, format_string<T...> fmt, T&&... args) {
|
||||
fmt::print(os, "{}\n", fmt::format(fmt, std::forward<T>(args)...));
|
||||
fmt::print(os, FMT_STRING("{}\n"),
|
||||
fmt::format(fmt, std::forward<T>(args)...));
|
||||
}
|
||||
|
||||
FMT_END_NAMESPACE
|
||||
|
8
extlib/fmt/include/fmt/ranges.h
vendored
8
extlib/fmt/include/fmt/ranges.h
vendored
@ -774,13 +774,13 @@ struct formatter<
|
||||
: formatter<detail::all<typename T::container_type>, Char> {
|
||||
using all = detail::all<typename T::container_type>;
|
||||
template <typename FormatContext>
|
||||
auto format(const T& t, FormatContext& ctx) const -> decltype(ctx.out()) {
|
||||
auto format(const T& value, FormatContext& ctx) const -> decltype(ctx.out()) {
|
||||
struct getter : T {
|
||||
static auto get(const T& t) -> all {
|
||||
return {t.*(&getter::c)}; // Access c through the derived class.
|
||||
static auto get(const T& v) -> all {
|
||||
return {v.*(&getter::c)}; // Access c through the derived class.
|
||||
}
|
||||
};
|
||||
return formatter<all>::format(getter::get(t), ctx);
|
||||
return formatter<all>::format(getter::get(value), ctx);
|
||||
}
|
||||
};
|
||||
|
||||
|
50
extlib/fmt/include/fmt/std.h
vendored
50
extlib/fmt/include/fmt/std.h
vendored
@ -113,7 +113,6 @@ void write_escaped_path(basic_memory_buffer<Char>& quoted,
|
||||
|
||||
} // namespace detail
|
||||
|
||||
FMT_EXPORT
|
||||
template <typename Char> struct formatter<std::filesystem::path, Char> {
|
||||
private:
|
||||
format_specs specs_;
|
||||
@ -182,7 +181,6 @@ FMT_END_NAMESPACE
|
||||
#endif // FMT_CPP_LIB_FILESYSTEM
|
||||
|
||||
FMT_BEGIN_NAMESPACE
|
||||
FMT_EXPORT
|
||||
template <std::size_t N, typename Char>
|
||||
struct formatter<std::bitset<N>, Char>
|
||||
: nested_formatter<basic_string_view<Char>, Char> {
|
||||
@ -209,14 +207,12 @@ struct formatter<std::bitset<N>, Char>
|
||||
}
|
||||
};
|
||||
|
||||
FMT_EXPORT
|
||||
template <typename Char>
|
||||
struct formatter<std::thread::id, Char> : basic_ostream_formatter<Char> {};
|
||||
FMT_END_NAMESPACE
|
||||
|
||||
#ifdef __cpp_lib_optional
|
||||
FMT_BEGIN_NAMESPACE
|
||||
FMT_EXPORT
|
||||
template <typename T, typename Char>
|
||||
struct formatter<std::optional<T>, Char,
|
||||
std::enable_if_t<is_formattable<T, Char>::value>> {
|
||||
@ -279,7 +275,6 @@ FMT_END_NAMESPACE
|
||||
#ifdef __cpp_lib_expected
|
||||
FMT_BEGIN_NAMESPACE
|
||||
|
||||
FMT_EXPORT
|
||||
template <typename T, typename E, typename Char>
|
||||
struct formatter<std::expected<T, E>, Char,
|
||||
std::enable_if_t<(std::is_void<T>::value ||
|
||||
@ -311,7 +306,6 @@ FMT_END_NAMESPACE
|
||||
|
||||
#ifdef __cpp_lib_source_location
|
||||
FMT_BEGIN_NAMESPACE
|
||||
FMT_EXPORT
|
||||
template <> struct formatter<std::source_location> {
|
||||
FMT_CONSTEXPR auto parse(parse_context<>& ctx) { return ctx.begin(); }
|
||||
|
||||
@ -367,7 +361,6 @@ template <typename T, typename C> struct is_variant_formattable {
|
||||
detail::is_variant_formattable_<T, C>::value;
|
||||
};
|
||||
|
||||
FMT_EXPORT
|
||||
template <typename Char> struct formatter<std::monostate, Char> {
|
||||
FMT_CONSTEXPR auto parse(parse_context<Char>& ctx) -> const Char* {
|
||||
return ctx.begin();
|
||||
@ -380,7 +373,6 @@ template <typename Char> struct formatter<std::monostate, Char> {
|
||||
}
|
||||
};
|
||||
|
||||
FMT_EXPORT
|
||||
template <typename Variant, typename Char>
|
||||
struct formatter<
|
||||
Variant, Char,
|
||||
@ -414,11 +406,11 @@ FMT_END_NAMESPACE
|
||||
#endif // FMT_CPP_LIB_VARIANT
|
||||
|
||||
FMT_BEGIN_NAMESPACE
|
||||
FMT_EXPORT
|
||||
template <> struct formatter<std::error_code> {
|
||||
private:
|
||||
format_specs specs_;
|
||||
detail::arg_ref<char> width_ref_;
|
||||
bool debug_ = false;
|
||||
|
||||
public:
|
||||
FMT_CONSTEXPR auto parse(parse_context<>& ctx) -> const char* {
|
||||
@ -426,11 +418,19 @@ template <> struct formatter<std::error_code> {
|
||||
if (it == end) return it;
|
||||
|
||||
it = detail::parse_align(it, end, specs_);
|
||||
if (it == end) return it;
|
||||
|
||||
char c = *it;
|
||||
if ((c >= '0' && c <= '9') || c == '{')
|
||||
if (it != end && ((c >= '0' && c <= '9') || c == '{'))
|
||||
it = detail::parse_width(it, end, specs_, width_ref_, ctx);
|
||||
|
||||
if (it != end && *it == '?') {
|
||||
debug_ = true;
|
||||
++it;
|
||||
}
|
||||
if (it != end && *it == 's') {
|
||||
specs_.set_type(presentation_type::string);
|
||||
++it;
|
||||
}
|
||||
return it;
|
||||
}
|
||||
|
||||
@ -440,12 +440,21 @@ template <> struct formatter<std::error_code> {
|
||||
auto specs = specs_;
|
||||
detail::handle_dynamic_spec(specs.dynamic_width(), specs.width, width_ref_,
|
||||
ctx);
|
||||
memory_buffer buf;
|
||||
buf.append(string_view(ec.category().name()));
|
||||
buf.push_back(':');
|
||||
detail::write<char>(appender(buf), ec.value());
|
||||
return detail::write<char>(ctx.out(), string_view(buf.data(), buf.size()),
|
||||
specs);
|
||||
auto buf = memory_buffer();
|
||||
if (specs_.type() == presentation_type::string) {
|
||||
buf.append(ec.message());
|
||||
} else {
|
||||
buf.append(string_view(ec.category().name()));
|
||||
buf.push_back(':');
|
||||
detail::write<char>(appender(buf), ec.value());
|
||||
}
|
||||
auto quoted = memory_buffer();
|
||||
auto str = string_view(buf.data(), buf.size());
|
||||
if (debug_) {
|
||||
detail::write_escaped_string<char>(std::back_inserter(quoted), str);
|
||||
str = string_view(quoted.data(), quoted.size());
|
||||
}
|
||||
return detail::write<char>(ctx.out(), str, specs);
|
||||
}
|
||||
};
|
||||
|
||||
@ -520,7 +529,6 @@ auto write_demangled_name(OutputIt out, const std::type_info& ti) -> OutputIt {
|
||||
|
||||
} // namespace detail
|
||||
|
||||
FMT_EXPORT
|
||||
template <typename Char>
|
||||
struct formatter<std::type_info, Char // DEPRECATED! Mixing code unit types.
|
||||
> {
|
||||
@ -537,7 +545,6 @@ struct formatter<std::type_info, Char // DEPRECATED! Mixing code unit types.
|
||||
};
|
||||
#endif
|
||||
|
||||
FMT_EXPORT
|
||||
template <typename T, typename Char>
|
||||
struct formatter<
|
||||
T, Char, // DEPRECATED! Mixing code unit types.
|
||||
@ -603,7 +610,6 @@ struct is_bit_reference_like<std::__bit_const_reference<C>> {
|
||||
// We can't use std::vector<bool, Allocator>::reference and
|
||||
// std::bitset<N>::reference because the compiler can't deduce Allocator and N
|
||||
// in partial specialization.
|
||||
FMT_EXPORT
|
||||
template <typename BitRef, typename Char>
|
||||
struct formatter<BitRef, Char,
|
||||
enable_if_t<detail::is_bit_reference_like<BitRef>::value>>
|
||||
@ -623,7 +629,6 @@ template <typename T> auto ptr(const std::shared_ptr<T>& p) -> const void* {
|
||||
return p.get();
|
||||
}
|
||||
|
||||
FMT_EXPORT
|
||||
template <typename T, typename Char>
|
||||
struct formatter<std::atomic<T>, Char,
|
||||
enable_if_t<is_formattable<T, Char>::value>>
|
||||
@ -636,7 +641,6 @@ struct formatter<std::atomic<T>, Char,
|
||||
};
|
||||
|
||||
#ifdef __cpp_lib_atomic_flag_test
|
||||
FMT_EXPORT
|
||||
template <typename Char>
|
||||
struct formatter<std::atomic_flag, Char> : formatter<bool, Char> {
|
||||
template <typename FormatContext>
|
||||
@ -647,7 +651,6 @@ struct formatter<std::atomic_flag, Char> : formatter<bool, Char> {
|
||||
};
|
||||
#endif // __cpp_lib_atomic_flag_test
|
||||
|
||||
FMT_EXPORT
|
||||
template <typename T, typename Char> struct formatter<std::complex<T>, Char> {
|
||||
private:
|
||||
detail::dynamic_format_specs<Char> specs_;
|
||||
@ -710,7 +713,6 @@ template <typename T, typename Char> struct formatter<std::complex<T>, Char> {
|
||||
}
|
||||
};
|
||||
|
||||
FMT_EXPORT
|
||||
template <typename T, typename Char>
|
||||
struct formatter<std::reference_wrapper<T>, Char,
|
||||
enable_if_t<is_formattable<remove_cvref_t<T>, Char>::value>>
|
||||
|
14
extlib/fmt/include/fmt/xchar.h
vendored
14
extlib/fmt/include/fmt/xchar.h
vendored
@ -112,10 +112,6 @@ inline auto runtime(wstring_view s) -> runtime_format_string<wchar_t> {
|
||||
return {{s}};
|
||||
}
|
||||
|
||||
template <> struct is_char<wchar_t> : std::true_type {};
|
||||
template <> struct is_char<char16_t> : std::true_type {};
|
||||
template <> struct is_char<char32_t> : std::true_type {};
|
||||
|
||||
#ifdef __cpp_char8_t
|
||||
template <> struct is_char<char8_t> : bool_constant<detail::is_utf8_enabled> {};
|
||||
#endif
|
||||
@ -322,7 +318,7 @@ template <typename... T> void println(wformat_string<T...> fmt, T&&... args) {
|
||||
return print(L"{}\n", fmt::format(fmt, std::forward<T>(args)...));
|
||||
}
|
||||
|
||||
inline auto vformat(const text_style& ts, wstring_view fmt, wformat_args args)
|
||||
inline auto vformat(text_style ts, wstring_view fmt, wformat_args args)
|
||||
-> std::wstring {
|
||||
auto buf = wmemory_buffer();
|
||||
detail::vformat_to(buf, ts, fmt, args);
|
||||
@ -330,19 +326,19 @@ inline auto vformat(const text_style& ts, wstring_view fmt, wformat_args args)
|
||||
}
|
||||
|
||||
template <typename... T>
|
||||
inline auto format(const text_style& ts, wformat_string<T...> fmt, T&&... args)
|
||||
inline auto format(text_style ts, wformat_string<T...> fmt, T&&... args)
|
||||
-> std::wstring {
|
||||
return fmt::vformat(ts, fmt, fmt::make_wformat_args(args...));
|
||||
}
|
||||
|
||||
template <typename... T>
|
||||
FMT_DEPRECATED void print(std::FILE* f, const text_style& ts,
|
||||
wformat_string<T...> fmt, const T&... args) {
|
||||
FMT_DEPRECATED void print(std::FILE* f, text_style ts, wformat_string<T...> fmt,
|
||||
const T&... args) {
|
||||
vprint(f, ts, fmt, fmt::make_wformat_args(args...));
|
||||
}
|
||||
|
||||
template <typename... T>
|
||||
FMT_DEPRECATED void print(const text_style& ts, wformat_string<T...> fmt,
|
||||
FMT_DEPRECATED void print(text_style ts, wformat_string<T...> fmt,
|
||||
const T&... args) {
|
||||
return print(stdout, ts, fmt, args...);
|
||||
}
|
||||
|
2
extlib/fmt/support/bazel/.bazelversion
vendored
2
extlib/fmt/support/bazel/.bazelversion
vendored
@ -1 +1 @@
|
||||
7.1.2
|
||||
8.1.1
|
||||
|
2
extlib/fmt/support/bazel/BUILD.bazel
vendored
2
extlib/fmt/support/bazel/BUILD.bazel
vendored
@ -1,3 +1,5 @@
|
||||
load("@rules_cc//cc:defs.bzl", "cc_library")
|
||||
|
||||
cc_library(
|
||||
name = "fmt",
|
||||
srcs = [
|
||||
|
3
extlib/fmt/support/bazel/MODULE.bazel
vendored
3
extlib/fmt/support/bazel/MODULE.bazel
vendored
@ -3,4 +3,5 @@ module(
|
||||
compatibility_level = 10,
|
||||
)
|
||||
|
||||
bazel_dep(name = "platforms", version = "0.0.10")
|
||||
bazel_dep(name = "platforms", version = "0.0.11")
|
||||
bazel_dep(name = "rules_cc", version = "0.1.1")
|
||||
|
2
extlib/fmt/support/bazel/README.md
vendored
2
extlib/fmt/support/bazel/README.md
vendored
@ -13,7 +13,7 @@ The [Bazel Central Registry](https://github.com/bazelbuild/bazel-central-registr
|
||||
For instance, to use {fmt} add to your `MODULE.bazel` file:
|
||||
|
||||
```
|
||||
bazel_dep(name = "fmt", version = "10.2.1")
|
||||
bazel_dep(name = "fmt", version = "11.1.4")
|
||||
```
|
||||
|
||||
### Live at head
|
||||
|
BIN
extlib/gettext.win32/bin.i386/cldr-plurals.exe
vendored
BIN
extlib/gettext.win32/bin.i386/cldr-plurals.exe
vendored
Binary file not shown.
BIN
extlib/gettext.win32/bin.i386/hostname.exe
vendored
BIN
extlib/gettext.win32/bin.i386/hostname.exe
vendored
Binary file not shown.
BIN
extlib/gettext.win32/bin.i386/iconv.dll
vendored
BIN
extlib/gettext.win32/bin.i386/iconv.dll
vendored
Binary file not shown.
BIN
extlib/gettext.win32/bin.i386/libgettextlib-0-22.dll
vendored
BIN
extlib/gettext.win32/bin.i386/libgettextlib-0-22.dll
vendored
Binary file not shown.
BIN
extlib/gettext.win32/bin.i386/libgettextlib-0-25.dll
vendored
Executable file
BIN
extlib/gettext.win32/bin.i386/libgettextlib-0-25.dll
vendored
Executable file
Binary file not shown.
BIN
extlib/gettext.win32/bin.i386/libgettextpo-0.dll
vendored
BIN
extlib/gettext.win32/bin.i386/libgettextpo-0.dll
vendored
Binary file not shown.
BIN
extlib/gettext.win32/bin.i386/libgettextsrc-0-22.dll
vendored
BIN
extlib/gettext.win32/bin.i386/libgettextsrc-0-22.dll
vendored
Binary file not shown.
BIN
extlib/gettext.win32/bin.i386/libgettextsrc-0-25.dll
vendored
Executable file
BIN
extlib/gettext.win32/bin.i386/libgettextsrc-0-25.dll
vendored
Executable file
Binary file not shown.
BIN
extlib/gettext.win32/bin.i386/libtextstyle-0.dll
vendored
BIN
extlib/gettext.win32/bin.i386/libtextstyle-0.dll
vendored
Binary file not shown.
BIN
extlib/gettext.win32/bin.i386/msgattrib.exe
vendored
BIN
extlib/gettext.win32/bin.i386/msgattrib.exe
vendored
Binary file not shown.
BIN
extlib/gettext.win32/bin.i386/msgcat.exe
vendored
BIN
extlib/gettext.win32/bin.i386/msgcat.exe
vendored
Binary file not shown.
BIN
extlib/gettext.win32/bin.i386/msgcmp.exe
vendored
BIN
extlib/gettext.win32/bin.i386/msgcmp.exe
vendored
Binary file not shown.
BIN
extlib/gettext.win32/bin.i386/msgcomm.exe
vendored
BIN
extlib/gettext.win32/bin.i386/msgcomm.exe
vendored
Binary file not shown.
BIN
extlib/gettext.win32/bin.i386/msgconv.exe
vendored
BIN
extlib/gettext.win32/bin.i386/msgconv.exe
vendored
Binary file not shown.
BIN
extlib/gettext.win32/bin.i386/msgen.exe
vendored
BIN
extlib/gettext.win32/bin.i386/msgen.exe
vendored
Binary file not shown.
BIN
extlib/gettext.win32/bin.i386/msgexec.exe
vendored
BIN
extlib/gettext.win32/bin.i386/msgexec.exe
vendored
Binary file not shown.
BIN
extlib/gettext.win32/bin.i386/msgfilter.exe
vendored
BIN
extlib/gettext.win32/bin.i386/msgfilter.exe
vendored
Binary file not shown.
BIN
extlib/gettext.win32/bin.i386/msgfmt.exe
vendored
BIN
extlib/gettext.win32/bin.i386/msgfmt.exe
vendored
Binary file not shown.
BIN
extlib/gettext.win32/bin.i386/msggrep.exe
vendored
BIN
extlib/gettext.win32/bin.i386/msggrep.exe
vendored
Binary file not shown.
BIN
extlib/gettext.win32/bin.i386/msginit.exe
vendored
BIN
extlib/gettext.win32/bin.i386/msginit.exe
vendored
Binary file not shown.
BIN
extlib/gettext.win32/bin.i386/msgmerge.exe
vendored
BIN
extlib/gettext.win32/bin.i386/msgmerge.exe
vendored
Binary file not shown.
BIN
extlib/gettext.win32/bin.i386/msgunfmt.exe
vendored
BIN
extlib/gettext.win32/bin.i386/msgunfmt.exe
vendored
Binary file not shown.
BIN
extlib/gettext.win32/bin.i386/msguniq.exe
vendored
BIN
extlib/gettext.win32/bin.i386/msguniq.exe
vendored
Binary file not shown.
BIN
extlib/gettext.win32/bin.i386/recode-sr-latin.exe
vendored
BIN
extlib/gettext.win32/bin.i386/recode-sr-latin.exe
vendored
Binary file not shown.
BIN
extlib/gettext.win32/bin.i386/urlget.exe
vendored
BIN
extlib/gettext.win32/bin.i386/urlget.exe
vendored
Binary file not shown.
BIN
extlib/gettext.win32/bin.i386/xgettext.exe
vendored
BIN
extlib/gettext.win32/bin.i386/xgettext.exe
vendored
Binary file not shown.
901
extlib/gettext.win32/include/libgnuintl.h
vendored
901
extlib/gettext.win32/include/libgnuintl.h
vendored
File diff suppressed because it is too large
Load Diff
57
extlib/gettext.win32/lib.amd64/libgnuintl-8.def
vendored
57
extlib/gettext.win32/lib.amd64/libgnuintl-8.def
vendored
@ -1,15 +1,29 @@
|
||||
EXPORTS
|
||||
DllMain
|
||||
__imp_libintl_version DATA
|
||||
__printf__
|
||||
_nl_expand_alias
|
||||
_nl_msg_cat_cntr DATA
|
||||
bind_textdomain_codeset
|
||||
bindtextdomain
|
||||
c32isalnum
|
||||
c32isalpha
|
||||
c32isblank
|
||||
c32iscntrl
|
||||
c32isdigit
|
||||
c32isgraph
|
||||
c32islower
|
||||
c32isprint
|
||||
c32ispunct
|
||||
c32isspace
|
||||
c32isupper
|
||||
c32isxdigit
|
||||
c32tolower
|
||||
c32width
|
||||
dcgettext
|
||||
dcngettext
|
||||
dgettext
|
||||
dngettext
|
||||
getlocalename_l_unsafe
|
||||
gettext
|
||||
libintl_asprintf
|
||||
libintl_bind_textdomain_codeset
|
||||
@ -22,7 +36,6 @@ EXPORTS
|
||||
libintl_fprintf
|
||||
libintl_fwprintf
|
||||
libintl_gettext
|
||||
libintl_hash_string
|
||||
libintl_ngettext
|
||||
libintl_nl_current_default_domain DATA
|
||||
libintl_nl_default_default_domain DATA
|
||||
@ -46,5 +59,45 @@ EXPORTS
|
||||
libintl_wbindtextdomain
|
||||
libintl_wprintf
|
||||
locale_charset
|
||||
mb_copy
|
||||
mb_width_aux
|
||||
mbiterf_next
|
||||
mbrtoc32
|
||||
mbsnlen
|
||||
ngettext
|
||||
rpl_getcwd
|
||||
rpl_iswalnum
|
||||
rpl_iswalpha
|
||||
rpl_iswblank
|
||||
rpl_iswcntrl
|
||||
rpl_iswdigit
|
||||
rpl_iswgraph
|
||||
rpl_iswlower
|
||||
rpl_iswprint
|
||||
rpl_iswpunct
|
||||
rpl_iswspace
|
||||
rpl_iswupper
|
||||
rpl_iswxdigit
|
||||
rpl_localeconv
|
||||
rpl_pthread_once
|
||||
rpl_towlower
|
||||
rpl_towupper
|
||||
setlocale_messages
|
||||
setlocale_messages_null
|
||||
textdomain
|
||||
uc_is_alnum
|
||||
uc_is_alpha
|
||||
uc_is_blank
|
||||
uc_is_cntrl
|
||||
uc_is_digit
|
||||
uc_is_graph
|
||||
uc_is_lower
|
||||
uc_is_print
|
||||
uc_is_punct
|
||||
uc_is_space
|
||||
uc_is_upper
|
||||
uc_is_xdigit
|
||||
uc_tolower
|
||||
uc_width
|
||||
wcwidth
|
||||
wgetcwd
|
||||
|
BIN
extlib/gettext.win32/lib.amd64/libgnuintl-8.dll
vendored
BIN
extlib/gettext.win32/lib.amd64/libgnuintl-8.dll
vendored
Binary file not shown.
BIN
extlib/gettext.win32/lib.amd64/libgnuintl-8.exp
vendored
BIN
extlib/gettext.win32/lib.amd64/libgnuintl-8.exp
vendored
Binary file not shown.
BIN
extlib/gettext.win32/lib.amd64/libgnuintl-8.lib
vendored
BIN
extlib/gettext.win32/lib.amd64/libgnuintl-8.lib
vendored
Binary file not shown.
BIN
extlib/gettext.win32/lib.amd64/libgnuintl.dll.a
vendored
BIN
extlib/gettext.win32/lib.amd64/libgnuintl.dll.a
vendored
Binary file not shown.
56
extlib/gettext.win32/lib.i386/libgnuintl-8.def
vendored
56
extlib/gettext.win32/lib.i386/libgnuintl-8.def
vendored
@ -5,10 +5,25 @@ EXPORTS
|
||||
_nl_msg_cat_cntr DATA
|
||||
bind_textdomain_codeset
|
||||
bindtextdomain
|
||||
c32isalnum
|
||||
c32isalpha
|
||||
c32isblank
|
||||
c32iscntrl
|
||||
c32isdigit
|
||||
c32isgraph
|
||||
c32islower
|
||||
c32isprint
|
||||
c32ispunct
|
||||
c32isspace
|
||||
c32isupper
|
||||
c32isxdigit
|
||||
c32tolower
|
||||
c32width
|
||||
dcgettext
|
||||
dcngettext
|
||||
dgettext
|
||||
dngettext
|
||||
getlocalename_l_unsafe
|
||||
gettext
|
||||
libintl_asprintf
|
||||
libintl_bind_textdomain_codeset
|
||||
@ -21,7 +36,6 @@ EXPORTS
|
||||
libintl_fprintf
|
||||
libintl_fwprintf
|
||||
libintl_gettext
|
||||
libintl_hash_string
|
||||
libintl_ngettext
|
||||
libintl_nl_current_default_domain DATA
|
||||
libintl_nl_default_default_domain DATA
|
||||
@ -45,5 +59,45 @@ EXPORTS
|
||||
libintl_wbindtextdomain
|
||||
libintl_wprintf
|
||||
locale_charset
|
||||
mb_copy
|
||||
mb_width_aux
|
||||
mbiterf_next
|
||||
mbrtoc32
|
||||
mbsnlen
|
||||
ngettext
|
||||
rpl_getcwd
|
||||
rpl_iswalnum
|
||||
rpl_iswalpha
|
||||
rpl_iswblank
|
||||
rpl_iswcntrl
|
||||
rpl_iswdigit
|
||||
rpl_iswgraph
|
||||
rpl_iswlower
|
||||
rpl_iswprint
|
||||
rpl_iswpunct
|
||||
rpl_iswspace
|
||||
rpl_iswupper
|
||||
rpl_iswxdigit
|
||||
rpl_localeconv
|
||||
rpl_pthread_once
|
||||
rpl_towlower
|
||||
rpl_towupper
|
||||
setlocale_messages
|
||||
setlocale_messages_null
|
||||
textdomain
|
||||
uc_is_alnum
|
||||
uc_is_alpha
|
||||
uc_is_blank
|
||||
uc_is_cntrl
|
||||
uc_is_digit
|
||||
uc_is_graph
|
||||
uc_is_lower
|
||||
uc_is_print
|
||||
uc_is_punct
|
||||
uc_is_space
|
||||
uc_is_upper
|
||||
uc_is_xdigit
|
||||
uc_tolower
|
||||
uc_width
|
||||
wcwidth
|
||||
wgetcwd
|
||||
|
BIN
extlib/gettext.win32/lib.i386/libgnuintl-8.dll
vendored
BIN
extlib/gettext.win32/lib.i386/libgnuintl-8.dll
vendored
Binary file not shown.
BIN
extlib/gettext.win32/lib.i386/libgnuintl-8.exp
vendored
BIN
extlib/gettext.win32/lib.i386/libgnuintl-8.exp
vendored
Binary file not shown.
BIN
extlib/gettext.win32/lib.i386/libgnuintl-8.lib
vendored
BIN
extlib/gettext.win32/lib.i386/libgnuintl-8.lib
vendored
Binary file not shown.
BIN
extlib/gettext.win32/lib.i386/libgnuintl.dll.a
vendored
BIN
extlib/gettext.win32/lib.i386/libgnuintl.dll.a
vendored
Binary file not shown.
@ -1,17 +0,0 @@
|
||||
From: Michele Locati <michele@locati.it>
|
||||
Date: Fri, 10 May 2019 11:11:02 +0200
|
||||
Subject: [PATCH] Fix compilation of pthread_sigmask.c
|
||||
|
||||
--- a/gettext-tools/gnulib-tests/pthread_sigmask.c
|
||||
+++ b/gettext-tools/gnulib-tests/pthread_sigmask.c
|
||||
@@ -30,9 +30,9 @@
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
+#undef pthread_sigmask
|
||||
int
|
||||
pthread_sigmask (int how, const sigset_t *new_mask, sigset_t *old_mask)
|
||||
-#undef pthread_sigmask
|
||||
{
|
||||
#if HAVE_PTHREAD_SIGMASK
|
||||
int ret;
|
57
extlib/gettext.win32/patches/001-gettext-runtime-disable-iconv.patch
vendored
Normal file
57
extlib/gettext.win32/patches/001-gettext-runtime-disable-iconv.patch
vendored
Normal file
@ -0,0 +1,57 @@
|
||||
diff '--color=auto' -ur gettext-0.24.orig/gettext-runtime/config.h.in gettext-0.24/gettext-runtime/config.h.in
|
||||
--- gettext-0.24.orig/gettext-runtime/config.h.in 2025-02-25 05:25:16.000000000 -0500
|
||||
+++ gettext-0.24/gettext-runtime/config.h.in 2025-04-21 13:07:02.520459899 -0400
|
||||
@@ -725,10 +725,12 @@
|
||||
#undef HAVE_GOOD_USELOCALE
|
||||
|
||||
/* Define if you have the iconv() function and it works. */
|
||||
-#undef HAVE_ICONV
|
||||
+/* rom-properties: Disabled. */
|
||||
+/* #undef HAVE_ICONV */
|
||||
|
||||
/* Define to 1 if you have the <iconv.h> header file. */
|
||||
-#undef HAVE_ICONV_H
|
||||
+/* rom-properties: Disabled. */
|
||||
+/* #undef HAVE_ICONV_H */
|
||||
|
||||
/* Define to 1 if the compiler supports one of the keywords 'inline',
|
||||
'__inline__', '__inline' and effectively inlines functions marked as such.
|
||||
@@ -1243,11 +1245,13 @@
|
||||
#undef HAVE___INLINE
|
||||
|
||||
/* Define as const if the declaration of iconv() needs const. */
|
||||
-#undef ICONV_CONST
|
||||
+/* rom-properties: Disabled. */
|
||||
+/* #undef ICONV_CONST */
|
||||
|
||||
/* Define to a symbolic name denoting the flavor of iconv_open()
|
||||
implementation. */
|
||||
-#undef ICONV_FLAVOR
|
||||
+/* rom-properties: Disabled. */
|
||||
+/* #undef ICONV_FLAVOR */
|
||||
|
||||
/* Define to the value of ${prefix}, as a string. */
|
||||
#undef INSTALLPREFIX
|
||||
diff '--color=auto' -ur gettext-0.24.orig/gettext-runtime/intl/config.h.in gettext-0.24/gettext-runtime/intl/config.h.in
|
||||
--- gettext-0.24.orig/gettext-runtime/intl/config.h.in 2025-02-25 05:25:10.000000000 -0500
|
||||
+++ gettext-0.24/gettext-runtime/intl/config.h.in 2025-04-21 13:06:27.935503569 -0400
|
||||
@@ -373,7 +373,8 @@
|
||||
#undef HAVE_GOOD_USELOCALE
|
||||
|
||||
/* Define if you have the iconv() function and it works. */
|
||||
-#undef HAVE_ICONV
|
||||
+/* rom-properties: Disabled. */
|
||||
+/* #undef HAVE_ICONV */
|
||||
|
||||
/* Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>. */
|
||||
#undef HAVE_INTMAX_T
|
||||
@@ -758,7 +759,8 @@
|
||||
#endif
|
||||
|
||||
/* Define as const if the declaration of iconv() needs const. */
|
||||
-#undef ICONV_CONST
|
||||
+/* rom-properties: Disabled. */
|
||||
+/* #undef ICONV_CONST */
|
||||
|
||||
/* Define as the bit index in the word where to find bit 0 of the exponent of
|
||||
'long double'. */
|
@ -1,44 +0,0 @@
|
||||
--- gettext-tools/gnulib-lib/libxml/parser.c.orig 2013-01-18 10:24:37 +0400
|
||||
+++ gettext-tools/gnulib-lib/libxml/parser.c 2013-01-18 10:36:35 +0400
|
||||
@@ -78,6 +78,9 @@
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
#include <stddef.h>
|
||||
+#ifdef HAVE_CTYPE_H
|
||||
+#include <ctype.h>
|
||||
+#endif
|
||||
#include <libxml/xmlmemory.h>
|
||||
#include <libxml/threads.h>
|
||||
#include <libxml/globals.h>
|
||||
@@ -97,9 +100,6 @@
|
||||
#include <libxml/xmlschemastypes.h>
|
||||
#include <libxml/relaxng.h>
|
||||
#endif
|
||||
-#ifdef HAVE_CTYPE_H
|
||||
-#include <ctype.h>
|
||||
-#endif
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
--- gettext-tools/gnulib-lib/libxml/threads.c.orig 2013-01-18 10:38:24 +0400
|
||||
+++ gettext-tools/gnulib-lib/libxml/threads.c 2013-01-18 10:41:11 +0400
|
||||
@@ -41,15 +41,16 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
+#ifdef HAVE_UNISTD_H
|
||||
+#include <unistd.h>
|
||||
+#endif
|
||||
+
|
||||
#include <libxml/threads.h>
|
||||
#include <libxml/globals.h>
|
||||
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
-#ifdef HAVE_UNISTD_H
|
||||
-#include <unistd.h>
|
||||
-#endif
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
@ -1,110 +0,0 @@
|
||||
--- gettext-runtime/libasprintf/gnulib-lib/vasnprintf.h.orig 2023-05-19 00:19:37.000000000 -0400
|
||||
+++ gettext-runtime/libasprintf/gnulib-lib/vasnprintf.h 2023-07-01 12:17:08.374266671 -0400
|
||||
@@ -35,6 +35,8 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
+#if !defined(__USE_MINGW_ANSI_STDIO) && defined(__MINGW64_VERSION_MAJOR)
|
||||
+
|
||||
/* Write formatted output to a string dynamically allocated with malloc().
|
||||
You can pass a preallocated buffer for the result in RESULTBUF and its
|
||||
size in *LENGTHP; otherwise you pass RESULTBUF = NULL.
|
||||
@@ -63,6 +65,7 @@
|
||||
# define asnprintf rpl_asnprintf
|
||||
# define vasnprintf rpl_vasnprintf
|
||||
#endif
|
||||
+
|
||||
extern char * asnprintf (char *restrict resultbuf, size_t *lengthp,
|
||||
const char *format, ...)
|
||||
_GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, 3, 4));
|
||||
@@ -70,6 +73,8 @@
|
||||
const char *format, va_list args)
|
||||
_GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, 3, 0));
|
||||
|
||||
+#endif /* !defined(__USE_MINGW_ANSI_STDIO) && defined(__MINGW64_VERSION_MAJOR) */
|
||||
+
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
--- gettext-runtime/intl/gnulib-lib/vasnprintf.h.orig 2023-05-19 00:19:37.000000000 -0400
|
||||
+++ gettext-runtime/intl/gnulib-lib/vasnprintf.h 2023-07-01 12:17:08.374266671 -0400
|
||||
@@ -35,6 +35,8 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
+#if !defined(__USE_MINGW_ANSI_STDIO) && defined(__MINGW64_VERSION_MAJOR)
|
||||
+
|
||||
/* Write formatted output to a string dynamically allocated with malloc().
|
||||
You can pass a preallocated buffer for the result in RESULTBUF and its
|
||||
size in *LENGTHP; otherwise you pass RESULTBUF = NULL.
|
||||
@@ -63,6 +65,7 @@
|
||||
# define asnprintf rpl_asnprintf
|
||||
# define vasnprintf rpl_vasnprintf
|
||||
#endif
|
||||
+
|
||||
extern char * asnprintf (char *restrict resultbuf, size_t *lengthp,
|
||||
const char *format, ...)
|
||||
_GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, 3, 4));
|
||||
@@ -70,6 +73,8 @@
|
||||
const char *format, va_list args)
|
||||
_GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, 3, 0));
|
||||
|
||||
+#endif /* !defined(__USE_MINGW_ANSI_STDIO) && defined(__MINGW64_VERSION_MAJOR) */
|
||||
+
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
--- gettext-runtime/libasprintf/vasprintf.h.orig 2019-05-11 07:29:32.000000000 -0400
|
||||
+++ gettext-runtime/libasprintf/vasprintf.h 2023-07-01 12:15:45.172287523 -0400
|
||||
@@ -37,6 +37,8 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
+#if !defined(__USE_MINGW_ANSI_STDIO) && defined(__MINGW64_VERSION_MAJOR)
|
||||
+
|
||||
/* Write formatted output to a string dynamically allocated with malloc().
|
||||
If the memory allocation succeeds, store the address of the string in
|
||||
*RESULT and return the number of resulting bytes, excluding the trailing
|
||||
@@ -46,6 +48,8 @@
|
||||
extern int vasprintf (char **result, const char *format, va_list args)
|
||||
__attribute__ ((__format__ (__printf__, 2, 0)));
|
||||
|
||||
+#endif /* !defined(__USE_MINGW_ANSI_STDIO) && defined(__MINGW64_VERSION_MAJOR) */
|
||||
+
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
--- gettext-runtime/libasprintf/gnulib-lib/vasnprintf.c.orig 2023-06-12 13:34:50.000000000 -0400
|
||||
+++ gettext-runtime/libasprintf/gnulib-lib/vasnprintf.c 2023-07-01 12:19:12.477235568 -0400
|
||||
@@ -80,7 +80,14 @@
|
||||
#endif
|
||||
|
||||
#include <locale.h> /* localeconv() */
|
||||
+#if defined(__MINGW64_VERSION_MAJOR) && defined(__USE_MINGW_ANSI_STDIO)
|
||||
+# define REMOVED__USE_MINGW_ANSI_STDIO
|
||||
+# undef __USE_MINGW_ANSI_STDIO
|
||||
+#endif
|
||||
#include <stdio.h> /* snprintf(), sprintf() */
|
||||
+#if defined(__MINGW64_VERSION_MAJOR) && defined(REMOVED__USE_MINGW_ANSI_STDIO)
|
||||
+# define __USE_MINGW_ANSI_STDIO 1
|
||||
+#endif
|
||||
#include <stdlib.h> /* abort(), malloc(), realloc(), free() */
|
||||
#include <string.h> /* memcpy(), strlen() */
|
||||
#include <wchar.h> /* mbstate_t, mbrtowc(), mbrlen(), wcrtomb() */
|
||||
--- gettext-runtime/intl/gnulib-lib/vasnprintf.c.orig 2023-06-12 13:34:50.000000000 -0400
|
||||
+++ gettext-runtime/intl/gnulib-lib/vasnprintf.c 2023-07-01 12:19:12.477235568 -0400
|
||||
@@ -80,7 +80,14 @@
|
||||
#endif
|
||||
|
||||
#include <locale.h> /* localeconv() */
|
||||
+#if defined(__MINGW64_VERSION_MAJOR) && defined(__USE_MINGW_ANSI_STDIO)
|
||||
+# define REMOVED__USE_MINGW_ANSI_STDIO
|
||||
+# undef __USE_MINGW_ANSI_STDIO
|
||||
+#endif
|
||||
#include <stdio.h> /* snprintf(), sprintf() */
|
||||
+#if defined(__MINGW64_VERSION_MAJOR) && defined(REMOVED__USE_MINGW_ANSI_STDIO)
|
||||
+# define __USE_MINGW_ANSI_STDIO 1
|
||||
+#endif
|
||||
#include <stdlib.h> /* abort(), malloc(), realloc(), free() */
|
||||
#include <string.h> /* memcpy(), strlen() */
|
||||
#include <wchar.h> /* mbstate_t, mbrtowc(), mbrlen(), wcrtomb() */
|
@ -1,11 +0,0 @@
|
||||
--- gettext-runtime/intl/libgnuintl.in.h.orig 2023-06-17 06:58:50.000000000 -0400
|
||||
+++ gettext-runtime/intl/libgnuintl.in.h 2023-07-01 12:21:22.071203089 -0400
|
||||
@@ -385,7 +385,7 @@
|
||||
|
||||
# if !((defined printf && defined _GL_STDIO_H) || defined GNULIB_overrides_printf) /* don't override gnulib */
|
||||
# undef printf
|
||||
-# if defined __NetBSD__ || defined __BEOS__ || defined __CYGWIN__ || defined __MINGW32__
|
||||
+# if defined __NetBSD__ || defined __BEOS__ || defined __CYGWIN__ || defined __MINGW32__ || defined _MSC_VER
|
||||
/* Don't break __attribute__((format(printf,M,N))).
|
||||
This redefinition is only possible because the libc in NetBSD, Cygwin,
|
||||
mingw does not have a function __printf__.
|
@ -1,88 +0,0 @@
|
||||
--- gettext-0.22/gettext-tools/config.h.in.orig 2023-07-28 11:27:02.945221690 -0400
|
||||
+++ gettext-0.22/gettext-tools/config.h.in 2023-07-28 11:28:23.103950976 -0400
|
||||
@@ -1450,10 +1450,12 @@
|
||||
#undef HAVE_GOOD_USELOCALE
|
||||
|
||||
/* Define if you have the iconv() function and it works. */
|
||||
-#undef HAVE_ICONV
|
||||
+/* rom-properties: Disabled. */
|
||||
+/* #undef HAVE_ICONV */
|
||||
|
||||
/* Define to 1 if you have the <iconv.h> header file. */
|
||||
-#undef HAVE_ICONV_H
|
||||
+/* rom-properties: Disabled. */
|
||||
+/* #undef HAVE_ICONV_H */
|
||||
|
||||
/* Define to 1 if you have the `inet_ntop' function. */
|
||||
#undef HAVE_INET_NTOP
|
||||
@@ -2315,11 +2317,13 @@
|
||||
#undef HAVE___XPG_STRERROR_R
|
||||
|
||||
/* Define as const if the declaration of iconv() needs const. */
|
||||
-#undef ICONV_CONST
|
||||
+/* rom-properties: Disabled. */
|
||||
+/* #undef ICONV_CONST */
|
||||
|
||||
/* Define to a symbolic name denoting the flavor of iconv_open()
|
||||
implementation. */
|
||||
-#undef ICONV_FLAVOR
|
||||
+/* rom-properties: Disabled. */
|
||||
+/* #undef ICONV_FLAVOR */
|
||||
|
||||
/* Define to the value of ${prefix}, as a string. */
|
||||
#undef INSTALLPREFIX
|
||||
--- gettext-0.22/gettext-runtime/config.h.in.orig 2023-07-28 11:27:15.394179647 -0400
|
||||
+++ gettext-0.22/gettext-runtime/config.h.in 2023-07-28 11:28:35.397909457 -0400
|
||||
@@ -533,10 +533,12 @@
|
||||
#undef HAVE_GOOD_USELOCALE
|
||||
|
||||
/* Define if you have the iconv() function and it works. */
|
||||
-#undef HAVE_ICONV
|
||||
+/* rom-properties: Disabled. */
|
||||
+/* #undef HAVE_ICONV */
|
||||
|
||||
/* Define to 1 if you have the <iconv.h> header file. */
|
||||
-#undef HAVE_ICONV_H
|
||||
+/* rom-properties: Disabled. */
|
||||
+/* #undef HAVE_ICONV_H */
|
||||
|
||||
/* Define to 1 if the compiler supports one of the keywords 'inline',
|
||||
'__inline__', '__inline' and effectively inlines functions marked as such.
|
||||
@@ -958,11 +960,13 @@
|
||||
#undef HAVE___INLINE
|
||||
|
||||
/* Define as const if the declaration of iconv() needs const. */
|
||||
-#undef ICONV_CONST
|
||||
+/* rom-properties: Disabled. */
|
||||
+/* #undef ICONV_CONST */
|
||||
|
||||
/* Define to a symbolic name denoting the flavor of iconv_open()
|
||||
implementation. */
|
||||
-#undef ICONV_FLAVOR
|
||||
+/* rom-properties: Disabled. */
|
||||
+/* #undef ICONV_FLAVOR */
|
||||
|
||||
/* Define to the value of ${prefix}, as a string. */
|
||||
#undef INSTALLPREFIX
|
||||
--- gettext-0.22/gettext-runtime/intl/config.h.in.orig 2023-06-17 07:53:52.000000000 -0400
|
||||
+++ gettext-0.22/gettext-runtime/intl/config.h.in 2023-07-28 11:28:42.230886380 -0400
|
||||
@@ -351,7 +351,8 @@
|
||||
#undef HAVE_GOOD_USELOCALE
|
||||
|
||||
/* Define if you have the iconv() function and it works. */
|
||||
-#undef HAVE_ICONV
|
||||
+/* rom-properties: Disabled. */
|
||||
+/* #undef HAVE_ICONV */
|
||||
|
||||
/* Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>. */
|
||||
#undef HAVE_INTMAX_T
|
||||
@@ -715,7 +716,8 @@
|
||||
#endif
|
||||
|
||||
/* Define as const if the declaration of iconv() needs const. */
|
||||
-#undef ICONV_CONST
|
||||
+/* rom-properties: Disabled. */
|
||||
+/* #undef ICONV_CONST */
|
||||
|
||||
/* Define to the value of ${prefix}, as a string. */
|
||||
#undef INSTALLPREFIX
|
@ -1,13 +0,0 @@
|
||||
--- gettext-0.21/gettext-runtime/intl/dcigettext.c.orig 2020-06-06 10:03:32.000000000 -0400
|
||||
+++ gettext-0.21/gettext-runtime/intl/dcigettext.c 2020-08-20 11:57:33.117783195 -0400
|
||||
@@ -65,6 +65,10 @@
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
+#if defined _WIN32 && !defined __CYGWIN__
|
||||
+# include <wchar.h>
|
||||
+#endif
|
||||
+
|
||||
#include <locale.h>
|
||||
|
||||
#ifdef _LIBC
|
@ -1,10 +0,0 @@
|
||||
--- gettext-0.21/gettext-tools/woe32dll/gettextsrc-exports.c.orig 2019-12-23 06:21:12.000000000 -0500
|
||||
+++ gettext-0.21/gettext-tools/woe32dll/gettextsrc-exports.c 2020-08-20 12:20:30.752088214 -0400
|
||||
@@ -50,6 +50,7 @@
|
||||
VARIABLE(formatstring_python_brace)
|
||||
VARIABLE(formatstring_qt)
|
||||
VARIABLE(formatstring_qt_plural)
|
||||
+VARIABLE(formatstring_ruby)
|
||||
VARIABLE(formatstring_scheme)
|
||||
VARIABLE(formatstring_sh)
|
||||
VARIABLE(formatstring_smalltalk)
|
@ -1,17 +0,0 @@
|
||||
--- gettext-0.21/gettext-runtime/config.h.in.orig 2020-07-26 17:03:57.000000000 -0400
|
||||
+++ gettext-0.21/gettext-runtime/config.h.in 2020-08-20 12:49:17.066788915 -0400
|
||||
@@ -391,10 +391,12 @@
|
||||
#undef HAVE_GETUID
|
||||
|
||||
/* Define if you have the iconv() function and it works. */
|
||||
-#undef HAVE_ICONV
|
||||
+/* rom-properties: Disabled. */
|
||||
+/* #undef HAVE_ICONV */
|
||||
|
||||
/* Define to 1 if you have the <iconv.h> header file. */
|
||||
-#undef HAVE_ICONV_H
|
||||
+/* rom-properties: Disabled. */
|
||||
+/* #undef HAVE_ICONV_H */
|
||||
|
||||
/* Define to 1 if the compiler supports one of the keywords 'inline',
|
||||
'__inline__', '__inline' and effectively inlines functions marked as such.
|
@ -1,19 +1,5 @@
|
||||
From 89170435bde2d889dee8b20c74d7771e6af8f19e Mon Sep 17 00:00:00 2001
|
||||
From: Tim S <stahta01@users.sourceforge.net>
|
||||
Date: Sun, 16 Sep 2018 10:35:04 -0400
|
||||
Subject: [PATCH] Use LF as newline in envsubst
|
||||
|
||||
Now using underline prefix in functions as stated at:
|
||||
https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/setmode
|
||||
And, change mode back to prior mode
|
||||
|
||||
---
|
||||
gettext-runtime/src/envsubst.c | 18 ++++++++++++++++++
|
||||
1 file changed, 18 insertions(+)
|
||||
|
||||
diff a/gettext-runtime/src/envsubst.c b/gettext-runtime/src/envsubst.c
|
||||
--- a/gettext-runtime/src/envsubst.c.orig 2023-06-17 06:58:50.000000000 -0400
|
||||
+++ b/gettext-runtime/src/envsubst.c 2023-07-01 12:25:40.029138440 -0400
|
||||
--- ./gettext-runtime/src/envsubst.c.orig 2024-12-31 05:05:32.000000000 -0500
|
||||
+++ ./gettext-runtime/src/envsubst.c 2025-01-06 11:44:15.432757696 -0500
|
||||
@@ -28,6 +28,11 @@
|
||||
#include <unistd.h>
|
||||
#include <locale.h>
|
||||
@ -23,10 +9,10 @@ diff a/gettext-runtime/src/envsubst.c b/gettext-runtime/src/envsubst.c
|
||||
+# include <fcntl.h>
|
||||
+#endif
|
||||
+
|
||||
#include <error.h>
|
||||
#include "attribute.h"
|
||||
#include "noreturn.h"
|
||||
#include "closeout.h"
|
||||
#include "error.h"
|
||||
@@ -289,8 +294,21 @@
|
||||
@@ -292,8 +297,21 @@
|
||||
static void
|
||||
print_variable (const char *var_ptr, size_t var_len)
|
||||
{
|
||||
|
@ -1,12 +0,0 @@
|
||||
for relocate()
|
||||
--- gettext-0.19.8.1/gettext-tools/gnulib-lib/Makefile.am.orig 2019-05-11 22:20:53.069987300 +0200
|
||||
+++ gettext-0.19.8.1/gettext-tools/gnulib-lib/Makefile.am 2019-05-11 22:21:54.510209600 +0200
|
||||
@@ -48,6 +48,8 @@
|
||||
# Parametrization of the 'relocatable' module.
|
||||
AM_CPPFLAGS += -DDEPENDS_ON_LIBICONV=1 -DDEPENDS_ON_LIBINTL=1
|
||||
|
||||
+AM_CPPFLAGS += -DINSTALLDIR=\"$(bindir)\"
|
||||
+
|
||||
# Parametrization of the 'libxml' module:
|
||||
# When building a shared library, don't export the variables
|
||||
# xmlMalloc, xmlMallocAtomic, xmlRealloc, xmlFree, xmlMemStrdup.
|
2
extlib/googletest/CMakeLists.txt
vendored
2
extlib/googletest/CMakeLists.txt
vendored
@ -1,7 +1,7 @@
|
||||
# Note: CMake support is community-based. The maintainers do not use CMake
|
||||
# internally.
|
||||
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
cmake_minimum_required(VERSION 3.5...3.10)
|
||||
|
||||
if (POLICY CMP0048)
|
||||
cmake_policy(SET CMP0048 NEW)
|
||||
|
2
extlib/googletest/googlemock/CMakeLists.txt
vendored
2
extlib/googletest/googlemock/CMakeLists.txt
vendored
@ -36,7 +36,7 @@ endif()
|
||||
# as ${gmock_SOURCE_DIR} and to the root binary directory as
|
||||
# ${gmock_BINARY_DIR}.
|
||||
# Language "C" is required for find_package(Threads).
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
cmake_minimum_required(VERSION 3.5...3.10)
|
||||
cmake_policy(SET CMP0048 NEW)
|
||||
project(gmock VERSION ${GOOGLETEST_VERSION} LANGUAGES CXX C)
|
||||
|
||||
|
2
extlib/googletest/googletest/CMakeLists.txt
vendored
2
extlib/googletest/googletest/CMakeLists.txt
vendored
@ -46,7 +46,7 @@ endif()
|
||||
|
||||
# Project version:
|
||||
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
cmake_minimum_required(VERSION 3.5...3.10)
|
||||
cmake_policy(SET CMP0048 NEW)
|
||||
project(gtest VERSION ${GOOGLETEST_VERSION} LANGUAGES CXX C)
|
||||
|
||||
|
94
extlib/libpng/.cmake-format.yaml
vendored
Normal file
94
extlib/libpng/.cmake-format.yaml
vendored
Normal file
@ -0,0 +1,94 @@
|
||||
# https://pypi.org/project/cmakelang
|
||||
# https://github.com/cheshirekow/cmake_format
|
||||
|
||||
# ----------------------
|
||||
# Options for formatting
|
||||
# ----------------------
|
||||
|
||||
# How wide to allow formatted cmake files
|
||||
# TODO: Reflow the CMake files to allow setting the maximum line width to 100.
|
||||
line_width: 255
|
||||
|
||||
# How many spaces to tab for indent
|
||||
tab_size: 2
|
||||
|
||||
# If true, lines are indented using tab characters (utf-8 0x09) instead of
|
||||
# <tab_size> space characters (utf-8 0x20). In cases where the layout would
|
||||
# require a fractional tab character, the behavior of the fractional
|
||||
# indentation is governed by <fractional_tab_policy>
|
||||
use_tabchars: false
|
||||
|
||||
# If <use_tabchars> is True, then the value of this variable indicates how
|
||||
# fractional indentions are handled during whitespace replacement. If set to
|
||||
# 'use-space', fractional indentation is left as spaces (utf-8 0x20). If set
|
||||
# to `round-up` fractional indentation is replaced with a single tab character
|
||||
# (utf-8 0x09) effectively shifting the column to the next tabstop
|
||||
fractional_tab_policy: "use-space"
|
||||
|
||||
# Enable comment markup parsing and reflow
|
||||
enable_markup: false
|
||||
|
||||
# -------------------
|
||||
# Options for linting
|
||||
# -------------------
|
||||
|
||||
# Lint codes to disable
|
||||
disabled_codes: [
|
||||
# TODO:
|
||||
# Reconcile the CMake variable names with the patterns below, then
|
||||
# re-enable the "invalid variable name XXX" messages.
|
||||
"C0103",
|
||||
|
||||
# TODO:
|
||||
# Add brief COMMENT arguments to the `add_custom_target` commands.
|
||||
"C0113",
|
||||
]
|
||||
|
||||
# Regular expression pattern describing valid function names
|
||||
function_pattern: "[0-9a-z_]+"
|
||||
|
||||
# Regular expression pattern describing valid macro names
|
||||
macro_pattern: "[0-9A-Z_]+"
|
||||
|
||||
# Regular expression pattern describing valid names for variables with global
|
||||
# (cache) scope
|
||||
global_var_pattern: "[A-Z][0-9A-Z_]+"
|
||||
|
||||
# Regular expression pattern describing valid names for variables with global
|
||||
# scope (but internal semantic)
|
||||
internal_var_pattern: "_[A-Z][0-9A-Z_]+"
|
||||
|
||||
# Regular expression pattern describing valid names for variables with local
|
||||
# scope
|
||||
local_var_pattern: "[a-z][a-z0-9_]+"
|
||||
|
||||
# Regular expression pattern describing valid names for privatedirectory
|
||||
# variables
|
||||
private_var_pattern: "_[0-9a-z_]+"
|
||||
|
||||
# Regular expression pattern describing valid names for public directory
|
||||
# variables
|
||||
public_var_pattern: "[A-Z][0-9A-Z_]+"
|
||||
|
||||
# Regular expression pattern describing valid names for function/macro
|
||||
# arguments and loop variables.
|
||||
argument_var_pattern: "[a-z][a-z0-9_]+"
|
||||
|
||||
# Regular expression pattern describing valid names for keywords used in
|
||||
# functions or macros
|
||||
keyword_pattern: "[A-Z][0-9A-Z_]+"
|
||||
|
||||
# In the heuristic for C0201, how many conditionals to match within a loop in
|
||||
# before considering the loop a parser
|
||||
max_conditionals_custom_parser: 2
|
||||
|
||||
# Require at least this many newlines between statements;
|
||||
# require no more than this many newlines between statements;
|
||||
# etc.
|
||||
min_statement_spacing: 1
|
||||
max_statement_spacing: 2
|
||||
max_returns: 6
|
||||
max_branches: 12
|
||||
max_arguments: 5
|
||||
max_localvars: 15
|
||||
max_statements: 50
|
28
extlib/libpng/ANNOUNCE
vendored
28
extlib/libpng/ANNOUNCE
vendored
@ -1,5 +1,5 @@
|
||||
libpng 1.6.47 - February 18, 2025
|
||||
=================================
|
||||
libpng 1.6.49 - June 12, 2025
|
||||
=============================
|
||||
|
||||
This is a public release of libpng, intended for use in production code.
|
||||
|
||||
@ -9,13 +9,13 @@ Files available for download
|
||||
|
||||
Source files with LF line endings (for Unix/Linux):
|
||||
|
||||
* libpng-1.6.47.tar.xz (LZMA-compressed, recommended)
|
||||
* libpng-1.6.47.tar.gz (deflate-compressed)
|
||||
* libpng-1.6.49.tar.xz (LZMA-compressed, recommended)
|
||||
* libpng-1.6.49.tar.gz (deflate-compressed)
|
||||
|
||||
Source files with CRLF line endings (for Windows):
|
||||
|
||||
* lpng1647.7z (LZMA-compressed, recommended)
|
||||
* lpng1647.zip (deflate-compressed)
|
||||
* lpng1649.7z (LZMA-compressed, recommended)
|
||||
* lpng1649.zip (deflate-compressed)
|
||||
|
||||
Other information:
|
||||
|
||||
@ -25,19 +25,13 @@ Other information:
|
||||
* TRADEMARK.md
|
||||
|
||||
|
||||
Changes from version 1.6.46 to version 1.6.47
|
||||
Changes from version 1.6.48 to version 1.6.49
|
||||
---------------------------------------------
|
||||
|
||||
* Modified the behaviour of colorspace chunks in order to adhere
|
||||
to the new precedence rules formulated in the latest draft of
|
||||
the PNG Specification.
|
||||
(Contributed by John Bowler)
|
||||
* Fixed a latent bug in `png_write_iCCP`.
|
||||
This would have been a read-beyond-end-of-malloc vulnerability,
|
||||
introduced early in the libpng-1.6.0 development, yet (fortunately!)
|
||||
it was inaccessible before the above-mentioned modification of the
|
||||
colorspace precedence rules, due to pre-existing colorspace checks.
|
||||
(Reported by Bob Friesenhahn; fixed by John Bowler)
|
||||
* Added SIMD-optimized code for the RISC-V Vector Extension (RVV).
|
||||
(Contributed by Manfred Schlaegl, Dragos Tiselice and Filip Wasil)
|
||||
* Added various fixes and improvements to the build scripts and to
|
||||
the sample code.
|
||||
|
||||
|
||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net.
|
||||
|
6
extlib/libpng/AUTHORS
vendored
6
extlib/libpng/AUTHORS
vendored
@ -20,6 +20,7 @@ Authors, for copyright and licensing purposes.
|
||||
* Lucas Chollet
|
||||
* Magnus Holmgren
|
||||
* Mandar Sahastrabuddhe
|
||||
* Manfred Schlaegl
|
||||
* Mans Rullgard
|
||||
* Matt Sarett
|
||||
* Mike Klein
|
||||
@ -40,8 +41,9 @@ Authors, for copyright and licensing purposes.
|
||||
- Zixu Wang (王子旭)
|
||||
* Arm Holdings
|
||||
- Richard Townsend
|
||||
* Google Inc.
|
||||
* Google LLC
|
||||
- Dan Field
|
||||
- Dragoș Tiselice
|
||||
- Leon Scroggins III
|
||||
- Matt Sarett
|
||||
- Mike Klein
|
||||
@ -51,6 +53,8 @@ Authors, for copyright and licensing purposes.
|
||||
- GuXiWei (顾希伟)
|
||||
- JinBo (金波)
|
||||
- ZhangLixia (张利霞)
|
||||
* Samsung Group
|
||||
- Filip Wasil
|
||||
|
||||
The build projects, the build scripts, the test scripts, and other
|
||||
files in the "projects", "scripts" and "tests" directories, have
|
||||
|
16
extlib/libpng/CHANGES
vendored
16
extlib/libpng/CHANGES
vendored
@ -6251,6 +6251,22 @@ Version 1.6.47 [February 18, 2025]
|
||||
colorspace precedence rules, due to pre-existing colorspace checks.
|
||||
(Reported by Bob Friesenhahn; fixed by John Bowler)
|
||||
|
||||
Version 1.6.48 [April 30, 2025]
|
||||
Fixed the floating-point version of the mDCv setter `png_set_mDCv`.
|
||||
(Reported by Mohit Bakshi; fixed by John Bowler)
|
||||
Added #error directives to discourage the inclusion of private
|
||||
libpng implementation header files in PNG-supporting applications.
|
||||
Added the CMake build option `PNG_LIBCONF_HEADER`, to be used as an
|
||||
alternative to `DFA_XTRA`.
|
||||
Removed the Travis CI configuration files, with heartfelt thanks for
|
||||
their generous support of our project over the past five years!
|
||||
|
||||
Version 1.6.49 [June 12, 2025]
|
||||
Added SIMD-optimized code for the RISC-V Vector Extension (RVV).
|
||||
(Contributed by Manfred Schlaegl, Dragos Tiselice and Filip Wasil)
|
||||
Added various fixes and improvements to the build scripts and to
|
||||
the sample code.
|
||||
|
||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net.
|
||||
Subscription is required; visit
|
||||
https://lists.sourceforge.net/lists/listinfo/png-mng-implement
|
||||
|
550
extlib/libpng/CMakeLists.txt
vendored
550
extlib/libpng/CMakeLists.txt
vendored
@ -1,4 +1,3 @@
|
||||
|
||||
# CMakeLists.txt - CMake lists for libpng
|
||||
#
|
||||
# Copyright (c) 2018-2025 Cosmin Truta
|
||||
@ -16,13 +15,11 @@
|
||||
# SPDX-License-Identifier: libpng-2.0
|
||||
|
||||
# rom-properties: Disabled; use the main project policies.
|
||||
IF(0)
|
||||
cmake_minimum_required(VERSION 3.14)
|
||||
ENDIF(0) # rom-properties
|
||||
#cmake_minimum_required(VERSION 3.14...4.0)
|
||||
|
||||
set(PNGLIB_MAJOR 1)
|
||||
set(PNGLIB_MINOR 6)
|
||||
set(PNGLIB_REVISION 47)
|
||||
set(PNGLIB_REVISION 49)
|
||||
set(PNGLIB_SUBREVISION 0)
|
||||
#set(PNGLIB_SUBREVISION "git")
|
||||
set(PNGLIB_VERSION ${PNGLIB_MAJOR}.${PNGLIB_MINOR}.${PNGLIB_REVISION})
|
||||
@ -46,19 +43,39 @@ ENDIF(0) # rom-properties
|
||||
|
||||
# Allow the users to specify an application-specific API prefix for libpng
|
||||
# vendoring purposes. A standard libpng build should have no such prefix.
|
||||
set(PNG_PREFIX ""
|
||||
set(PNG_PREFIX
|
||||
""
|
||||
CACHE STRING "Prefix to prepend to the API function names")
|
||||
|
||||
# Allow the users to override the postfix appended to debug library file names.
|
||||
# Previously, we used to set CMAKE_DEBUG_POSTFIX globally. That variable should
|
||||
# not be cached, however, because doing so would affect all projects processed
|
||||
# after libpng, in unexpected and undesirable ways.
|
||||
set(PNG_DEBUG_POSTFIX "d"
|
||||
set(PNG_DEBUG_POSTFIX
|
||||
"d"
|
||||
CACHE STRING "Postfix to append to library file names under the Debug configuration")
|
||||
|
||||
# Allow the users to import their own extra configuration settings.
|
||||
set(DFA_XTRA ""
|
||||
CACHE FILEPATH "File containing extra configuration settings")
|
||||
# Those settings can be either passed via DFA_XTRA if they are in DFA form
|
||||
# (such as "pngusr.dfa"), or via PNG_LIBCONF_HEADER if they are in prebuilt
|
||||
# header file form (such as "scripts/pnglibconf.h.prebuilt"), but not both.
|
||||
# For platforms such as Android or iOS, or in certain cross-platform build
|
||||
# scenarios, having a valid PNG_LIBCONF_HEADER is mandatory.
|
||||
set(DFA_XTRA
|
||||
""
|
||||
CACHE FILEPATH "DFA file containing customized build configuration settings for libpng")
|
||||
set(PNG_LIBCONF_HEADER
|
||||
""
|
||||
CACHE FILEPATH "C header file containing customized build configuration settings for libpng")
|
||||
set(PNG_LIBCONF_HEADER_PREBUILT "${CMAKE_CURRENT_SOURCE_DIR}/scripts/pnglibconf.h.prebuilt")
|
||||
if(ANDROID OR IOS)
|
||||
set(PNG_LIBCONF_HEADER "${PNG_LIBCONF_HEADER_PREBUILT}")
|
||||
endif()
|
||||
if((NOT DFA_XTRA STREQUAL "") AND (NOT PNG_LIBCONF_HEADER STREQUAL ""))
|
||||
message(SEND_ERROR "The options DFA_XTRA=\"${DFA_XTRA}\" "
|
||||
"and PNG_LIBCONF_HEADER=\"${PNG_LIBCONF_HEADER}\" "
|
||||
"are mutually exclusive")
|
||||
endif()
|
||||
|
||||
# rom-properties: Hard-coded values in extlib are used.
|
||||
IF(0)
|
||||
@ -67,6 +84,11 @@ option(PNG_SHARED "Build libpng as a shared library" ON)
|
||||
option(PNG_STATIC "Build libpng as a static library" ON)
|
||||
if(APPLE)
|
||||
option(PNG_FRAMEWORK "Build libpng as a framework bundle" ON)
|
||||
else()
|
||||
option(PNG_FRAMEWORK "Build libpng as a framework bundle (not available on this platform)" OFF)
|
||||
endif()
|
||||
if(NOT APPLE AND PNG_FRAMEWORK)
|
||||
message(SEND_ERROR "The option PNG_FRAMEWORK should not be set on this platform")
|
||||
endif()
|
||||
|
||||
# Allow the users to switch on/off the auxiliary build and test artifacts.
|
||||
@ -88,14 +110,13 @@ option(PNG_EXECUTABLES "[Deprecated; please use PNG_TOOLS]" ON)
|
||||
if(NOT PNG_EXECUTABLES)
|
||||
message(DEPRECATION "The option PNG_EXECUTABLES has been deprecated in favour of PNG_TOOLS")
|
||||
if(PNG_TOOLS)
|
||||
message(AUTHOR_WARNING
|
||||
"Setting PNG_TOOLS to ${PNG_EXECUTABLES}, to stay compatible with PNG_EXECUTABLES")
|
||||
message(AUTHOR_WARNING "Setting PNG_TOOLS to ${PNG_EXECUTABLES}, "
|
||||
"to stay compatible with PNG_EXECUTABLES")
|
||||
set(PNG_TOOLS "${PNG_EXECUTABLES}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Allow the users to configure various compilation options.
|
||||
option(PNG_DEBUG "Enable debug output" OFF)
|
||||
# Allow the users to switch on/off the use of hardware (SIMD) optimized code.
|
||||
option(PNG_HARDWARE_OPTIMIZATIONS "Enable hardware optimizations" ON)
|
||||
ENDIF(0) # rom-properties
|
||||
|
||||
@ -123,19 +144,21 @@ ENDIF(0) # rom-properties
|
||||
|
||||
if(PNG_BUILD_ZLIB)
|
||||
if("x${ZLIB_ROOT}" STREQUAL "x")
|
||||
#message(SEND_ERROR
|
||||
message(DEPRECATION
|
||||
"The option PNG_BUILD_ZLIB=${PNG_BUILD_ZLIB} is no longer supported; "
|
||||
"please use ZLIB_ROOT instead")
|
||||
#message(SEND_ERROR "The option PNG_BUILD_ZLIB=${PNG_BUILD_ZLIB} is no longer supported; "
|
||||
# "please use ZLIB_ROOT instead")
|
||||
message(DEPRECATION "The option PNG_BUILD_ZLIB=${PNG_BUILD_ZLIB} is no longer supported; "
|
||||
"please use ZLIB_ROOT instead")
|
||||
else()
|
||||
message(SEND_ERROR
|
||||
"The option PNG_BUILD_ZLIB=${PNG_BUILD_ZLIB} is no longer supported; "
|
||||
"using ZLIB_ROOT=\"${ZLIB_ROOT}\"")
|
||||
#message(SEND_ERROR "The option PNG_BUILD_ZLIB=${PNG_BUILD_ZLIB} is no longer supported; "
|
||||
# "using ZLIB_ROOT=\"${ZLIB_ROOT}\"")
|
||||
message(DEPRECATION "The option PNG_BUILD_ZLIB=${PNG_BUILD_ZLIB} is no longer supported; "
|
||||
"using ZLIB_ROOT=\"${ZLIB_ROOT}\"")
|
||||
endif()
|
||||
else()
|
||||
find_package(ZLIB REQUIRED)
|
||||
endif()
|
||||
|
||||
# Find the math library (where available).
|
||||
if(UNIX
|
||||
AND NOT (APPLE OR BEOS OR HAIKU)
|
||||
AND NOT EMSCRIPTEN)
|
||||
@ -149,21 +172,30 @@ else()
|
||||
# libm is not available or not needed.
|
||||
endif()
|
||||
|
||||
# Silence function deprecation warnings on the Windows compilers that might
|
||||
# use the MSVC Runtime library headers.
|
||||
if(WIN32 AND (CMAKE_C_COMPILER_ID MATCHES "MSVC|Intel|Clang"))
|
||||
add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
|
||||
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
|
||||
endif()
|
||||
|
||||
if(PNG_HARDWARE_OPTIMIZATIONS)
|
||||
|
||||
# Set definitions and sources for ARM.
|
||||
if(PNG_TARGET_ARCHITECTURE MATCHES "^(arm|aarch)")
|
||||
if(PNG_TARGET_ARCHITECTURE MATCHES "^(arm64|aarch64)")
|
||||
set(PNG_ARM_NEON_POSSIBLE_VALUES on off)
|
||||
set(PNG_ARM_NEON "on"
|
||||
set(PNG_ARM_NEON
|
||||
"on"
|
||||
CACHE STRING "Enable ARM NEON optimizations: on|off; on is default")
|
||||
else()
|
||||
set(PNG_ARM_NEON_POSSIBLE_VALUES check on off)
|
||||
set(PNG_ARM_NEON "off"
|
||||
set(PNG_ARM_NEON
|
||||
"off"
|
||||
CACHE STRING "Enable ARM NEON optimizations: check|on|off; off is default")
|
||||
endif()
|
||||
set_property(CACHE PNG_ARM_NEON
|
||||
PROPERTY STRINGS ${PNG_ARM_NEON_POSSIBLE_VALUES})
|
||||
PROPERTY STRINGS ${PNG_ARM_NEON_POSSIBLE_VALUES})
|
||||
list(FIND PNG_ARM_NEON_POSSIBLE_VALUES ${PNG_ARM_NEON} index)
|
||||
if(index EQUAL -1)
|
||||
message(FATAL_ERROR "PNG_ARM_NEON must be one of [${PNG_ARM_NEON_POSSIBLE_VALUES}]")
|
||||
@ -185,10 +217,11 @@ if(PNG_HARDWARE_OPTIMIZATIONS)
|
||||
# Set definitions and sources for PowerPC.
|
||||
if(PNG_TARGET_ARCHITECTURE MATCHES "^(powerpc|ppc64)")
|
||||
set(PNG_POWERPC_VSX_POSSIBLE_VALUES on off)
|
||||
set(PNG_POWERPC_VSX "on"
|
||||
set(PNG_POWERPC_VSX
|
||||
"on"
|
||||
CACHE STRING "Enable POWERPC VSX optimizations: on|off; on is default")
|
||||
set_property(CACHE PNG_POWERPC_VSX
|
||||
PROPERTY STRINGS ${PNG_POWERPC_VSX_POSSIBLE_VALUES})
|
||||
PROPERTY STRINGS ${PNG_POWERPC_VSX_POSSIBLE_VALUES})
|
||||
list(FIND PNG_POWERPC_VSX_POSSIBLE_VALUES ${PNG_POWERPC_VSX} index)
|
||||
if(index EQUAL -1)
|
||||
message(FATAL_ERROR "PNG_POWERPC_VSX must be one of [${PNG_POWERPC_VSX_POSSIBLE_VALUES}]")
|
||||
@ -207,10 +240,11 @@ if(PNG_HARDWARE_OPTIMIZATIONS)
|
||||
# Set definitions and sources for Intel.
|
||||
if(PNG_TARGET_ARCHITECTURE MATCHES "^(i[3-6]86|x86|amd64)")
|
||||
set(PNG_INTEL_SSE_POSSIBLE_VALUES on off)
|
||||
set(PNG_INTEL_SSE "on"
|
||||
set(PNG_INTEL_SSE
|
||||
"on"
|
||||
CACHE STRING "Enable INTEL_SSE optimizations: on|off; on is default")
|
||||
set_property(CACHE PNG_INTEL_SSE
|
||||
PROPERTY STRINGS ${PNG_INTEL_SSE_POSSIBLE_VALUES})
|
||||
PROPERTY STRINGS ${PNG_INTEL_SSE_POSSIBLE_VALUES})
|
||||
list(FIND PNG_INTEL_SSE_POSSIBLE_VALUES ${PNG_INTEL_SSE} index)
|
||||
if(index EQUAL -1)
|
||||
message(FATAL_ERROR "PNG_INTEL_SSE must be one of [${PNG_INTEL_SSE_POSSIBLE_VALUES}]")
|
||||
@ -258,20 +292,22 @@ if(PNG_HARDWARE_OPTIMIZATIONS)
|
||||
# Set definitions and sources for MIPS.
|
||||
if(PNG_TARGET_ARCHITECTURE MATCHES "^(mipsel|mips64el)")
|
||||
set(PNG_MIPS_MSA_POSSIBLE_VALUES on off)
|
||||
set(PNG_MIPS_MSA "on"
|
||||
set(PNG_MIPS_MSA
|
||||
"on"
|
||||
CACHE STRING "Enable MIPS_MSA optimizations: on|off; on is default")
|
||||
set_property(CACHE PNG_MIPS_MSA
|
||||
PROPERTY STRINGS ${PNG_MIPS_MSA_POSSIBLE_VALUES})
|
||||
PROPERTY STRINGS ${PNG_MIPS_MSA_POSSIBLE_VALUES})
|
||||
list(FIND PNG_MIPS_MSA_POSSIBLE_VALUES ${PNG_MIPS_MSA} index_msa)
|
||||
if(index_msa EQUAL -1)
|
||||
message(FATAL_ERROR "PNG_MIPS_MSA must be one of [${PNG_MIPS_MSA_POSSIBLE_VALUES}]")
|
||||
endif()
|
||||
|
||||
set(PNG_MIPS_MMI_POSSIBLE_VALUES on off)
|
||||
set(PNG_MIPS_MMI "on"
|
||||
set(PNG_MIPS_MMI
|
||||
"on"
|
||||
CACHE STRING "Enable MIPS_MMI optimizations: on|off; on is default")
|
||||
set_property(CACHE PNG_MIPS_MMI
|
||||
PROPERTY STRINGS ${PNG_MIPS_MMI_POSSIBLE_VALUES})
|
||||
PROPERTY STRINGS ${PNG_MIPS_MMI_POSSIBLE_VALUES})
|
||||
list(FIND PNG_MIPS_MMI_POSSIBLE_VALUES ${PNG_MIPS_MMI} index_mmi)
|
||||
if(index_mmi EQUAL -1)
|
||||
message(FATAL_ERROR "PNG_MIPS_MMI must be one of [${PNG_MIPS_MMI_POSSIBLE_VALUES}]")
|
||||
@ -306,31 +342,60 @@ if(PNG_HARDWARE_OPTIMIZATIONS)
|
||||
if(PNG_TARGET_ARCHITECTURE MATCHES "^(loongarch)")
|
||||
include(CheckCCompilerFlag)
|
||||
set(PNG_LOONGARCH_LSX_POSSIBLE_VALUES on off)
|
||||
set(PNG_LOONGARCH_LSX "on"
|
||||
set(PNG_LOONGARCH_LSX
|
||||
"on"
|
||||
CACHE STRING "Enable LOONGARCH_LSX optimizations: on|off; on is default")
|
||||
set_property(CACHE PNG_LOONGARCH_LSX
|
||||
PROPERTY STRINGS ${PNG_LOONGARCH_LSX_POSSIBLE_VALUES})
|
||||
PROPERTY STRINGS ${PNG_LOONGARCH_LSX_POSSIBLE_VALUES})
|
||||
list(FIND PNG_LOONGARCH_LSX_POSSIBLE_VALUES ${PNG_LOONGARCH_LSX} index)
|
||||
if(index EQUAL -1)
|
||||
message(FATAL_ERROR "PNG_LOONGARCH_LSX must be one of [${PNG_LOONGARCH_LSX_POSSIBLE_VALUES}]")
|
||||
elseif(NOT PNG_LOONGARCH_LSX STREQUAL "off")
|
||||
CHECK_C_COMPILER_FLAG("-mlsx" COMPILER_SUPPORTS_LSX)
|
||||
check_c_compiler_flag("-mlsx" COMPILER_SUPPORTS_LSX)
|
||||
if(COMPILER_SUPPORTS_LSX)
|
||||
set(libpng_loongarch_sources
|
||||
loongarch/loongarch_lsx_init.c
|
||||
loongarch/filter_lsx_intrinsics.c)
|
||||
set_source_files_properties(${libpng_loongarch_sources}
|
||||
PROPERTIES
|
||||
COMPILE_FLAGS "-mlsx")
|
||||
PROPERTIES COMPILE_FLAGS "-mlsx")
|
||||
add_definitions(-DPNG_LOONGARCH_LSX_OPT=1)
|
||||
else()
|
||||
message(FATAL_ERROR "Compiler does not support -mlsx option")
|
||||
message(FATAL_ERROR "This compiler does not support the -mlsx option")
|
||||
endif()
|
||||
else()
|
||||
add_definitions(-DPNG_LOONGARCH_LSX_OPT=0)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Set definitions and sources for RISC-V.
|
||||
if(PNG_TARGET_ARCHITECTURE MATCHES "^(riscv)")
|
||||
include(CheckCCompilerFlag)
|
||||
set(PNG_RISCV_RVV_POSSIBLE_VALUES check on off)
|
||||
set(PNG_RISCV_RVV "off"
|
||||
CACHE STRING "Enable RISC-V Vector optimizations: check|on|off; off is default")
|
||||
set_property(CACHE PNG_RISCV_RVV
|
||||
PROPERTY STRINGS ${PNG_RISCV_RVV_POSSIBLE_VALUES})
|
||||
list(FIND PNG_RISCV_RVV_POSSIBLE_VALUES ${PNG_RISCV_RVV} index)
|
||||
if(index EQUAL -1)
|
||||
message(FATAL_ERROR "PNG_RISCV_RVV must be one of [${PNG_RISCV_RVV_POSSIBLE_VALUES}]")
|
||||
elseif(NOT PNG_RISCV_RVV STREQUAL "off")
|
||||
check_c_compiler_flag("-march=rv64gv1p0" COMPILER_SUPPORTS_RVV)
|
||||
if(NOT COMPILER_SUPPORTS_RVV)
|
||||
message(FATAL_ERROR "Compiler does not support -march=rv64gv1p0 option")
|
||||
endif()
|
||||
set(libpng_riscv_sources
|
||||
riscv/filter_rvv_intrinsics.c
|
||||
riscv/riscv_init.c)
|
||||
if(PNG_RISCV_RVV STREQUAL "on")
|
||||
add_definitions(-DPNG_RISCV_RVV_OPT=2)
|
||||
elseif(PNG_RISCV_RVV STREQUAL "check")
|
||||
add_definitions(-DPNG_RISCV_RVV_CHECK_SUPPORTED)
|
||||
endif()
|
||||
else()
|
||||
add_definitions(-DPNG_RISCV_RVV_OPT=0)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
else(PNG_HARDWARE_OPTIMIZATIONS)
|
||||
|
||||
# Set definitions and sources for ARM.
|
||||
@ -358,6 +423,11 @@ else(PNG_HARDWARE_OPTIMIZATIONS)
|
||||
add_definitions(-DPNG_LOONGARCH_LSX_OPT=0)
|
||||
endif()
|
||||
|
||||
# Set definitions and sources for RISC-V.
|
||||
if(PNG_TARGET_ARCHITECTURE MATCHES "^(riscv)")
|
||||
add_definitions(-DPNG_RISCV_RVV_OPT=0)
|
||||
endif()
|
||||
|
||||
endif(PNG_HARDWARE_OPTIMIZATIONS)
|
||||
|
||||
option(ld-version-script "Enable linker version script" ON)
|
||||
@ -373,7 +443,8 @@ VERS_2 { global: sym2; main; } VERS_1;
|
||||
# Solaris, because of an incompatibility with the Solaris link editor.
|
||||
list(APPEND CMAKE_REQUIRED_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS})
|
||||
endif()
|
||||
list(APPEND CMAKE_REQUIRED_FLAGS "-Wl,--version-script='${CMAKE_CURRENT_BINARY_DIR}/conftest.map'")
|
||||
list(APPEND CMAKE_REQUIRED_FLAGS
|
||||
"-Wl,--version-script='${CMAKE_CURRENT_BINARY_DIR}/conftest.map'")
|
||||
check_c_source_compiles("
|
||||
void sym1(void) {}
|
||||
void sym2(void) {}
|
||||
@ -397,54 +468,72 @@ int main(void) { return 0; }
|
||||
file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/conftest.map")
|
||||
endif()
|
||||
|
||||
# Find an AWK language processor.
|
||||
# Start with specific AWK implementations like gawk and nawk, which are
|
||||
# known to work with our scripts, then fall back to the system awk.
|
||||
find_program(AWK NAMES gawk nawk awk)
|
||||
if(AWK)
|
||||
message(STATUS "Found AWK program: ${AWK}")
|
||||
else()
|
||||
message(STATUS "Could not find an AWK-compatible program")
|
||||
if(PNG_LIBCONF_HEADER STREQUAL "")
|
||||
# No custom configuration header file has been specified, so we build it
|
||||
# from our DFA files and (optionally) out of the user-supplied DFA file.
|
||||
# Find an AWK language processor.
|
||||
# Start with specific AWK implementations like gawk and nawk, which are
|
||||
# known to work with our scripts, then fall back to the system awk.
|
||||
find_program(AWK NAMES gawk nawk awk)
|
||||
if(AWK)
|
||||
message(STATUS "Found AWK program: ${AWK}")
|
||||
else()
|
||||
message(STATUS "Could not find an AWK-compatible program")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT AWK OR (ANDROID OR IOS))
|
||||
# No awk available to generate sources; use pre-built pnglibconf.h
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/pnglibconf.h.prebuilt
|
||||
${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h)
|
||||
# Include the internal module PNGCheckLibconf.cmake
|
||||
include("${CMAKE_CURRENT_SOURCE_DIR}/scripts/cmake/PNGCheckLibconf.cmake")
|
||||
|
||||
if(NOT PNG_LIBCONF_HEADER STREQUAL "")
|
||||
# Configure libpng with the user-defined pnglibconf.h file.
|
||||
png_check_libconf(HEADER "${PNG_LIBCONF_HEADER}")
|
||||
configure_file("${PNG_LIBCONF_HEADER}"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h"
|
||||
@ONLY)
|
||||
add_custom_target(png_genfiles)
|
||||
elseif(NOT AWK)
|
||||
# No AWK program available to generate pnglibconf.h.
|
||||
# Configure libpng with pnglibconf.h.prebuilt.
|
||||
png_check_libconf(HEADER "${PNG_LIBCONF_HEADER_PREBUILT}")
|
||||
configure_file("${PNG_LIBCONF_HEADER_PREBUILT}"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h"
|
||||
@ONLY)
|
||||
add_custom_target(png_genfiles)
|
||||
else()
|
||||
# Include the internal module PNGGenConfig.cmake
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/scripts/cmake/PNGGenConfig.cmake)
|
||||
png_check_libconf(DFA_XTRA "${DFA_XTRA}")
|
||||
|
||||
# Copy the awk scripts, converting their line endings to Unix (LF)
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/checksym.awk
|
||||
${CMAKE_CURRENT_BINARY_DIR}/scripts/checksym.awk
|
||||
# Include the internal module PNGGenConfig.cmake
|
||||
include("${CMAKE_CURRENT_SOURCE_DIR}/scripts/cmake/PNGGenConfig.cmake")
|
||||
|
||||
# Work around a limitation of various Windows AWK programs that are
|
||||
# unable to process CRLF-terminated AWK scripts.
|
||||
# Copy these AWK scripts to a temporary location, converting their
|
||||
# line endings from Windows (CRLF) to Unix (LF) at the destination.
|
||||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/scripts/checksym.awk"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/scripts/checksym.awk"
|
||||
@ONLY
|
||||
NEWLINE_STYLE LF)
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/options.awk
|
||||
${CMAKE_CURRENT_BINARY_DIR}/scripts/options.awk
|
||||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/scripts/options.awk"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/scripts/options.awk"
|
||||
@ONLY
|
||||
NEWLINE_STYLE LF)
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/dfn.awk
|
||||
${CMAKE_CURRENT_BINARY_DIR}/scripts/dfn.awk
|
||||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/scripts/dfn.awk"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/scripts/dfn.awk"
|
||||
@ONLY
|
||||
NEWLINE_STYLE LF)
|
||||
|
||||
# Generate scripts/pnglibconf.h
|
||||
generate_source(OUTPUT "scripts/pnglibconf.c"
|
||||
generate_source(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/pnglibconf.c"
|
||||
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/scripts/pnglibconf.dfa"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/scripts/options.awk"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/pngconf.h")
|
||||
add_custom_target(png_scripts_pnglibconf_c
|
||||
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/scripts/pnglibconf.c")
|
||||
|
||||
# Generate pnglibconf.c
|
||||
generate_source(OUTPUT "pnglibconf.c"
|
||||
generate_source(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.c"
|
||||
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/scripts/pnglibconf.dfa"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/scripts/options.awk"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/pngconf.h")
|
||||
add_custom_target(pnglibconf_c
|
||||
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.c")
|
||||
|
||||
if(PNG_PREFIX)
|
||||
set(PNGLIBCONF_H_EXTRA_DEPENDS
|
||||
@ -455,80 +544,53 @@ else()
|
||||
endif()
|
||||
|
||||
generate_out(INPUT "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.c"
|
||||
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.out"
|
||||
DEPENDS pnglibconf_c)
|
||||
add_custom_target(pnglibconf_out
|
||||
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.out")
|
||||
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.out")
|
||||
|
||||
# Generate pnglibconf.h
|
||||
generate_source(OUTPUT "pnglibconf.h"
|
||||
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.out" pnglibconf_out
|
||||
generate_source(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h"
|
||||
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.out"
|
||||
${PNGLIBCONF_H_EXTRA_DEPENDS})
|
||||
add_custom_target(pnglibconf_h
|
||||
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h")
|
||||
|
||||
generate_out(INPUT "${CMAKE_CURRENT_SOURCE_DIR}/scripts/intprefix.c"
|
||||
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/intprefix.out"
|
||||
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h" pnglibconf_h)
|
||||
add_custom_target(png_scripts_intprefix_out
|
||||
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/scripts/intprefix.out")
|
||||
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h")
|
||||
|
||||
generate_out(INPUT "${CMAKE_CURRENT_SOURCE_DIR}/scripts/prefix.c"
|
||||
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/prefix.out"
|
||||
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/png.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/pngconf.h"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.out" pnglibconf_out)
|
||||
add_custom_target(png_scripts_prefix_out
|
||||
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/scripts/prefix.out")
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.out")
|
||||
|
||||
# Generate pngprefix.h
|
||||
generate_source(OUTPUT "pngprefix.h"
|
||||
generate_source(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/pngprefix.h"
|
||||
DEPENDS ${PNGPREFIX_H_EXTRA_DEPENDS})
|
||||
add_custom_target(pngprefix_h
|
||||
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pngprefix.h")
|
||||
|
||||
generate_out(INPUT "${CMAKE_CURRENT_SOURCE_DIR}/scripts/sym.c"
|
||||
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/sym.out"
|
||||
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h" pnglibconf_h)
|
||||
add_custom_target(png_scripts_sym_out
|
||||
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/scripts/sym.out")
|
||||
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h")
|
||||
|
||||
generate_out(INPUT "${CMAKE_CURRENT_SOURCE_DIR}/scripts/symbols.c"
|
||||
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.out"
|
||||
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/png.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/pngconf.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/scripts/pnglibconf.h.prebuilt")
|
||||
add_custom_target(png_scripts_symbols_out
|
||||
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.out")
|
||||
|
||||
generate_out(INPUT "${CMAKE_CURRENT_SOURCE_DIR}/scripts/vers.c"
|
||||
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/vers.out"
|
||||
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/png.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/pngconf.h"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h" pnglibconf_h)
|
||||
add_custom_target(png_scripts_vers_out
|
||||
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/scripts/vers.out")
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h")
|
||||
|
||||
generate_chk(INPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.out"
|
||||
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.chk"
|
||||
DEPENDS png_scripts_symbols_out
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/scripts/checksym.awk"
|
||||
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/scripts/checksym.awk"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/scripts/symbols.def")
|
||||
|
||||
add_custom_target(png_scripts_symbols_chk
|
||||
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.chk")
|
||||
|
||||
generate_copy(INPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/sym.out"
|
||||
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/libpng.sym"
|
||||
DEPENDS png_scripts_sym_out)
|
||||
generate_copy(INPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/vers.out"
|
||||
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/libpng.vers"
|
||||
DEPENDS png_scripts_vers_out)
|
||||
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/libpng.sym")
|
||||
|
||||
add_custom_target(png_genvers
|
||||
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/libpng.vers")
|
||||
add_custom_target(png_gensym
|
||||
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/libpng.sym")
|
||||
generate_copy(INPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/vers.out"
|
||||
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/libpng.vers")
|
||||
|
||||
add_custom_target(png_genprebuilt
|
||||
COMMAND "${CMAKE_COMMAND}"
|
||||
@ -538,20 +600,20 @@ else()
|
||||
|
||||
# A single target handles generation of all generated files.
|
||||
add_custom_target(png_genfiles
|
||||
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/libpng.sym" png_gensym
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/libpng.vers" png_genvers
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.c" pnglibconf_c
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h" pnglibconf_h
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.out" pnglibconf_out
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/pngprefix.h" pngprefix_h
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/scripts/intprefix.out" png_scripts_intprefix_out
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/scripts/pnglibconf.c" png_scripts_pnglibconf_c
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/scripts/prefix.out" png_scripts_prefix_out
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/scripts/sym.out" png_scripts_sym_out
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.chk" png_scripts_symbols_chk
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.out" png_scripts_symbols_out
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/scripts/vers.out" png_scripts_vers_out)
|
||||
endif(NOT AWK OR (ANDROID OR IOS))
|
||||
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/libpng.sym"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/libpng.vers"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.c"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.out"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/pngprefix.h"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/scripts/intprefix.out"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/scripts/pnglibconf.c"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/scripts/prefix.out"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/scripts/sym.out"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.chk"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.out"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/scripts/vers.out")
|
||||
endif()
|
||||
|
||||
# List the source code files.
|
||||
set(libpng_public_hdrs
|
||||
@ -565,7 +627,7 @@ set(libpng_private_hdrs
|
||||
pnginfo.h
|
||||
pngstruct.h
|
||||
)
|
||||
if(AWK AND NOT (ANDROID OR IOS))
|
||||
if(AWK)
|
||||
list(APPEND libpng_private_hdrs "${CMAKE_CURRENT_BINARY_DIR}/pngprefix.h")
|
||||
endif()
|
||||
set(libpng_sources
|
||||
@ -591,7 +653,9 @@ set(libpng_sources
|
||||
${libpng_mips_sources}
|
||||
${libpng_powerpc_sources}
|
||||
${libpng_loongarch_sources}
|
||||
${libpng_riscv_sources}
|
||||
)
|
||||
|
||||
set(pngtest_sources
|
||||
pngtest.c
|
||||
)
|
||||
@ -614,10 +678,13 @@ set(png_fix_itxt_sources
|
||||
contrib/tools/png-fix-itxt.c
|
||||
)
|
||||
|
||||
if(MSVC OR (WIN32 AND (CMAKE_C_COMPILER_ID MATCHES "Clang")))
|
||||
add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
|
||||
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
|
||||
endif()
|
||||
# rom-properties: FIXME: "/guard:cf" causes png_longjmp() to crash
|
||||
# in MSVC 2022 Release builds on Windows 10.
|
||||
IF(MSVC)
|
||||
FOREACH(_var CMAKE_C_FLAGS CMAKE_CXX_FLAGS CMAKE_EXE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS CMAKE_MODULE_LINKER_FLAGS)
|
||||
STRING(REPLACE "/guard:cf" "" ${_var} "${${${_var}}}")
|
||||
ENDFOREACH(_var)
|
||||
ENDIF(MSVC)
|
||||
|
||||
# rom-properties: Add -DPNG_DEBUG=0 in debug builds.
|
||||
IF(0)
|
||||
@ -663,11 +730,11 @@ if(PNG_SHARED)
|
||||
add_library(png_shared SHARED ${libpng_sources})
|
||||
add_dependencies(png_shared png_genfiles)
|
||||
list(APPEND PNG_LIBRARY_TARGETS png_shared)
|
||||
set_target_properties(png_shared PROPERTIES
|
||||
OUTPUT_NAME "${PNG_SHARED_OUTPUT_NAME}"
|
||||
DEBUG_POSTFIX "${PNG_DEBUG_POSTFIX}"
|
||||
VERSION "${PNGLIB_SHARED_VERSION}"
|
||||
SOVERSION "${PNGLIB_ABI_VERSION}")
|
||||
set_target_properties(png_shared
|
||||
PROPERTIES OUTPUT_NAME "${PNG_SHARED_OUTPUT_NAME}"
|
||||
DEBUG_POSTFIX "${PNG_DEBUG_POSTFIX}"
|
||||
VERSION "${PNGLIB_SHARED_VERSION}"
|
||||
SOVERSION "${PNGLIB_ABI_VERSION}")
|
||||
|
||||
# rom-properties: Split debug functionality; Windows subsystem.
|
||||
DO_SPLIT_DEBUG(png_shared)
|
||||
@ -675,33 +742,37 @@ if(PNG_SHARED)
|
||||
|
||||
if(UNIX AND AWK)
|
||||
if(HAVE_LD_VERSION_SCRIPT)
|
||||
set_target_properties(png_shared PROPERTIES
|
||||
LINK_FLAGS "-Wl,--version-script='${CMAKE_CURRENT_BINARY_DIR}/libpng.vers'")
|
||||
set_target_properties(png_shared
|
||||
PROPERTIES LINK_FLAGS "-Wl,--version-script='${CMAKE_CURRENT_BINARY_DIR}/libpng.vers'")
|
||||
elseif(HAVE_SOLARIS_LD_VERSION_SCRIPT)
|
||||
set_target_properties(png_shared PROPERTIES
|
||||
LINK_FLAGS "-Wl,-M -Wl,'${CMAKE_CURRENT_BINARY_DIR}/libpng.vers'")
|
||||
set_target_properties(png_shared
|
||||
PROPERTIES LINK_FLAGS "-Wl,-M -Wl,'${CMAKE_CURRENT_BINARY_DIR}/libpng.vers'")
|
||||
endif()
|
||||
endif()
|
||||
if(APPLE)
|
||||
# Avoid CMake's implicit compile definition "png_shared_EXPORTS".
|
||||
set_target_properties(png_shared PROPERTIES DEFINE_SYMBOL "")
|
||||
set_target_properties(png_shared
|
||||
PROPERTIES DEFINE_SYMBOL "")
|
||||
elseif(WIN32)
|
||||
# rom-properties: Set PNG_USE_DLL to use dllimport.
|
||||
# Use the explicit compile definition "PNG_BUILD_DLL" for Windows DLLs.
|
||||
#set_target_properties(png_shared PROPERTIES DEFINE_SYMBOL PNG_BUILD_DLL)
|
||||
#set_target_properties(png_shared
|
||||
# PROPERTIES DEFINE_SYMBOL PNG_BUILD_DLL)
|
||||
target_compile_definitions(png_shared
|
||||
PRIVATE -DPNG_BUILD_DLL
|
||||
INTERFACE -DPNG_USE_DLL
|
||||
)
|
||||
endif()
|
||||
target_include_directories(png_shared
|
||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
|
||||
PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>")
|
||||
target_include_directories(png_shared
|
||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
|
||||
target_include_directories(png_shared SYSTEM
|
||||
INTERFACE $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/libpng${PNGLIB_ABI_VERSION}>)
|
||||
PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>")
|
||||
target_include_directories(png_shared
|
||||
SYSTEM
|
||||
INTERFACE "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/libpng${PNGLIB_ABI_VERSION}>")
|
||||
# rom-properties: ZLIB::ZLIB -> ${ZLIB_LIBRARY}
|
||||
target_link_libraries(png_shared PUBLIC ${ZLIB_LIBRARY} ${M_LIBRARY})
|
||||
target_link_libraries(png_shared
|
||||
PUBLIC ${ZLIB_LIBRARY} ${M_LIBRARY})
|
||||
endif()
|
||||
|
||||
if(PNG_STATIC)
|
||||
@ -713,24 +784,25 @@ if(PNG_STATIC)
|
||||
add_library(png_static STATIC ${libpng_sources})
|
||||
add_dependencies(png_static png_genfiles)
|
||||
list(APPEND PNG_LIBRARY_TARGETS png_static)
|
||||
set_target_properties(png_static PROPERTIES
|
||||
OUTPUT_NAME "${PNG_STATIC_OUTPUT_NAME}"
|
||||
DEBUG_POSTFIX "${PNG_DEBUG_POSTFIX}")
|
||||
set_target_properties(png_static
|
||||
PROPERTIES OUTPUT_NAME "${PNG_STATIC_OUTPUT_NAME}"
|
||||
DEBUG_POSTFIX "${PNG_DEBUG_POSTFIX}")
|
||||
target_include_directories(png_static
|
||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
|
||||
PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>")
|
||||
target_include_directories(png_static
|
||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
|
||||
target_include_directories(png_static SYSTEM
|
||||
INTERFACE $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/libpng${PNGLIB_ABI_VERSION}>)
|
||||
PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>")
|
||||
target_include_directories(png_static
|
||||
SYSTEM
|
||||
INTERFACE "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/libpng${PNGLIB_ABI_VERSION}>")
|
||||
# rom-properties: ZLIB::ZLIB -> ${ZLIB_LIBRARY}
|
||||
target_link_libraries(png_static PUBLIC ${ZLIB_LIBRARY} ${M_LIBRARY})
|
||||
target_link_libraries(png_static
|
||||
PUBLIC ${ZLIB_LIBRARY} ${M_LIBRARY})
|
||||
# rom-properties: Set the MSVC debug path.
|
||||
SET_MSVC_DEBUG_PATH(png_static)
|
||||
endif()
|
||||
|
||||
if(PNG_FRAMEWORK AND NOT APPLE)
|
||||
message(AUTHOR_WARNING
|
||||
"Setting PNG_FRAMEWORK to OFF, as it only applies to Apple systems")
|
||||
message(AUTHOR_WARNING "Setting PNG_FRAMEWORK to OFF, as it only applies to Apple systems")
|
||||
set(PNG_FRAMEWORK OFF)
|
||||
endif()
|
||||
|
||||
@ -738,26 +810,29 @@ if(PNG_FRAMEWORK)
|
||||
add_library(png_framework SHARED ${libpng_sources})
|
||||
add_dependencies(png_framework png_genfiles)
|
||||
list(APPEND PNG_LIBRARY_TARGETS png_framework)
|
||||
set_target_properties(png_framework PROPERTIES
|
||||
FRAMEWORK TRUE
|
||||
FRAMEWORK_VERSION "${PNGLIB_VERSION}"
|
||||
MACOSX_FRAMEWORK_SHORT_VERSION_STRING "${PNGLIB_MAJOR}.${PNGLIB_MINOR}"
|
||||
MACOSX_FRAMEWORK_BUNDLE_VERSION "${PNGLIB_VERSION}"
|
||||
MACOSX_FRAMEWORK_IDENTIFIER "org.libpng.libpng"
|
||||
XCODE_ATTRIBUTE_INSTALL_PATH "@rpath"
|
||||
PUBLIC_HEADER "${libpng_public_hdrs}"
|
||||
OUTPUT_NAME "png"
|
||||
DEBUG_POSTFIX "${PNG_DEBUG_POSTFIX}")
|
||||
set_target_properties(png_framework
|
||||
PROPERTIES FRAMEWORK TRUE
|
||||
FRAMEWORK_VERSION "${PNGLIB_VERSION}"
|
||||
MACOSX_FRAMEWORK_SHORT_VERSION_STRING "${PNGLIB_MAJOR}.${PNGLIB_MINOR}"
|
||||
MACOSX_FRAMEWORK_BUNDLE_VERSION "${PNGLIB_VERSION}"
|
||||
MACOSX_FRAMEWORK_IDENTIFIER "org.libpng.libpng"
|
||||
XCODE_ATTRIBUTE_INSTALL_PATH "@rpath"
|
||||
PUBLIC_HEADER "${libpng_public_hdrs}"
|
||||
OUTPUT_NAME "png"
|
||||
DEBUG_POSTFIX "${PNG_DEBUG_POSTFIX}")
|
||||
# Avoid CMake's implicit compile definition "-Dpng_framework_EXPORTS".
|
||||
set_target_properties(png_framework PROPERTIES DEFINE_SYMBOL "")
|
||||
set_target_properties(png_framework
|
||||
PROPERTIES DEFINE_SYMBOL "")
|
||||
target_include_directories(png_framework
|
||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
|
||||
PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>")
|
||||
target_include_directories(png_framework
|
||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
|
||||
target_include_directories(png_framework SYSTEM
|
||||
INTERFACE $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/libpng${PNGLIB_ABI_VERSION}>)
|
||||
PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>")
|
||||
target_include_directories(png_framework
|
||||
SYSTEM
|
||||
INTERFACE "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/libpng${PNGLIB_ABI_VERSION}>")
|
||||
# rom-properties: ZLIB::ZLIB -> ${ZLIB_LIBRARY}
|
||||
target_link_libraries(png_framework PUBLIC ${ZLIB_LIBRARY} ${M_LIBRARY})
|
||||
target_link_libraries(png_framework
|
||||
PUBLIC ${ZLIB_LIBRARY} ${M_LIBRARY})
|
||||
endif()
|
||||
|
||||
if(NOT PNG_LIBRARY_TARGETS)
|
||||
@ -770,7 +845,7 @@ if(PNG_TESTS AND PNG_SHARED)
|
||||
enable_testing()
|
||||
|
||||
# Include the internal module PNGTest.cmake
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/scripts/cmake/PNGTest.cmake)
|
||||
include("${CMAKE_CURRENT_SOURCE_DIR}/scripts/cmake/PNGTest.cmake")
|
||||
|
||||
# Find test PNG files by globbing, but sort lists to ensure
|
||||
# consistency between different filesystems.
|
||||
@ -784,7 +859,8 @@ if(PNG_TESTS AND PNG_SHARED)
|
||||
set(PNGTEST_PNG "${CMAKE_CURRENT_SOURCE_DIR}/pngtest.png")
|
||||
|
||||
add_executable(pngtest ${pngtest_sources})
|
||||
target_link_libraries(pngtest PRIVATE png_shared)
|
||||
target_link_libraries(pngtest
|
||||
PRIVATE png_shared)
|
||||
|
||||
png_add_test(NAME pngtest
|
||||
COMMAND pngtest
|
||||
@ -795,7 +871,8 @@ if(PNG_TESTS AND PNG_SHARED)
|
||||
FILES "${TEST_PNG3_PNGS}")
|
||||
|
||||
add_executable(pngvalid ${pngvalid_sources})
|
||||
target_link_libraries(pngvalid PRIVATE png_shared)
|
||||
target_link_libraries(pngvalid
|
||||
PRIVATE png_shared)
|
||||
|
||||
png_add_test(NAME pngvalid-gamma-16-to-8
|
||||
COMMAND pngvalid
|
||||
@ -841,7 +918,8 @@ if(PNG_TESTS AND PNG_SHARED)
|
||||
OPTIONS --transform)
|
||||
|
||||
add_executable(pngstest ${pngstest_sources})
|
||||
target_link_libraries(pngstest PRIVATE png_shared)
|
||||
target_link_libraries(pngstest
|
||||
PRIVATE png_shared)
|
||||
|
||||
foreach(gamma_type 1.8 linear none sRGB)
|
||||
foreach(alpha_type none alpha)
|
||||
@ -896,7 +974,8 @@ if(PNG_TESTS AND PNG_SHARED)
|
||||
endforeach()
|
||||
|
||||
add_executable(pngunknown ${pngunknown_sources})
|
||||
target_link_libraries(pngunknown PRIVATE png_shared)
|
||||
target_link_libraries(pngunknown
|
||||
PRIVATE png_shared)
|
||||
|
||||
png_add_test(NAME pngunknown-discard
|
||||
COMMAND pngunknown
|
||||
@ -912,7 +991,8 @@ if(PNG_TESTS AND PNG_SHARED)
|
||||
FILES "${PNGTEST_PNG}")
|
||||
png_add_test(NAME pngunknown-sAPI
|
||||
COMMAND pngunknown
|
||||
OPTIONS --strict bKGD=save cHRM=save gAMA=save all=discard iCCP=save sBIT=save sRGB=save
|
||||
OPTIONS --strict
|
||||
bKGD=save cHRM=save gAMA=save all=discard iCCP=save sBIT=save sRGB=save
|
||||
FILES "${PNGTEST_PNG}")
|
||||
png_add_test(NAME pngunknown-save
|
||||
COMMAND pngunknown
|
||||
@ -928,7 +1008,8 @@ if(PNG_TESTS AND PNG_SHARED)
|
||||
FILES "${PNGTEST_PNG}")
|
||||
|
||||
add_executable(pngimage ${pngimage_sources})
|
||||
target_link_libraries(pngimage PRIVATE png_shared)
|
||||
target_link_libraries(pngimage
|
||||
PRIVATE png_shared)
|
||||
|
||||
png_add_test(NAME pngimage-quick
|
||||
COMMAND pngimage
|
||||
@ -942,11 +1023,13 @@ endif()
|
||||
|
||||
if(PNG_SHARED AND PNG_TOOLS)
|
||||
add_executable(pngfix ${pngfix_sources})
|
||||
target_link_libraries(pngfix PRIVATE png_shared)
|
||||
target_link_libraries(pngfix
|
||||
PRIVATE png_shared)
|
||||
set(PNG_BIN_TARGETS pngfix)
|
||||
|
||||
add_executable(png-fix-itxt ${png_fix_itxt_sources})
|
||||
target_link_libraries(png-fix-itxt PRIVATE ZLIB::ZLIB ${M_LIBRARY})
|
||||
target_link_libraries(png-fix-itxt
|
||||
PRIVATE ZLIB::ZLIB ${M_LIBRARY})
|
||||
list(APPEND PNG_BIN_TARGETS png-fix-itxt)
|
||||
endif()
|
||||
|
||||
@ -960,12 +1043,11 @@ function(create_symlink DEST_FILE)
|
||||
# CMake version 3.13.
|
||||
cmake_parse_arguments(_SYM "" "FILE;TARGET" "" ${ARGN})
|
||||
if(NOT _SYM_FILE AND NOT _SYM_TARGET)
|
||||
message(FATAL_ERROR "create_symlink: Missing FILE or TARGET argument")
|
||||
message(FATAL_ERROR "create_symlink: Missing arguments: FILE or TARGET")
|
||||
endif()
|
||||
if(_SYM_FILE AND _SYM_TARGET)
|
||||
message(FATAL_ERROR "create_symlink: "
|
||||
"The arguments FILE (${_SYM_FILE}) and TARGET (${_SYM_TARGET}) "
|
||||
"are mutually-exclusive")
|
||||
message(FATAL_ERROR "create_symlink: Mutually-exlusive arguments:"
|
||||
"FILE (${_SYM_FILE}) and TARGET (${_SYM_TARGET})")
|
||||
endif()
|
||||
|
||||
if(_SYM_FILE)
|
||||
@ -974,12 +1056,14 @@ function(create_symlink DEST_FILE)
|
||||
if(CMAKE_HOST_WIN32 AND NOT CYGWIN)
|
||||
execute_process(COMMAND "${CMAKE_COMMAND}"
|
||||
-E copy_if_different
|
||||
${_SYM_FILE} ${DEST_FILE}
|
||||
"${_SYM_FILE}"
|
||||
"${DEST_FILE}"
|
||||
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
|
||||
else()
|
||||
execute_process(COMMAND "${CMAKE_COMMAND}"
|
||||
-E create_symlink
|
||||
${_SYM_FILE} ${DEST_FILE}
|
||||
"${_SYM_FILE}"
|
||||
"${DEST_FILE}"
|
||||
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
|
||||
endif()
|
||||
endif()
|
||||
@ -993,28 +1077,28 @@ function(create_symlink DEST_FILE)
|
||||
POST_BUILD
|
||||
COMMAND "${CMAKE_COMMAND}"
|
||||
-E copy_if_different
|
||||
$<TARGET_LINKER_FILE_DIR:${_SYM_TARGET}>/$<TARGET_LINKER_FILE_NAME:${_SYM_TARGET}>
|
||||
$<TARGET_LINKER_FILE_DIR:${_SYM_TARGET}>/${DEST_FILE})
|
||||
"$<TARGET_LINKER_FILE_DIR:${_SYM_TARGET}>/$<TARGET_LINKER_FILE_NAME:${_SYM_TARGET}>"
|
||||
"$<TARGET_LINKER_FILE_DIR:${_SYM_TARGET}>/${DEST_FILE}")
|
||||
else()
|
||||
add_custom_command(TARGET ${_SYM_TARGET}
|
||||
POST_BUILD
|
||||
COMMAND "${CMAKE_COMMAND}"
|
||||
-E create_symlink
|
||||
$<TARGET_LINKER_FILE_NAME:${_SYM_TARGET}>
|
||||
$<TARGET_LINKER_FILE_DIR:${_SYM_TARGET}>/${DEST_FILE})
|
||||
"$<TARGET_LINKER_FILE_NAME:${_SYM_TARGET}>"
|
||||
"$<TARGET_LINKER_FILE_DIR:${_SYM_TARGET}>/${DEST_FILE}")
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# Create source generation scripts.
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/cmake/genchk.cmake.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/scripts/cmake/genchk.cmake
|
||||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/scripts/cmake/genchk.cmake.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/scripts/cmake/genchk.cmake"
|
||||
@ONLY)
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/cmake/genout.cmake.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/scripts/cmake/genout.cmake
|
||||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/scripts/cmake/genout.cmake.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/scripts/cmake/genout.cmake"
|
||||
@ONLY)
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/cmake/gensrc.cmake.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/scripts/cmake/gensrc.cmake
|
||||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/scripts/cmake/gensrc.cmake.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/scripts/cmake/gensrc.cmake"
|
||||
@ONLY)
|
||||
|
||||
# libpng is a library so default to 'lib'
|
||||
@ -1027,17 +1111,17 @@ endif()
|
||||
# Only do this on Windows for Cygwin - the files don't make much sense
|
||||
# outside of a UNIX look-alike.
|
||||
if(NOT WIN32 OR CYGWIN OR MINGW)
|
||||
set(prefix ${CMAKE_INSTALL_PREFIX})
|
||||
set(exec_prefix ${CMAKE_INSTALL_PREFIX})
|
||||
set(libdir ${CMAKE_INSTALL_FULL_LIBDIR})
|
||||
set(includedir ${CMAKE_INSTALL_FULL_INCLUDEDIR})
|
||||
set(LIBS "-lz -lm")
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpng.pc.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/libpng${PNGLIB_ABI_VERSION}.pc
|
||||
set(prefix "${CMAKE_INSTALL_PREFIX}")
|
||||
set(exec_prefix "${CMAKE_INSTALL_PREFIX}")
|
||||
set(libdir "${CMAKE_INSTALL_FULL_LIBDIR}")
|
||||
set(includedir "${CMAKE_INSTALL_FULL_INCLUDEDIR}")
|
||||
set(LIBS "-lz -lm")
|
||||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/libpng.pc.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/libpng${PNGLIB_ABI_VERSION}.pc"
|
||||
@ONLY)
|
||||
create_symlink(libpng.pc FILE libpng${PNGLIB_ABI_VERSION}.pc)
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpng-config.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/libpng${PNGLIB_ABI_VERSION}-config
|
||||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/libpng-config.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/libpng${PNGLIB_ABI_VERSION}-config"
|
||||
@ONLY)
|
||||
create_symlink(libpng-config FILE libpng${PNGLIB_ABI_VERSION}-config)
|
||||
endif()
|
||||
@ -1053,10 +1137,10 @@ if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL)
|
||||
# - Disabled the export rule
|
||||
install(TARGETS ${PNG_LIBRARY_TARGETS}
|
||||
#EXPORT libpng
|
||||
RUNTIME DESTINATION ${INSTALL_BIN_DIR}
|
||||
#LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
#ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
FRAMEWORK DESTINATION ${INSTALL_LIB_DIR})
|
||||
RUNTIME DESTINATION "${INSTALL_BIN_DIR}"
|
||||
#LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
#ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
FRAMEWORK DESTINATION "${INSTALL_LIB_DIR}")
|
||||
|
||||
IF(INSTALL_DEBUG AND PNG_SHARED)
|
||||
# FIXME: Generator expression $<TARGET_PROPERTY:${_target},PDB> didn't work with CPack-3.6.1.
|
||||
@ -1081,16 +1165,16 @@ if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL)
|
||||
# Create a symlink for libpng.dll.a => libpng16.dll.a on Cygwin
|
||||
if(NOT WIN32 OR CYGWIN OR MINGW)
|
||||
create_symlink(libpng${CMAKE_SHARED_LIBRARY_SUFFIX} TARGET png_shared)
|
||||
install(FILES $<TARGET_LINKER_FILE_DIR:png_shared>/libpng${CMAKE_SHARED_LIBRARY_SUFFIX}
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
install(FILES "$<TARGET_LINKER_FILE_DIR:png_shared>/libpng${CMAKE_SHARED_LIBRARY_SUFFIX}"
|
||||
DESTINATION "${CMAKE_INSTALL_LIBDIR}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(PNG_STATIC)
|
||||
if(NOT WIN32 OR CYGWIN OR MINGW)
|
||||
create_symlink(libpng${CMAKE_STATIC_LIBRARY_SUFFIX} TARGET png_static)
|
||||
install(FILES $<TARGET_LINKER_FILE_DIR:png_static>/libpng${CMAKE_STATIC_LIBRARY_SUFFIX}
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
install(FILES "$<TARGET_LINKER_FILE_DIR:png_static>/libpng${CMAKE_STATIC_LIBRARY_SUFFIX}"
|
||||
DESTINATION "${CMAKE_INSTALL_LIBDIR}")
|
||||
endif()
|
||||
endif()
|
||||
ENDIF(0)
|
||||
@ -1098,40 +1182,40 @@ endif()
|
||||
|
||||
if(NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL)
|
||||
install(FILES ${libpng_public_hdrs}
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
||||
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
|
||||
install(FILES ${libpng_public_hdrs}
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libpng${PNGLIB_ABI_VERSION})
|
||||
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/libpng${PNGLIB_ABI_VERSION}")
|
||||
endif()
|
||||
if(NOT SKIP_INSTALL_EXECUTABLES AND NOT SKIP_INSTALL_ALL)
|
||||
if(NOT WIN32 OR CYGWIN OR MINGW)
|
||||
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/libpng-config
|
||||
DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/libpng${PNGLIB_ABI_VERSION}-config
|
||||
DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/libpng-config"
|
||||
DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
||||
install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/libpng${PNGLIB_ABI_VERSION}-config"
|
||||
DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT SKIP_INSTALL_PROGRAMS AND NOT SKIP_INSTALL_ALL)
|
||||
install(TARGETS ${PNG_BIN_TARGETS}
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
||||
endif()
|
||||
|
||||
if(NOT SKIP_INSTALL_FILES AND NOT SKIP_INSTALL_ALL)
|
||||
# Install the man pages.
|
||||
install(FILES libpng.3 libpngpf.3
|
||||
DESTINATION ${CMAKE_INSTALL_MANDIR}/man3)
|
||||
DESTINATION "${CMAKE_INSTALL_MANDIR}/man3")
|
||||
install(FILES png.5
|
||||
DESTINATION ${CMAKE_INSTALL_MANDIR}/man5)
|
||||
DESTINATION "${CMAKE_INSTALL_MANDIR}/man5")
|
||||
# Install the pkg-config files.
|
||||
if(NOT CMAKE_HOST_WIN32 OR CYGWIN OR MINGW)
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpng.pc
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
||||
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/libpng-config
|
||||
DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpng${PNGLIB_ABI_VERSION}.pc
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
||||
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/libpng${PNGLIB_ABI_VERSION}-config
|
||||
DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libpng.pc"
|
||||
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
|
||||
install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/libpng-config"
|
||||
DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libpng${PNGLIB_ABI_VERSION}.pc"
|
||||
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
|
||||
install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/libpng${PNGLIB_ABI_VERSION}-config"
|
||||
DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@ -1140,7 +1224,7 @@ endif()
|
||||
IF(0)
|
||||
if(NOT SKIP_INSTALL_EXPORT AND NOT SKIP_INSTALL_ALL)
|
||||
install(EXPORT libpng
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/libpng
|
||||
DESTINATION "${CMAKE_INSTALL_LIBDIR}/libpng"
|
||||
FILE libpng${PNGLIB_ABI_VERSION}.cmake)
|
||||
endif()
|
||||
ENDIF(0) # rom-properties
|
||||
@ -1149,10 +1233,10 @@ ENDIF(0) # rom-properties
|
||||
if(NOT SKIP_INSTALL_CONFIG_FILE AND NOT SKIP_INSTALL_ALL)
|
||||
install(TARGETS ${PNG_LIBRARY_TARGETS}
|
||||
EXPORT PNGTargets
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
FRAMEWORK DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
|
||||
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
FRAMEWORK DESTINATION "${CMAKE_INSTALL_LIBDIR}")
|
||||
|
||||
include(CMakePackageConfigHelpers)
|
||||
write_basic_package_version_file(PNGConfigVersion.cmake
|
||||
@ -1162,11 +1246,11 @@ if(NOT SKIP_INSTALL_CONFIG_FILE AND NOT SKIP_INSTALL_ALL)
|
||||
install(EXPORT PNGTargets
|
||||
FILE PNGTargets.cmake
|
||||
NAMESPACE PNG::
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/PNG)
|
||||
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/PNG")
|
||||
|
||||
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/scripts/cmake/PNGConfig.cmake
|
||||
${CMAKE_CURRENT_BINARY_DIR}/PNGConfigVersion.cmake
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/PNG)
|
||||
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/scripts/cmake/PNGConfig.cmake"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/PNGConfigVersion.cmake"
|
||||
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/PNG")
|
||||
endif()
|
||||
|
||||
# TODO: Create MSVC import lib for MinGW-compiled shared lib.
|
||||
|
10
extlib/libpng/INSTALL
vendored
10
extlib/libpng/INSTALL
vendored
@ -136,7 +136,7 @@ Your directory structure should look like this:
|
||||
depcomp, install-sh, mkinstalldirs, test-pngtest.sh, etc.
|
||||
contrib
|
||||
arm-neon, conftest, examples, gregbook, libtests, pngminim,
|
||||
pngminus, pngsuite, tools, visupng
|
||||
pngminus, pngsuite, tools, visupng, riscv-rvv
|
||||
projects
|
||||
owatcom, visualc71, vstudio
|
||||
scripts
|
||||
@ -289,6 +289,7 @@ such as one of
|
||||
--enable-mips-msa=yes
|
||||
--enable-intel-sse=yes
|
||||
--enable-powerpc-vsx=yes
|
||||
--enable-riscv-rvv=yes
|
||||
|
||||
or enable them all at once with
|
||||
|
||||
@ -301,6 +302,7 @@ or more of
|
||||
CPPFLAGS += "-DPNG_MIPS_MSA"
|
||||
CPPFLAGS += "-DPNG_INTEL_SSE"
|
||||
CPPFLAGS += "-DPNG_POWERPC_VSX"
|
||||
CPPFLAGS += "-DPNG_RISCV_RVV"
|
||||
|
||||
See for example scripts/makefile.linux-opt
|
||||
|
||||
@ -317,13 +319,15 @@ to disable a particular one,
|
||||
or via compiler-command options such as
|
||||
|
||||
CPPFLAGS += "-DPNG_ARM_NEON_OPT=0, -DPNG_MIPS_MSA_OPT=0,
|
||||
-DPNG_INTEL_SSE_OPT=0, -DPNG_POWERPC_VSX_OPT=0"
|
||||
-DPNG_INTEL_SSE_OPT=0, -DPNG_POWERPC_VSX_OPT=0,
|
||||
-DPNG_RISCV_RVV_OPT=0"
|
||||
|
||||
If you are using cmake, hardware optimizations are "on"
|
||||
by default. To disable them, use
|
||||
|
||||
cmake . -DPNG_ARM_NEON=no -DPNG_INTEL_SSE=no \
|
||||
-DPNG_MIPS_MSA=no -DPNG_POWERPC_VSX=no
|
||||
-DPNG_MIPS_MSA=no -DPNG_POWERPC_VSX=no \
|
||||
-DPNG_RISCV_RVV=no
|
||||
|
||||
or disable them all at once with
|
||||
|
||||
|
4
extlib/libpng/README
vendored
4
extlib/libpng/README
vendored
@ -1,4 +1,4 @@
|
||||
README for libpng version 1.6.47
|
||||
README for libpng version 1.6.49
|
||||
================================
|
||||
|
||||
See the note about version numbers near the top of `png.h`.
|
||||
@ -147,6 +147,7 @@ Files included in this distribution
|
||||
loongarch/ => Optimized code for LoongArch LSX
|
||||
mips/ => Optimized code for MIPS MSA and MIPS MMI
|
||||
powerpc/ => Optimized code for PowerPC VSX
|
||||
riscv/ => Optimized code for the RISC-V platform
|
||||
ci/ => Scripts for continuous integration
|
||||
contrib/ => External contributions
|
||||
arm-neon/ => Optimized code for the ARM-NEON platform
|
||||
@ -162,6 +163,7 @@ Files included in this distribution
|
||||
programs demonstrating the use of pngusr.dfa
|
||||
pngminus/ => Simple pnm2png and png2pnm programs
|
||||
pngsuite/ => Test images
|
||||
riscv-rvv/ => Optimized code for the RISC-V Vector platform
|
||||
testpngs/ => Test images
|
||||
tools/ => Various tools
|
||||
visupng/ => VisualPng, a Windows viewer for PNG images
|
||||
|
10
extlib/libpng/_MODIFIED_LIBPNG.txt
vendored
10
extlib/libpng/_MODIFIED_LIBPNG.txt
vendored
@ -1,9 +1,9 @@
|
||||
This copy of libpng-1.6.47 is a modified version of the original.
|
||||
This copy of libpng-1.6.48 is a modified version of the original.
|
||||
|
||||
commit 872555f4ba910252783af1507f9e7fe1653be252
|
||||
Release libpng version 1.6.47
|
||||
commit ea127968204cc5d10f3fc9250c306b9e8cbd9b80
|
||||
Release libpng version 1.6.48
|
||||
|
||||
Tag: v1.6.47
|
||||
Tag: v1.6.48
|
||||
|
||||
The following changes have been made to the original:
|
||||
|
||||
@ -14,5 +14,5 @@ The following changes have been made to the original:
|
||||
- APNG support has been added via the APNG patch:
|
||||
http://sourceforge.net/projects/libpng-apng/
|
||||
|
||||
To obtain the original libpng-1.6.47, visit:
|
||||
To obtain the original libpng-1.6.48, visit:
|
||||
http://www.libpng.org/pub/png/libpng.html
|
||||
|
8
extlib/libpng/arm/arm_init.c
vendored
8
extlib/libpng/arm/arm_init.c
vendored
@ -35,14 +35,14 @@
|
||||
#ifndef PNG_ARM_NEON_FILE
|
||||
# if defined(__aarch64__) || defined(_M_ARM64)
|
||||
/* ARM Neon is expected to be unconditionally available on ARM64. */
|
||||
# error "PNG_ARM_NEON_CHECK_SUPPORTED must not be defined on ARM64"
|
||||
# error PNG_ARM_NEON_CHECK_SUPPORTED must not be defined on ARM64
|
||||
# elif defined(__ARM_NEON__) || defined(__ARM_NEON)
|
||||
/* ARM Neon is expected to be available on the target CPU architecture. */
|
||||
# error "PNG_ARM_NEON_CHECK_SUPPORTED must not be defined on this CPU arch"
|
||||
# error PNG_ARM_NEON_CHECK_SUPPORTED must not be defined on this CPU arch
|
||||
# elif defined(__linux__)
|
||||
# define PNG_ARM_NEON_FILE "contrib/arm-neon/linux.c"
|
||||
# else
|
||||
# error "No support for run-time ARM Neon checking; use compile-time options"
|
||||
# error No support for run-time ARM Neon checking; use compile-time options
|
||||
# endif
|
||||
#endif
|
||||
|
||||
@ -53,7 +53,7 @@ static int png_have_neon(png_structp png_ptr);
|
||||
#endif /* PNG_ARM_NEON_CHECK_SUPPORTED */
|
||||
|
||||
#ifndef PNG_ALIGNED_MEMORY_SUPPORTED
|
||||
# error "ALIGNED_MEMORY is required; set: -DPNG_ALIGNED_MEMORY_SUPPORTED"
|
||||
# error ALIGNED_MEMORY is required; please define PNG_ALIGNED_MEMORY_SUPPORTED
|
||||
#endif
|
||||
|
||||
void
|
||||
|
9
extlib/libpng/config.h.in
vendored
9
extlib/libpng/config.h.in
vendored
@ -108,6 +108,15 @@
|
||||
/* Enable POWERPC VSX optimizations */
|
||||
#undef PNG_POWERPC_VSX_OPT
|
||||
|
||||
/* Turn on RISC-V Vector optimizations at run-time */
|
||||
#undef PNG_RISCV_RVV_API_SUPPORTED
|
||||
|
||||
/* Check for RISC-V Vector support at run-time */
|
||||
#undef PNG_RISCV_RVV_CHECK_SUPPORTED
|
||||
|
||||
/* Enable RISCV RVV optimizations */
|
||||
#undef PNG_RISCV_RVV_OPT
|
||||
|
||||
/* Define to 1 if all of the C89 standard headers exist (not just the ones
|
||||
required in a freestanding environment). This macro is provided for
|
||||
backward compatibility; new code need not use it. */
|
||||
|
85
extlib/libpng/contrib/riscv-rvv/README
vendored
Normal file
85
extlib/libpng/contrib/riscv-rvv/README
vendored
Normal file
@ -0,0 +1,85 @@
|
||||
OPERATING SYSTEM SPECIFIC RISC-V RVV DETECTION
|
||||
----------------------------------------------
|
||||
|
||||
Detection of the ability to execute RISC-V Vector on a RISC-V processor
|
||||
requires operating system support. (The information is not available in user
|
||||
mode.)
|
||||
|
||||
HOW TO USE THIS
|
||||
---------------
|
||||
|
||||
This directory contains C code fragments that can be included in
|
||||
riscv/riscv_init.c by setting the macro PNG_RISCV_RVV_FILE to the file name
|
||||
in "" or <> at build time. This setting is not recorded in pnglibconf.h and
|
||||
can be changed simply by rebuilding riscv/riscv_init.o with the required macro
|
||||
definition.
|
||||
|
||||
For any of this code to be used the RISC-V Vector code must be enabled and run
|
||||
time checks must be supported. I.e.:
|
||||
|
||||
#if PNG_RISCV_RVV_OPT > 0
|
||||
#ifdef PNG_RISCV_RVV_CHECK_SUPPORTED
|
||||
|
||||
This is done in a 'configure' build by passing configure the argument:
|
||||
|
||||
--enable-riscv-rvv=check
|
||||
|
||||
Apart from the basic Linux implementation in contrib/riscv-rvv/linux.c this
|
||||
code is unsupported. That means that it is not even compiled on a regular
|
||||
basis and may be broken in any given minor release.
|
||||
|
||||
FILE FORMAT
|
||||
-----------
|
||||
|
||||
Each file documents its testing status as of the last time it was tested (which
|
||||
may have been a long time ago):
|
||||
|
||||
STATUS: one of:
|
||||
SUPPORTED: This indicates that the file is included in the regularly
|
||||
performed test builds and bugs are fixed when discovered.
|
||||
COMPILED: This indicates that the code did compile at least once. See the
|
||||
more detailed description for the extent to which the result was
|
||||
successful.
|
||||
TESTED: This means the code was fully compiled into the libpng test programs
|
||||
and these were run at least once.
|
||||
|
||||
BUG REPORTS: an email address to which to send reports of problems
|
||||
|
||||
The file is a fragment of C code. It should not define any 'extern' symbols;
|
||||
everything should be static. It must define the function:
|
||||
|
||||
static int png_have_rvv(png_structp png_ptr);
|
||||
|
||||
That function must return 1 if RISC-V Vector instructions are supported, 0 if
|
||||
not. It must not execute png_error unless it detects a bug. A png_error will
|
||||
prevent the reading of the PNG and in the future, writing too.
|
||||
|
||||
BUG REPORTS
|
||||
-----------
|
||||
|
||||
If you mail a bug report for any file that is not SUPPORTED there may only be
|
||||
limited response. Consider fixing it and sending a patch to fix the problem -
|
||||
this is more likely to result in action.
|
||||
|
||||
CONTRIBUTIONS
|
||||
-------------
|
||||
|
||||
You may send contributions of new implementations to
|
||||
png-mng-implement@sourceforge.net. Please write code in strict C90 C where
|
||||
possible. Obviously OS dependencies are to be expected. If you submit code you
|
||||
must have the authors permission and it must have a license that is acceptable
|
||||
to the current maintainer; in particular that license must permit modification
|
||||
and redistribution.
|
||||
|
||||
Please try to make the contribution a single file and give the file a clear and
|
||||
unambiguous name that identifies the target OS. If multiple files really are
|
||||
required put them all in a sub-directory.
|
||||
|
||||
You must also be prepared to handle bug reports from users of the code, either
|
||||
by joining the png-mng-implement mailing list or by providing an email for the
|
||||
"BUG REPORTS" entry or both. Please make sure that the header of the file
|
||||
contains the STATUS and BUG REPORTS fields as above.
|
||||
|
||||
Please list the OS requirements as precisely as possible. Ideally you should
|
||||
also list the environment in which the code has been tested and certainly list
|
||||
any environments where you suspect it might not work.
|
36
extlib/libpng/contrib/riscv-rvv/linux.c
vendored
Normal file
36
extlib/libpng/contrib/riscv-rvv/linux.c
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
/* contrib/riscv-rvv/linux.c
|
||||
*
|
||||
* Copyright (c) 2023 Google LLC
|
||||
* Written by Dragoș Tiselice <dtiselice@google.com>, May 2023.
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
* For conditions of distribution and use, see the disclaimer
|
||||
* and license in png.h
|
||||
*
|
||||
* SEE contrib/riscv-rvv/README before reporting bugs
|
||||
*
|
||||
* STATUS: SUPPORTED
|
||||
* BUG REPORTS: png-mng-implement@sourceforge.net
|
||||
*
|
||||
* png_have_rvv implemented for Linux by looking for COMPAT_HWCAP_ISA_V
|
||||
* via hardware capabilites API.
|
||||
*
|
||||
* This code is strict ANSI-C and is probably moderately portable; it does
|
||||
* however use <stdio.h> and it assumes that /proc/cpuinfo is never localized.
|
||||
*/
|
||||
|
||||
#if defined(__linux__)
|
||||
#include <asm/hwcap.h>
|
||||
#include <sys/auxv.h>
|
||||
#endif
|
||||
|
||||
static int
|
||||
png_have_rvv(png_structp png_ptr) {
|
||||
#if defined(__linux__)
|
||||
return getauxval (AT_HWCAP) & COMPAT_HWCAP_ISA_V ? 1 : 0;
|
||||
#else
|
||||
#pragma message( \
|
||||
"warning: RISC-V Vector not supported for this platform")
|
||||
return 0;
|
||||
#endif
|
||||
}
|
12
extlib/libpng/example.c
vendored
12
extlib/libpng/example.c
vendored
@ -2,7 +2,7 @@
|
||||
|
||||
/* example.c - an example of using libpng
|
||||
*
|
||||
* Maintained 2018-2024 Cosmin Truta
|
||||
* Maintained 2018-2025 Cosmin Truta
|
||||
* Maintained 1998-2016 Glenn Randers-Pehrson
|
||||
* Maintained 1996-1997 Andreas Dilger
|
||||
* Written 1995-1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
@ -179,11 +179,11 @@ int main(int argc, const char **argv)
|
||||
* components.
|
||||
*
|
||||
* You do not have to read directly from a file. You can read from memory or,
|
||||
* on systems that support it, from a <stdio.h> FILE*. This is controlled by
|
||||
* the particular png_image_read_from_ function you call at the start.
|
||||
* Likewise, on write, you can write to a FILE* if your system supports it.
|
||||
* Check the macro PNG_STDIO_SUPPORTED to see if stdio support has been
|
||||
* included in your libpng build.
|
||||
* on systems that support <stdio.h>, from a FILE object. This is controlled
|
||||
* by the particular png_image_begin_read_from_ function you call at the start.
|
||||
* Likewise, on write, you can write to a FILE object if your system supports
|
||||
* <stdio.h>. The macro PNG_STDIO_SUPPORTED indicates if stdio is available
|
||||
* and accessible from your libpng build.
|
||||
*
|
||||
* If you read 16-bit (PNG_FORMAT_FLAG_LINEAR) data, you may need to write it
|
||||
* in the 8-bit format for display. You do this by setting the convert_to_8bit
|
||||
|
6
extlib/libpng/libpng-manual.txt
vendored
6
extlib/libpng/libpng-manual.txt
vendored
@ -9,7 +9,7 @@ libpng-manual.txt - A description on how to use and modify libpng
|
||||
|
||||
Based on:
|
||||
|
||||
libpng version 1.6.36, December 2018, through 1.6.47 - February 2025
|
||||
libpng version 1.6.36, December 2018, through 1.6.49 - June 2025
|
||||
Updated and distributed by Cosmin Truta
|
||||
Copyright (c) 2018-2025 Cosmin Truta
|
||||
|
||||
@ -4089,7 +4089,7 @@ READ APIs
|
||||
is filled in from the PNG header in the file.
|
||||
|
||||
int png_image_begin_read_from_stdio (png_imagep image,
|
||||
FILE* file)
|
||||
FILE *file)
|
||||
|
||||
The PNG header is read from the stdio FILE object.
|
||||
|
||||
@ -4164,7 +4164,7 @@ be written:
|
||||
int convert_to_8_bit, const void *buffer,
|
||||
png_int_32 row_stride, const void *colormap)
|
||||
|
||||
Write the image to the given (FILE*).
|
||||
Write the image to the given FILE object.
|
||||
|
||||
With all write APIs if image is in one of the linear formats with
|
||||
(png_uint_16) data then setting convert_to_8_bit will cause the output to be
|
||||
|
12
extlib/libpng/libpng.3
vendored
12
extlib/libpng/libpng.3
vendored
@ -1,6 +1,6 @@
|
||||
.TH LIBPNG 3 "February 18, 2025"
|
||||
.TH LIBPNG 3 "June 12, 2025"
|
||||
.SH NAME
|
||||
libpng \- Portable Network Graphics (PNG) Reference Library 1.6.47
|
||||
libpng \- Portable Network Graphics (PNG) Reference Library 1.6.49
|
||||
|
||||
.SH SYNOPSIS
|
||||
\fB#include <png.h>\fP
|
||||
@ -223,7 +223,7 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.6.47
|
||||
|
||||
\fBint png_image_begin_read_from_file (png_imagep \fP\fIimage\fP\fB, const char \fI*file_name\fP\fB);\fP
|
||||
|
||||
\fBint png_image_begin_read_from_stdio (png_imagep \fP\fIimage\fP\fB, FILE* \fIfile\fP\fB);\fP
|
||||
\fBint png_image_begin_read_from_stdio (png_imagep \fP\fIimage\fP\fB, FILE *\fIfile\fP\fB);\fP
|
||||
|
||||
\fBint, png_image_begin_read_from_memory (png_imagep \fP\fIimage\fP\fB, png_const_voidp \fP\fImemory\fP\fB, size_t \fIsize\fP\fB);\fP
|
||||
|
||||
@ -528,7 +528,7 @@ libpng-manual.txt - A description on how to use and modify libpng
|
||||
|
||||
Based on:
|
||||
|
||||
libpng version 1.6.36, December 2018, through 1.6.47 - February 2025
|
||||
libpng version 1.6.36, December 2018, through 1.6.49 - June 2025
|
||||
Updated and distributed by Cosmin Truta
|
||||
Copyright (c) 2018-2025 Cosmin Truta
|
||||
|
||||
@ -4608,7 +4608,7 @@ READ APIs
|
||||
is filled in from the PNG header in the file.
|
||||
|
||||
int png_image_begin_read_from_stdio (png_imagep image,
|
||||
FILE* file)
|
||||
FILE *file)
|
||||
|
||||
The PNG header is read from the stdio FILE object.
|
||||
|
||||
@ -4683,7 +4683,7 @@ be written:
|
||||
int convert_to_8_bit, const void *buffer,
|
||||
png_int_32 row_stride, const void *colormap)
|
||||
|
||||
Write the image to the given (FILE*).
|
||||
Write the image to the given FILE object.
|
||||
|
||||
With all write APIs if image is in one of the linear formats with
|
||||
(png_uint_16) data then setting convert_to_8_bit will cause the output to be
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user