Commit Graph

516 Commits

Author SHA1 Message Date
David Korth
fdf8095300 [minizip-ng] Update: v3.0.8 -> v3.0.10 2023-05-14 11:42:24 -04:00
David Korth
8b9ddc26ea [zlib-ng] CMakeLists.txt: Define GCC_WINDRES when compiling with gcc. (...well, "NOT MSVC")
Otherwise, zlib1.rc fails with a syntax error.
2023-05-07 12:50:48 -04:00
David Korth
33d7ce6a6c [gettext.win32] patches: Add missing 200-tools-gnulib-define-installdir.patch patch.
Not strictly necessary, though...
2023-05-07 12:14:22 -04:00
David Korth
e763ab74d8 [unice68] Fix testing for -Wno-empty-body on gcc-5.4. (Xubuntu 16.04)
-Wno-shift-negative-value isn't available on gcc-5.4, and since both
flags were combined into a single string, both were tested at the same
time instead of testing each flag individually.

Test the flags individually so we can suppress the -Wempty-body
warnings in unice68 on Xubuntu 16.04.
2023-05-07 12:05:57 -04:00
David Korth
089d692cc0 [zstd] Update: 1.5.4 -> 1.5.5
CheckZSTD.cmake: Update the version number here, too.
2023-04-23 11:08:39 -04:00
David Korth
624d484e0d [zlib-ng] Missed a new file: toolchain-armhf.cmake 2023-04-23 11:08:27 -04:00
David Korth
b3ffe8d26a [zlib-ng] Update: v2.0.6 -> v2.0.7
The "OS Save YMM" check hasn't been accepted upstream yet,
so we're maintaining that patch here.
2023-04-23 10:58:34 -04:00
David Korth
d9c132da80 [inih] _MODIFIED_INIH.txt: s/r52/r56/ 2023-04-23 10:38:32 -04:00
David Korth
d27a845894 [microtar] Cache the last tar header instead of reverse-seeking.
Reverse-seeking past the output buffer can take a while, and the time
increases exponentially the further we read into the file. The only
reverse seeking done by MicroTAR that causes this problem is seeking
back to the header after reading the file data.

Instead of doing that, cache the file header. This eliminates virtually
all reverse-seeking past the output buffer.

Simple benchmarks with debug builds:
- Linux (-Og): 5487 ms -> 2125 ms
- Windows (/Od): 48199 ms -> 39656 ms
2023-02-15 18:26:55 -05:00
David Korth
f3f7846988 [extlib] CMakeLists.txt: Set ZSTD_LIBRARY and ZSTD_LIBRARIES when using the internal copy of zstd. 2023-02-15 00:18:00 -05:00
David Korth
cff29bb391 [libromdata/tests] RomHeaderTest: New test for ROM headers.
This uses zstd-compressed .tar files to reduce the amount of space in
the repository.

[microtar] Use strncpy() and snprintf() to avoid buffer overflows.
This might reduce the total name length from 100 to 99, which may cause
problems later...

[libromdata/tests] microtar_zstd.c: Minimal zstd wrapper for MicroTAR.
It's not perfect, since MicroTAR occasionally seeks backwards and
zstd doesn't support reversing, but we can seek backwards in the current
input buffer most of the time.

For MegaDrive, it took around 1,080ms for uncompressed .tar and 2,680ms
for compressed .tar. The slight slowdown due to rewinding is worth the
massive space savings.

[libromdata] RomDataFactory.hpp: #include "dll-macros.hpp".
Needed for use by RomHeaderTest.

[librpbase] TextOut: Add OF_JSON_NoPrettyPrint to disable JSON
pretty-printing. This is needed for proper comparisons of the JSON data.
Parsing the JSON with RapidJSON and using operator==() didn't seem to
work, so this is the next best option.

RomData subclasses currently tested:
- Console/MegaDrive (and 32X)
- Console/N64
- Handheld/DMG

Code coverage differences:

Before: (top-level)
- Lines: 8059/51885, 15.5%
- Functions: 573/3631, 15.8%

After: (top-level)
- Lines: 9910/51885, 19.1%
- Functions: 684/3631, 18.8%
2023-02-14 23:39:08 -05:00
David Korth
48b3d8530e [microtar] Initial import of MicroTAR, a small tar implementation.
This only implements tar v7, which has some limitations.
(maximum of 100 characters for filenames, etc.)

https://github.com/rxi/microtar
License: MIT
2023-02-13 20:05:21 -05:00
David Korth
72ebce25ff [extlib] Fixed some gcc warnings.
minizip-ng:
extlib/minizip-ng/mz_os_posix.c: In function ‘mz_os_utf8_string_create’:
extlib/minizip-ng/mz_os_posix.c:94:63: warning: unused parameter ‘encoding’ [-Wunused-parameter]
   94 | uint8_t *mz_os_utf8_string_create(const char *string, int32_t encoding) {
      |                                                       ~~~~~~~~^~~~~~~~

rapidjson:
src/librpbase/TextOut_json.cpp:31:
extlib/rapidjson/include/rapidjson/document.h:102:19: warning:
‘template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference>
struct std::iterator’ is deprecated [-Wdeprecated-declarations]
  102 |     : public std::iterator<std::random_access_iterator_tag
      |                   ^~~~~~~~
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/12/include/g++-v12/bits/stl_algobase.h:65,
                 from /usr/lib/gcc/x86_64-pc-linux-gnu/12/include/g++-v12/algorithm:60,
                 from src/librpbase/stdafx.h:28,
                 from src/librpbase/TextOut_json.cpp:10:
/usr/lib/gcc/x86_64-pc-linux-gnu/12/include/g++-v12/bits/stl_iterator_base_types.h:127:34: note: declared here
  127 |     struct _GLIBCXX17_DEPRECATED iterator
      |                                  ^~~~~~~~
2023-02-11 10:04:56 -05:00
David Korth
91492b290b [zstd] common/bits.h: New file; missed this in the v1.5.4 update. 2023-02-10 18:32:35 -05:00
David Korth
a73ad060c8 [zstd] Update: 1.5.2 -> 1.5.4
TODO: zstd has its own official CMake build scripts. We should migrate
over to it sometime.
2023-02-10 18:28:12 -05:00
David Korth
cb92c10a99 [uniwidth] width[02].h: Update license headers. 2023-02-10 18:15:31 -05:00
David Korth
019a0470de Fix some build issues on macOS.
- Split debug symbols doesn't work properly due to an issue with `strip`:
  error: symbols referenced by indirect symbol table entries that can't be stripped in: [library]

- Add "arm64" for M1/M2 Macs.

- zstd: "-fdeclspec" is needed for Clang due to use of __declspec() even
  on non-MS compilers or OSes. Note that we have to check for both
  "Clang" and "AppleClang", since Apple uses its own customized version
  of LLVM/clang.

- msvc.cmake: Make sure "Clang" is quoted when STREQUAL is used.
2023-02-03 19:46:59 -05:00
David Korth
208e6d3b5d [minizip-ng] Update: v3.0.7 -> v3.0.8 2023-01-14 00:00:03 -05:00
David Korth
629f836c16 [libpng] Update: v1.6.38 -> v1.6.39 2022-12-10 16:29:26 -05:00
David Korth
ead260291e [uniwidth] Update to Unicode 15.0.0. 2022-10-16 17:27:54 -04:00
David Korth
436a0461bc [minizip-ng] Update: v1.6.37 -> v1.6.38 2022-10-16 15:22:48 -04:00
David Korth
91cb8f32e2 [minizip-ng] Update: v3.0.6 -> v3.0.7 2022-10-16 14:27:41 -04:00
David Korth
1eb71f4822 [lz4] Don't check for gcc warning flags on MSVC and vice-versa.
This merely wastes time.
2022-10-06 01:02:37 -04:00
Cameron Cawley
fb75f91ef9 zlib-ng: Check that the OS supports saving the YMM registers before enabling AVX2 2022-09-25 21:01:24 +01:00
David Korth
699fa25ab3 [basisu_astc] Fix the output stage for Big-Endian.
This fixes the last failing test in ImageDecoderTest:

TCtest_ASTC/ImageDecoderTest.decodeTest/tctest_example_astc_dds_gz_Image,
	where GetParam() = tctest/example-astc.dds.gz
2022-09-10 15:46:59 -04:00
David Korth
1547c3e619 [uniwidth] Add streq.h for cjk.h.
We're not using cjk.h right now, but better to ensure that it *is* usable
in case we decide to use it later.

[debian] copyright: Update copyrights for uniwidth.
2022-08-28 21:23:45 -04:00
David Korth
e644206255 [uniwidth] Import of the uniwidth subset of gnulib.
uniwidth provides a uc_width() function, which is similar to wcwidth().
Our version removes the 'encoding' parameter, which isn't needed because
we're always using UTF-8.

Fixes #353: rpcli: bad table alignment on multibyte characters
Reported by @DankRank.
2022-08-28 18:47:34 -04:00
David Korth
554680989f [extlib] CMakeLists.txt: Set LZ4 bundled mode.
This should have been committed with the LZ4 v1.9.4 update,
but I forgot.
2022-08-26 00:50:04 -04:00
David Korth
65d74d9d0d [lz4] Update: v1.9.3 -> v1.9.4 2022-08-15 21:48:18 -04:00
David Korth
ba71f61137 [tinyxml2] CMakeLists.txt: Fix debug/release postfixes for the PDB files.
Was missing "-${tinyxml2_VERSION_MAJOR}".

Without this, "tinyxml2-9.pdb" didn't get installed in the release ZIP
file in the Windows build, and no error occurred due to the use of
"optional" to prevent errors caused by Debug vs. Release.
2022-07-28 22:36:32 -04:00
David Korth
bcb9a0e93d [inih] Forgot to add the 'fuzzing' directory in the r56 update. 2022-07-14 19:34:35 -04:00
David Korth
78efb1645e [inih] Update: r53 -> r56
Define INI_API= to disable the symbol visibility macros, since inih
should not be visible outside of libromdata.
2022-07-13 23:45:04 -04:00
David Korth
59ac405c9e [tinyxml2] Disable -Wsuggest-override warnings in gcc builds. 2022-07-06 18:06:45 -04:00
David Korth
a6a52ecc73 [PowerVR] pvrtcDecompress(): Fix byte order isuses on BE.
- Use le32_to_cpu() for the source data.
- Rearrange Pixel32 on BE.

Added non-intrinsic macros using byteorder.h. Can't easily add
intrinsic macros without CMake detection. (Might do that later.)

ImageDecoderTest BE failures before: 15
ImageDecoderTest BE failures after:  11
2022-07-05 19:58:36 -04:00
David Korth
0fde77d02f [googletest] Update: 1.11.0 -> 1.12.1
Remove the ci/ directory since it isn't needed.
2022-07-04 13:53:31 -04:00
David Korth
be8be171fe [zlib-ng] CMakeLists.txt: Disable zlibstatic on Windows and Mac OS.
This broke release builds on AppVeyor.

This fixes a regression from commit 107aa39005.
([zlib-ng] CMakeLists.txt: Hacks to get zlibstatic to work when using the internal zlib on Linux.)
2022-07-03 23:49:55 -04:00
David Korth
ded146a6c1 [libmspack-xenia] lzxd.c: Change position_slots from unsigned int to unsigned short.
Very minor space optimization. `position_slots` is only referenced once
during lzxd initialization, so this shouldn't cause a performance issue.

Code size differences: (64-bit Gentoo Linux, gcc-12.1.0, release build, no LTO)

   text    data     bss     dec     hex filename
  14091       0       0   14091    370b ./extlib/libmspack-xenia/CMakeFiles/mspack.dir/lzxd.c.o
  14053       0       0   14053    36e5 ./extlib/libmspack-xenia/CMakeFiles/mspack.dir/lzxd.c.o
    -38       0       0     -38     -26 Difference

I would have expected the difference to be 22, since position_slots has
11 elements, but I guess reducing the size may have reduced some padding
as well.
2022-07-03 12:42:39 -04:00
David Korth
28a97ccc2d [extlib] Make sure statically-linked extlibs don't export symbols in libromdata.so.
For most libraries, this merely required adding hidden visibility
flags to the CMakeLists.txt files. zlib-ng was a bit finicky,
and TinyXML2 needed a new macro, TINYXML2_NO_GCC_EXPORT.

TODO: zstd isn't currently used by libromdata.so. If I make use of it
later, either directly or indirectly via minizip, update it to not
export symbols when statically linking to it on Linux.

APNG_dlopen.c: Rework this file so it's always compiled regardless of
USE_INTERNAL_PNG and USE_INTERNAL_PNG_DLL. It exports two symbols,
APNG_ref() and APNG_unref(). When using the statically-linked libpng,
these functions are now no-ops, but they still need to be exported.
2022-06-29 22:26:24 -04:00
David Korth
107aa39005 [zlib-ng] CMakeLists.txt: Hacks to get zlibstatic to work when using the internal zlib on Linux. 2022-06-29 21:20:02 -04:00
David Korth
51b3396ed2 [tinyxml2] CMakeLists.txt: Append the SOVERSION in Windows builds.
TinyXML2 is a C++ library, so it definitely needs the SOVERSION in the
DLL name to prevent ABI mismatches.

[libwin32common] DelayLoadHelper.c: Update for TinyXML2.
TODO: Get the SOVERSIONs instead of hard-coding them where necessary.
2022-06-22 01:30:57 -04:00
David Korth
c365d41a48 [minizip-ng] Don't manually check for ZSTD using pkg_check_modules().
This causes issues on Xubuntu 16.04 if a system-wide zstd is installed
because extlib uses the internal version while minizip-ng tries using
the system version, and the system version isn't recent enough for
minizip-ng. (Requires 1.4.0; Xubuntu 16.04 has 1.3.1.)
2022-06-21 17:14:24 -04:00
David Korth
c67e06b6b2 Disable symbol visibility in several extlib modules using static linking.
PowerVR, basisu_astc, inih, libmspack-xenia, and unice68 were leaking
externally-visible symbols in the Linux builds of UI frontends.
2022-06-18 15:29:52 -04:00
David Korth
3b3d5d8b69 [minizip-ng] Update: v3.0.4 -> v3.0.6
Among other things, zip.h and unzip.h are now generated in the binary
directory, not the source directory.
2022-05-21 14:20:39 -04:00
David Korth
84922c2907 [zlib-ng] Update: v2.0.5 -> v2.0.6 2022-01-23 15:48:37 -05:00
David Korth
d01e9c7ff8 [zstd] Update: 1.5.1 -> 1.5.2
TODO: zstd has its own official CMake build scripts. We should migrate
over to it sometime.
2022-01-23 14:52:33 -05:00
David Korth
a03801ae45 [minizip-ng] Restore some rom-properties changes, including a definition for FSCTL_GET_REPARSE_POINT. 2021-12-22 23:35:21 -05:00
David Korth
c11ffb0350 [minizip-ng] Update: v3.0.2 -> v3.0.4 2021-12-22 22:52:45 -05:00
David Korth
7ab6934a26 [zstd] Update: 1.5.0 -> 1.5.1
TODO: zstd has its own official CMake build scripts. We should migrate
over to it sometime.
2021-12-22 22:48:29 -05:00
David Korth
c9c763662e PVRTDecompress.cpp: Reduce a static const array from int32_t to uint8_t; add an assert for rom-properties.
Code size difference: (64-bit Gentoo Linux, gcc-11.2.0, release build, no LTO)

   text    data     bss     dec     hex filename
   7774       0       0    7774    1e5e PVRTDecompress.cpp.o [before]
   7738       0       0    7738    1e3a PVRTDecompress.cpp.o [after]
    -36       0       0     -36     -24 Difference
2021-09-17 20:16:14 -04:00
David Korth
1725543f79 [basisu_astc] Some micro-optimizations with loops.
Test image: ast_o_ty1_mecha02_R.tga-d8b5c072d0be593e4a0cd7abc38e96ff.astc.stex
(1024x1024, ASTC_8x8)

Valgrind event count:
- Before: 675,564,532
- After:  667,186,111
- Diff:    -8,378,421 (-1.25%)

Code size difference: (64-bit Gentoo Linux, gcc-11.2.0, release build, no LTO)

   text    data     bss     dec     hex filename
  16603       0       0   16603    40db basisu_astc_decomp.cpp.o [before]
  16507       0       0   16507    4073 basisu_astc_decomp.cpp.o [after]
    -96       0       0     -96     -60 Difference
2021-09-09 19:14:11 -04:00
David Korth
cf6c8709df [basisu_astc] decompress(): Flatten the two loops into one; use pointer arithmetic.
Code size differences: (64-bit Gentoo Linux, gcc-11.2.0, release build, no LTO)

   text    data     bss     dec     hex filename
  16752       0       0   16752    4170 basisu_astc_decomp.cpp.o [before]
  16603       0       0   16603    40db basisu_astc_decomp.cpp.o [after]
   -149       0       0    -149     -95 Difference
2021-09-07 01:05:31 -04:00
David Korth
14e6457753 [basisu_astc] Converted another ternary comparison tree to switch/case.
Code size differences: (64-bit Gentoo Linux, gcc-11.2.0, release build, no LTO)

   text    data     bss     dec     hex filename
  16752       0       0   16752    4170 basisu_astc_decomp.cpp.o [before]
  16752       0       0   16752    4170 basisu_astc_decomp.cpp.o [after]
      0       0       0       0       0 Difference

No code size change, but it's definitely better code now...
2021-09-07 00:58:00 -04:00
David Korth
3f91824bc5 [basisu_astc] Converted some more 32-bit arrays to 8-bit arrays.
Code size differences: (64-bit Gentoo Linux, gcc-11.2.0, release build, no LTO)

   text    data     bss     dec     hex filename
  16877       0       0   16877    41ed basisu_astc_decomp.cpp.o [before]
  16752       0       0   16752    4170 basisu_astc_decomp.cpp.o [after]
   -125       0       0    -125     -7d Difference
2021-09-07 00:52:29 -04:00
David Korth
9fd6094561 [basisu_astc] Convert a large ternary comparison tree to switch/case.
This makes it easier to read and reduces code size a bit.

Code size differences: (64-bit Gentoo Linux, gcc-11.2.0, release build, no LTO)

   text    data     bss     dec     hex filename
  16889       0       0   16889    41f9 basisu_astc_decomp.cpp.o [before]
  16877       0       0   16877    41ed basisu_astc_decomp.cpp.o [after]
    -12       0       0     -12      -c Difference
2021-09-07 00:50:16 -04:00
David Korth
543bc2d582 [zlib-ng] CMakeLists.txt: Disable ZLIB_DEBUG in debug builds.
This fixes the format warnings on AppVeyor MinGW-w64, and we don't
need to enable zlib debugging, since we're not debugging zlib.
2021-09-06 04:42:24 -04:00
David Korth
5a3ec80861 Revert "[zlib-ng] deflate.c: Fix a -Wformat warning."
This is caused by ZLIB_DEBUG, so let's disable it. We don't need to
debug zlib in rom-propeties, anyway.

This reverts commit a3bd8307a0.
2021-09-06 04:40:41 -04:00
David Korth
a3bd8307a0 [zlib-ng] deflate.c: Fix a -Wformat warning.
AppVeyor's MinGW-w64 build is showing -Wformat warnings that aren't
showing up locally. Unfortunately, I can't seem to find an equivalent
for `make -k` with CMake, so I'll have to keep pushing individual
fixes until I get it fully built.
2021-09-06 03:33:23 -04:00
David Korth
86dbf36f3e [cmake] gcc.cmake: Enable -Werror for several different format warnings.
Reference: https://fedoraproject.org/wiki/Format-Security-FAQ

-Werror=format-nonliteral is *not* enabled because there are some
legitimate uses of non-literal format strings.

Separated the warning flags into multiple variables.

Updated everything to build with this change.
2021-09-06 01:41:59 -04:00
David Korth
c0cca0d723 [basisu_astc] basisu_astc_decomp.cpp: Swap the R and B channels to match the expected data formats. 2021-09-03 23:35:50 -04:00
David Korth
35fd0d7a5b [basisu_astc] Add gcc fall-through comments.
Fix copy/paste error with the _MODIFIED_BASISU.txt filename,
and add new stuff to it.
2021-09-03 23:31:02 -04:00
David Korth
ec52d1b2f7 [basisu_astc] basisu_astc_decomp.cpp: Change some arrays from 32-bit to 8-bit.
These arrays don't have values that exceed 255, so there's no point
in wasting all the space.

Code size differences: (64-bit Gentoo Linux, gcc-11.2.0, release build, no LTO)

   text    data     bss     dec     hex filename
  23065       0       0   23065    5a19 basisu_astc_decomp.cpp.o [before]
  16889       0       0   16889    41f9 basisu_astc_decomp.cpp.o [after]
  -6176       0       0   -6176   -1820 Difference
2021-09-03 23:27:33 -04:00
David Korth
1317a931d4 [librptexture] GodotSTEX: Initial implementation of ASTC 8x8 decoding.
Added the ASTC decoder from Basis Universal.

FIXME: The decoded images have swapped R and B channels.
2021-09-03 23:24:42 -04:00
David Korth
5257a7fe45 [gettext.win32] Rebuild using -D_WIN32_WINNT=0x0501/0x0502.
Otherwise, the gettext executables don't work on Windows 7 due to
gnulib using GetSystemTimePreciseAsFileTime().
2021-09-03 18:47:06 -04:00
David Korth
33a5be5230 [gettext.win32] Rebuilt using MinGW-w64 9.0.0 and gcc-11.2.0.
Also enabled the following flags:
- large address aware
- high entropy VA (64-bit only)
- dynamic base
- nxcompat

For some reason, these weren't enabled when I built them before, which
broke when running ROM Properties from a network share on Windows 10
due to the "Prohibit Dynamic Code" policy. (Probably nxcompat.)

Also, strip the binaries in bin.i386/.
2021-09-02 18:20:46 -04:00
David Korth
880471d006 [tinyxml2] CMakeLists.txt: Fix DLL installation in Windows packaging, again.
This was originally fixed in commit b243f47341.
([tinyxml2] Fix DLL installation in Windows packaging.)

However, it regressed when TinyXML2 was upgraded to 8.1.0 in
commit 05aed01ddf.
([tinyxml2] Updated to tinyxml2-8.1.0.)

The end result was the 32-bit TinyXML2 being installed in bin/,
and the 64-bit TinyXML2 not being installed at all. This resulted in
crashes, which shouldn't have happened either; this means something
is wrong with DelayLoad, so that will need to be fixed next.

Fixes #313: tinyxml2.dll isn't packaged correctly
Reported by @ccawley2011.
2021-07-19 19:14:35 -04:00
David Korth
a646f68b06 [googletest] Update: 1.10.0 -> 1.11.0
Remove more testsuite files, since they aren't needed.
2021-06-27 02:10:30 -04:00
David Korth
ea798b2d3c [tinyxml] Update: 8.1.0 -> 9.0.0 2021-06-27 01:58:26 -04:00
David Korth
846e905815 [tinyxml2] CMakeLists.txt: Converted to CRLF to match upstream. 2021-06-27 01:55:43 -04:00
David Korth
903527db6c [zlib-ng] Update: v2.0.3 -> v2.0.5 2021-06-27 01:52:21 -04:00
David Korth
05aed01ddf [tinyxml2] Updated to tinyxml2-8.1.0. 2021-05-23 16:20:29 -04:00
David Korth
3048dff5e0 [minizip-ng] Update: v3.0.1 -> v3.0.2 2021-05-15 00:38:18 -04:00
David Korth
371435b67a [zlib-ng] Update: v2.0.2 -> v2.0.3 2021-05-15 00:38:04 -04:00
David Korth
609ff366a7 [zstd] Fix a few MSVC uninitialized variable errors due to /sdl.
extlib\zstd\compress\zstd_lazy.c(1399): error C4703: potentially uninitialized local pointer variable 'dmsTagRow' used
extlib\zstd\compress\zstd_lazy.c(1407): error C4703: potentially uninitialized local pointer variable 'dmsRow' used
2021-05-15 00:37:09 -04:00
David Korth
5885b62c9e [zstd] Update: 1.4.9 -> 1.5.0
TODO: zstd has its own official CMake build scripts. We should migrate
over to it sometime.
2021-05-15 00:04:50 -04:00
David Korth
c31c512bf9 [googletest] gtest-death-test.cc: Initialize dummy variables to 0.
gcc-11.1 complained about uninitialized variables, and googletest has
-Werror specified:

In file included from ../../extlib/googletest/googletest/src/gtest-all.cc:42:
../../extlib/googletest/googletest/src/gtest-death-test.cc: In function ‘bool testing::internal::StackGrowsDown()’:
../../extlib/googletest/googletest/src/gtest-death-test.cc:1301:24: error: ‘dummy’ may be used uninitialized [-Werror=maybe-uninitialized]
 1301 |   StackLowerThanAddress(&dummy, &result);
      |   ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
../../extlib/googletest/googletest/src/gtest-death-test.cc:1290:13: note: by argument 1 of type ‘const void*’ to ‘void testing::internal::StackLowerThanAddress(const void*, bool*)’ declared here
 1290 | static void StackLowerThanAddress(const void* ptr, bool* result) {
      |             ^~~~~~~~~~~~~~~~~~~~~
../../extlib/googletest/googletest/src/gtest-death-test.cc:1299:7: note: ‘dummy’ declared here
 1299 |   int dummy;
      |       ^~~~~
cc1plus: all warnings being treated as errors
2021-04-28 01:32:12 -04:00
David Korth
eadcdf9327 Remove "/Gz" for stdcall on i386 when building with MSVC.
I tested a release build and it saved a total of 10,752 bytes.

On the other hand, it had a rather huge maintenance overhead, since I had
to ensure that all extlibs had __cdecl set up in the headers properly,
and this had to be redone on every update.

The i386 build of LZ4 on AppVeyor was failing in tests because of missing
stdcall symbols. I decided not to bother adding stdcall support to LZ4
and simply revert stdcall entirely.
2021-03-31 22:24:17 -04:00
David Korth
d3a1fc48be [zlib-ng] CMakeLists.txt: CMAKE_RELEASE_POSTFIX somehow got lost when upgrading from zlib-1.2.11 to zlib-ng 2.0.0-RC2. 2021-03-31 21:43:55 -04:00
David Korth
f8e6fb06cc [zlib-ng] Update: v2.0.1 -> v2.0.2 2021-03-25 02:00:24 -04:00
David Korth
5c16a08f6c [lz4] Remove the now-obsolete visual/ subdirectory.
The MSVC projects have been moved to build/.
2021-03-22 01:25:30 -04:00
David Korth
0f223add03 [inih] Update: r52 -> r53
Note that the only differences between r52 and r53 were in the
meson build scripts, so there are no real changes here.
2021-03-22 01:21:44 -04:00
David Korth
f2d6b4652d [lz4] Update: v1.9.2 -> v1.9.3 2021-03-22 01:18:02 -04:00
David Korth
6b50b93485 [minizip-ng] CMakeLists.txt: Use ${ZSTD_LIBRARY} for zstd instead of the specified targets.
These targets don't exist in our zstd CMakeLists.txt...
2021-03-22 00:43:28 -04:00
David Korth
8068676dad [zlib-ng] Update: v2.0.0-RC2 -> v2.0.1 2021-03-21 23:56:22 -04:00
David Korth
43976a6e3d [minizip-ng] Update: v3.0.0 -> v3.0.1 2021-03-21 23:49:03 -04:00
David Korth
549d87fd79 [minizip-ng] CMakeLists.txt: Disable target_link_directories().
This was added in CMake-3.13, and travis-ci has CMake-3.9.2.
2021-03-21 23:40:00 -04:00
David Korth
fc3c35bbff [zlib-ng] CMakeLists.txt: Install the DLL to ${DIR_INSTALL_DLL}.
Otherwise, it attempts to install to C:\Program Files\rom-properties\bin\,
which is obviously wrong.
2021-03-21 15:00:37 -04:00
David Korth
e21814a754 [zstd] zstd.h: Update some function declarations; increment version number.
I somehow missed these when updating zstd earlier. It only seemed to
break the MinGW-w64 builds, which is odd, since I would have expected
this to break every build in cases where we didn't have a system zstd...
2021-03-13 22:29:33 -05:00
David Korth
7e885ba19a [rapidjson] rapidjson.h: Set endianness for MSVC/ARM64.
Fixes #287: [Feature Request] add cross-compilation support for
Windows arm64

Reported by @dennisameling.
2021-03-13 21:57:50 -05:00
David Korth
17d33de325 [zstd] Updated: 1.4.8 -> 1.4.9 2021-03-13 21:07:16 -05:00
David Korth
c3f4db832c [zlib] Updated from v1.2.11 to zlib-ng v2.0.0-RC2.
https://github.com/zlib-ng/zlib-ng
2021-02-18 23:50:27 -05:00
David Korth
7d302b51c9 [minizip] Updated from v2.10.5 to minizip-ng 3.0.0.
As of 3.0.0, the minizip fork is now called minizip-ng.

https://github.com/zlib-ng/minizip-ng
2021-02-17 18:38:19 -05:00
David Korth
4da7a51056 [zstd] Updated from 1.4.5 to 1.4.8. 2021-02-17 18:34:16 -05:00
David Korth
860288ab05 [minizip] Updated to v2.10.5 from the MiniZip fork.
https://github.com/nmoinvaz/minizip

NOTE: iconv support is disabled for now, since it isn't needed by any
of the test cases. It may be re-enabled later if minizip is needed for
the main program.
2020-12-19 11:25:05 -05:00
David Korth
70e31278ba [inih] Updated to inih-r52. 2020-11-01 13:17:49 -05:00
David Korth
991618e6c6 [extlib] The PDBs *do* need to be marked as OPTIONAL.
We're technically installing both the Debug and Release files, but only
one will exist at any given time, so it has to be OPTIONAL.

[libpng] CMakeLists.txt: Minor formatting improvements.
2020-09-20 15:02:50 -04:00
David Korth
777897befa [extlib] Make sure LZ4 and MiniLZO are installed in the Windows package.
Also install the .pdb file.
2020-09-20 14:55:13 -04:00
David Korth
13798dc609 Revert "Use a static library for LZ4 on Mac OS X."
This reverts commit 0bfdc891b5.

It *still* links to a shared library, even though I told it not to...
2020-09-07 12:22:04 -04:00
David Korth
0bfdc891b5 Use a static library for LZ4 on Mac OS X.
The unit tests aren't finidng the shared library.
2020-09-07 11:44:18 -04:00
David Korth
3bb4d04ade [lz4] CMakeLists.txt: Only set the dllexport/dllimport flags on Windows.
This broke the Mac OS X build:

In file included from /Users/travis/build/GerbilSoft/rom-properties/extlib/lz4/lib/lz4.c:110:

/Users/travis/build/GerbilSoft/rom-properties/extlib/lz4/contrib/cmake_unofficial/../../lib/lz4.h:119:1: error: '__declspec' attributes are not enabled; use '-fdeclspec' or '-fms-extensions' to enable support for __declspec attributes

LZ4LIB_API int LZ4LIB_CALL LZ4_versionNumber (void);  /**< library version number; useful to check dll version */

^

/Users/travis/build/GerbilSoft/rom-properties/extlib/lz4/contrib/cmake_unofficial/../../lib/lz4.h💯22: note: expanded from macro 'LZ4LIB_API'

.#  define LZ4LIB_API __declspec(dllexport) LZ4LIB_VISIBILITY

                     ^
2020-09-07 05:01:12 -04:00
David Korth
97822523d6 [win32] RP_ShellPropSheetExt: Added copy to clipboard actions.
- TextOut: Added CRLF linebreak options, which are needed for
  copying to clipboard on Windows.

[rapidjson] prettywriter.h: Added a CRLF linebreak option.
2020-09-06 00:33:13 -04:00
David Korth
cdd88e2455 [rapidjson] Added rapidjson-1.1.0.
The JSON output code will be rewritten to use rapidjson, which will allow
us to add more stuff without having to worry if the resulting text has
the correct formatting.

This adds around 20 KB to the compiled binary.
2020-09-06 00:33:12 -04:00
David Korth
bffe443642 [minilzo] Added a Win32 resource script.
Based on LZ4's Win32 resource script.
2020-09-05 11:22:42 -04:00
David Korth
7b282f5d81 [minilzo] Added an internal copy of MiniLZO.
I chose MiniLZO instead of regular LZO because we only need to be able to
decompress LZO1X blocks.

[libromdata] CisoPspReader: Don't call lzo_init() if this JISO isn't
actually using LZO. Otherwise, if the DLL is missing on Windows, the
program will crash.
2020-09-05 11:05:12 -04:00
David Korth
8f76f2cf96 [lz4] Copied over verrsrc.h from zstd.
This should fix the MinGW-w64 build:

[ 16%] Building RC object extlib/lz4/contrib/cmake_unofficial/CMakeFiles/lz4_shared.dir/__/__/visual/VS2017/liblz4-dll/liblz4-dll.rc.obj
C:\projects\rom-properties\extlib\lz4\visual\VS2017\liblz4-dll\liblz4-dll.rc:6:21: fatal error: verrsrc.h: No such file or directory
.#include "verrsrc.h"
                     ^
compilation terminated.
C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\bin\windres.exe: preprocessing failed.
2020-09-05 05:16:30 -04:00
David Korth
a837fcfbfa [lz4] Append 'd' to the DLL filename for debug builds. 2020-09-05 02:53:04 -04:00
David Korth
42ebf46334 [zstd] _MODIFIED_ZSTD.txt: Mention the RC file in DLL builds. 2020-09-05 02:47:27 -04:00
David Korth
611e047051 [zstd] Added the Win32 resource file to the DLL build. 2020-09-05 02:47:12 -04:00
David Korth
f5736886de [lz4] Use C linkage using LZ4LIB_CALL.
FIXME: Compiling lz4 with /Gz fails due to C2373 type redefinition
errors, which doesn't make any sense...
2020-09-05 02:42:23 -04:00
David Korth
ad476eb9a0 [lz4] Added a copy of lz4-1.9.2 for PSP CISO. 2020-09-05 02:32:50 -04:00
David Korth
047f3d149e [zstd] _MODIFIED_ZSTD.txt: s/zlib/zstd/ 2020-09-05 01:40:43 -04:00
David Korth
86c1366312 [gettext.win32] Rebuilt libgnuintl-8.lib for i386 using MSVC 2019.
It seems MSVC 2010 is generating a broken .lib file...
2020-08-20 23:09:05 -04:00
David Korth
43c01b14d6 [gettext.win32] Rebuilt libgnuintl-8.lib for i386.
AppVeyor complained that it was corrupt...
2020-08-20 20:17:41 -04:00
David Korth
98af19118b [gettext.win32] Updated gettext-win32: 0.20.2 -> 0.21
Main changes:
- gettext now has wbindtextdomain() on Windows, so we can remove our
  custom Unicode patch.
- The 64-bit version seems to always build DllMain from the relocatable
  package, even though we're disabling that...

New patches:

122-Use-LF-as-newline-in-envsubst.patch
- From: https://github.com/Alexpux/MINGW-packages/tree/master/mingw-w64-gettext
- Use LF as newlines instead of CRLF.

1002-dcigettext-c-include-wchar-h.patch:
- #include <wchar.h> for _wgetcwd().

1003-gettextsrc-exports-missing-formatstring-ruby.patch:
- Fix a missing export for formatstring_ruby, which fixes an undefined
  __imp_* symbol error.

1004-gettext-runtime-disable-iconv.patch:
- Disable iconv support in gettext runtime so we don't need to bundle
  iconv.dll in the final package.
- Was applied previously, but I forgot to include it as a patch.
2020-08-20 19:08:03 -04:00
David Korth
4fb1a650a7 [googletest] Don't include debugapi.h, since it's not available when using MSVC's v140_xp toolset.
It's implicitly included by windows.h in newer SDKs.
2020-08-13 00:00:49 -04:00
David Korth
e2d592de91 [googletest] Remove MSVC 2013 compatibility fixes; switch AppVeyor to MSVC 2015.
Some of the stuff simply can't be fixed, so we'll use MSVC 2015.

Note that this means the test suite won't be usable with older versions
of MSVC.
2020-08-12 21:25:46 -04:00
David Korth
75164f59c4 [googletest] gtest-internal.h: Attempt to fix Indices on MSVC 2013, again. 2020-08-12 20:32:41 -04:00
David Korth
d4d1b6b306 [googletest] gtest-internal.h: s/Incides/Indices/ 2020-08-01 01:35:38 -04:00
David Korth
9c26fd5d22 [googletest] Two more MSVC 2013 fixes.
- #include <debugapi.h> on MSVC 2015 and later only.
- `using =` is only supported on MSVC 2015 and later.
2020-08-01 01:34:42 -04:00
David Korth
843b207d02 [googletest] Disable noexcept and -WX on MSVC 2013. 2020-08-01 00:45:16 -04:00
David Korth
2b9595ba99 [googletest] gtest-matchers.h: MSVC 2013 doesn't support default move constructors. 2020-08-01 00:31:31 -04:00
David Korth
9d42ab3ec5 [googletest] Restored _MODIFIED_GTEST.txt and updated for v1.10.0. 2020-08-01 00:00:40 -04:00
David Korth
0ee4c70cf3 [googletest] Fix build issues with MSVC 2013.
- [[noreturn]] isn't supported; use __declspec(noreturn).

- constexpr isn't supported.
2020-07-31 23:59:15 -04:00
David Korth
5a1b4d1be0 [googletest] Updated to v1.10.0.
Now requires C++ 2011.
2020-07-30 19:39:43 -04:00
David Korth
0136021beb [extlib] CMakeLists.txt: Don't install zstd.dll right now.
We're not using zstd outside of the test suite, so we don't need to
install it.
2020-07-12 17:22:54 -04:00
David Korth
49902f0445 [zstd] CMakeLists.txt: Check for BUILD_SHARED_LIBS/BUILD_STATIC_LIBS before linking CMAKE_THREAD_LIBS_INIT. 2020-06-27 03:09:19 -04:00
David Korth
b216f75ed7 [zstd] CMakeLists.txt: Wrap various things in BUILD_SHARED_LIBS/BUILD_STATIC_LIBS checks.
This should fix the travis-ci build.

Removed SET_WINDOWS_SUBSYSTEM(zstdstatic) since that doesn't make
any sense.
2020-06-27 03:09:19 -04:00
David Korth
1f1c90dcbc [minizip] minizip, minigzip: main() must be __cdecl.
This fixes an MSVC warning:

warning C4007: 'main': must be '__cdecl'
2020-06-27 03:09:19 -04:00
David Korth
17b962a9a3 [zstd] zstd.h: Added ZSTDLIB_CALL.
It turns out we need it because other modules are compiled with /Gz,
even if zstd isn't.

FIXME: Compiling zstd with /Gz fails due to C2373 type redefinition
errors, which doesn't make any sense...
2020-06-27 03:09:19 -04:00
David Korth
7e19c4d5a8 [zstd] CMakeLists.txt: Explicitly mark zstd as SHARED.
Otherwise, the travis-ci build fails because BUILD_SHARED_LIBS is OFF
here, so CMake tries building it as a static library, and then fails
because the INSTALL() rule lacks an ARCHIVE target.
2020-06-27 03:09:19 -04:00
David Korth
f8fdaa7ae8 Allow disabling ZSTD entirely using ENABLE_ZSTD.
Similar to ENABLE_XML.

Print ZSTD status in the build summary.
2020-06-27 03:09:19 -04:00
David Korth
c3b31369a0 [zstd] Added the Win32 resource file to DLL builds.
- TARGET_INCLUDE_DIRECTORIES(): Needs to be PUBLIC, not INTERFACE.
  Otherwise, rc.exe can't find zstd.h.

- verrsrc.h: Added VS_FF_DEBUG, which is used by libzstd-dll.rc but
  wasn't present in the original version upstream.
2020-06-27 03:09:19 -04:00
David Korth
5be205569d [zlib] Define HAVE_HIDDEN on non-Win32 builds. 2020-06-27 03:09:19 -04:00
David Korth
d7d5ddbae4 [libpng] Make sure dllexport and dllimport are used correctly. 2020-06-27 03:09:19 -04:00
David Korth
87933aa685 [zstd] Fix MSVC builds.
- Remove "/Ob0 /Od /RTC1" from debug flags. In particular, "/Od" and
  "/RTC1" conflict with each other:

cl : Command line error D8016: '/O2' and '/RTC1' command-line options are incompatible

- Add "/Ob2" to debug CFLAGS.

- Set -DZSTD_DLL_EXPORT when building the DLL. Otherwise, symbols aren't
  exported and the import library isn't built.

- Set -DZSTD_DLL_IMPORT when importing the DLL. This isn't strictly
  necessary, but it does reduce some overhead.

- Install the PDB files. (Copied from zlib.)
2020-06-27 03:09:19 -04:00
David Korth
81be81f4af [zstd] Added LICENSE and a section in the Debian copyright file. 2020-06-27 03:09:19 -04:00
David Korth
f4c96fb289 [zstd] Added _MODIFIED_ZSTD.txt. 2020-06-27 03:09:19 -04:00
David Korth
dc587561b4 [zstd] Added zstd for use with MiniZip.
MiniZip 2.10.0 added support for zstd as a compression method, so we
should support it.

Note that a system version of zstd is preferred on Linux systems.

Enabled the MiniZip test tools for manual builds only. Info-ZIP hasn't
been updated in a while, so I'm going to use the MiniZip test tools to
compress ZIP archives using zstd.

Enabled MiniZip compression in order to compress stuff using the minizip
test program.

mz_strm_zstd.c: FIXME: Compression level doesn't work. Hard-coded the
maximum compression level for now.
2020-06-27 03:09:15 -04:00
David Korth
4cc2b957c1 [minizip] mz.h: FIXME: The inttypes.h check also breaks on MSVC 2013. 2020-06-25 20:18:35 -04:00
David Korth
c03ffd1196 [minizip] mz.h: FIXME: The stdint.h check breaks on MSVC 2013. 2020-06-25 19:25:52 -04:00
David Korth
c37b86e574 [minizip] Updated to v2.10.0 from the MiniZip fork.
https://github.com/nmoinvaz/minizip

TODO: Add ZSTD support.
2020-06-25 00:35:47 -04:00
David Korth
4e3c7abb98 [extlib] unice68: unice68_depacker(): Added explicit size parameters.
This is needed in order to prevent buffer overflows.

Found using afl-2.56b.
2020-06-20 12:49:21 -04:00
David Korth
4364e9a838 Fix CMake project version usage.
The variables are CMAKE_PROJECT_VERSION* for the top-level version
PROJECT_VERSION_* is set if a subproject sets a version number.

- CMP0048 is needed in order to use VERSION. This might be implied by
  using CMAKE_MINIMUM_REQUIRED(), but we'll explicitly specify it anyway.

- Set policies before calling PROJECT().

- Update the Win32 DO_SPLIT_DEBUG() code to use PROJECT_VERSION_*
  variables if set, or CMAKE_PROJECT_VERSION* if not.

This should fix the Win32 build.

This fixes a regression from commit a1a2e0895c.
(Set all projects to require CMake 3.0.)
2020-06-19 21:01:55 -04:00
David Korth
e1d0c027d6 [inih] Updated to inih-r51. 2020-06-19 18:08:56 -04:00
David Korth
a1a2e0895c Set all projects to require CMake 3.0.
- Added language specifications.
- Set the top-level project version in the PROJECT() call.
- Set CMP0063 to NEW if it's available. This enables the symbol
  visibility presets on *all* target types, not just shared libraries,
  module libraries, and executables with ENABLE_EXPORTS set.
2020-06-19 18:02:04 -04:00
David Korth
15ac32f7a0 [gettext.win32] lib.i386: AppVeyor reported libgnuintl-8.lib was corrupt.
Not sure what happened here...
2020-06-01 18:21:22 -04:00
David Korth
b5b89c7928 [minizip] Updated to v2.9.3 from the MiniZip fork.
https://github.com/nmoinvaz/minizip
2020-06-01 17:39:54 -04:00
David Korth
66276caba4 [gettext.win32] Updated gettext-win32: 0.20.1 -> 0.20.2
Compiled on Ubuntu 20.04 using MinGW-w64 with gcc-9.3.0-7ubuntu1+22~exp1ubuntu4.

Some changes:
- The libraries are significantly smaller than before. Not sure what
  really changed...
- The .def files no longer have ordinals.
2020-06-01 17:23:17 -04:00
David Korth
c22eb666ef [tinyxml2] Updated to tinyxml2-8.0.0. 2020-03-09 20:16:58 -04:00
David Korth
b3de91449a [minizip] mz_os_win32.c: #include <winioctl.h> before checking for FSCTL_GET_REPARSE_POINT.
MinGW-w64 defines FSCTL_GET_REPARSE_POINT in winioctl.h (or a file
included by it), so we end up with a redefinition warning.

C:\projects\rom-properties\extlib\minizip\mz_os_win32.c:23:0: warning: "FSCTL_GET_REPARSE_POINT" redefined
. # define FSCTL_GET_REPARSE_POINT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 42, METHOD_BUFFERED, FILE_ANY_ACCESS)

In file included from C:\projects\rom-properties\extlib\minizip\mz_os_win32.c:22:0:
C:/mingw-w64/i686-6.3.0-posix-dwarf-rt_v5-rev1/mingw32/i686-w64-mingw32/include/winioctl.h:1280:0: note: this is the location of the previous definition
. #define FSCTL_GET_REPARSE_POINT CTL_CODE(FILE_DEVICE_FILE_SYSTEM,42,METHOD_BUFFERED,FILE_ANY_ACCESS
2020-03-09 11:31:10 -04:00
David Korth
39eff90db2 [extlib] Set the 32-bit MSVC calling convention to cdecl before calling check_function_exists().
This seemingly broke detection of e.g. fileno() and setmode() on 32-bit.

FIXME: Use check_symbol_exists(), which doesn't have this problem.
2020-03-08 14:44:56 -04:00
David Korth
ebdb96da6d [libmspack-xenia] xenia_lzx.c: Use _BitScanForward() in MinGW builds.
ffs() is not declared in headers, even though it's a gcc built-in.

extlib/libmspack-xenia/xenia_lzx.c: In function 'bit_scan_forward':
extlib/libmspack-xenia/xenia_lzx.c:39:10: warning: implicit declaration of function 'ffs' [-Wimplicit-function-declaration]
   39 |  int i = ffs(v);
      |          ^~~
extlib/libmspack-xenia/xenia_lzx.c:39:14: warning: 'ffs' argument 1 promotes to 'uint32_t' {aka 'unsigned int'} where 'int' is expected in a call to built-in function declared without prototype [-Wbuiltin-declaration-mismatch]
   39 |  int i = ffs(v);
      |              ^
<built-in>: note: built-in 'ffs' declared here
2020-03-07 16:12:16 -05:00
David Korth
7ab464c4c4 [minizip] .codecov.yml: Added this file from MiniZip 2.9.2.
It was present in my local repository, but I forgot to add it to git.
2020-02-18 20:54:27 -05:00
David Korth
4071b4bad6 [minizip] Updated to v2.9.2 from the MiniZip fork.
https://github.com/nmoinvaz/minizip

This includes a potential buffer overflow fix in mz_os_win32.c when
determining the pathname of kernel32.dll. We don't actually need it,
since kernel32.dll is always loaded, so use GetModuleHandle() instead.
2020-02-17 01:25:23 -05:00
David Korth
844e7f85fa [libmspack-xenia] Ported some changes over from Xenia's libmspack.
Upstream changes:

[CPU] Use window size for LZX ref_data_size
71780838f0

[CPU] Properly clear LZX window
c213f7d7a3

Added xe::bit_scan_forward, referenced in these commits:

[CPU] Minor LZX code cleanup.
29665ae79c

[CPU] Fix lzx_decompress misuse of xe::bit_count.
e14639c6c0

There's also a fix for the non-Windows implementation (off-by-one).

Fixes PVS-Studio V127 (Med): An overflow of the 32-bit 'window_bits'
variable is possible inside a long cycle which utilizes a memsize-type
loop counter.
2020-01-15 22:44:32 -05:00
David Korth
b243f47341 [tinyxml2] Fix DLL installation in Windows packaging.
We need to install in ${INSTALL_BIN_DIR}, not ${CMAKE_INSTALL_BINDIR}.
Otherwise, it ends up in bin/ instead of i386/ or amd64/.

[libpng] Use ${INSTALL_BIN_DIR} for the Framework destination. This will
be used if I ever get any Mac OS X frontends done (besides rpcli).

This fixes issue #194: package.cmd: tinyxml2.dll isn't copied over correctly.
2020-01-12 23:56:43 -05:00
David Korth
6e8c90b906 [oldwincompat] Added stubs for Windows 2000 (and maybe later Win9x) compatibility.
Stubbed functions for MSVC 2010-2017:
- InitializeSListHead()
- GetModuleHandleExW()
- EncodePointer()
- DecodePointer()
- SetFilePointerEx()

rpcli.exe now works, but rom-properties.dll fails to register.

CRT linkage is forced to static when enabling old Windows compatibility
on MSVC 2010 and later, since this is needed in order to get the CRT to
use the stub functions.

References:
- https://stackoverflow.com/questions/19516796/visual-studio-2012-win32-project-targeting-windows-2000/53548116
- https://stackoverflow.com/a/53548116

NOTE: NLS needs to be disabled; otherwise, gettext won't load due to
___mb_cur_max_func not being found in msvcrt.dll. This will require
a rebuild of gettext to use an older version.

Reference:
- https://docs.microsoft.com/en-us/cpp/c-runtime-library/mb-cur-max-func-mb-cur-max-l-func-p-mb-cur-max-mb-cur-max?view=vs-2019
2019-12-21 12:54:28 -05:00
David Korth
f4b377c1df [minizip] lib/README.md: Forgot to add this in the MiniZip v2.9.1 update. 2019-12-21 12:54:00 -05:00
David Korth
2e472622d0 [minizip] Updated to v2.9.1 from the MiniZip fork.
https://github.com/nmoinvaz/minizip
2019-12-15 17:24:27 -05:00
David Korth
7a2be06de6 [inih] Updated to inih-r47.
Note that this only affects the C++ wrapper, which we aren't using.
2019-12-15 16:41:25 -05:00
David Korth
3bc3cd1bee [PowerVR] PVRTDecompress: Handle PVRTC-II punch-through alpha changes.
PVRTC-II sets the RGB values of punch-through alpha pixels to 0.
PVRTC-I used the upscaled color values.
2019-12-15 03:17:44 -05:00
David Korth
42bf06e82c [PowerVR] PVRTDecompress.cpp: Initial support for PVRTC-II decoding.
Main changes:
- Color A and Color B now share an opaque flag.
- Color B: The low bit of alpha is always 1, not 0.
- Tiles are stored in linear order, not Morton order.

To make it easier to support both formats with minimal changes, the
original PVRTC code has been changed to use templated functions.
Simple non-templated wrapper functions are provided for external use.

PowerVR3, KhronosKTX: Handle PVRTC-II. Note that there's no FourCC
defined for DDS, so we're not updating DirectDrawSurface.

TODO:
- The Hard transition flag isn't supported. PVRTexToolCLI didn't use the
  hard transition flag when creating the test images.

[libromdata/tests] ImageDecoderTest: Added some PVRTC-II test images.
Based on tctest's example.png. Note that the PVRTC-II test images are
the full 512x512, whereas the PVRTC-I test image was 256x256.
2019-12-15 02:43:22 -05:00
David Korth
7086d0ed78 [PowerVR} PVRTDecompress: Swap the Red and Blue channels.
This matches rom-properties' ARGB32 format.

TODO: Verify on big-endian?
2019-12-10 22:01:22 -05:00
David Korth
c25945229e [PowerVR} PVRTDecompress: Removed ETC1 decompression.
We have our own ETC1 decompression code, which might be somewhat faster
than PowerVR's due to use of lookup tables. (Maybe I should benchmark
this later...)
2019-12-10 22:01:22 -05:00
David Korth
e51803a4fe [librptexture] Use the PowerVR Native SDK (well, a subset) to decode PVRTC.
It seems that the R and B channels are backwards, so we'll need to fix
that next. Other than that, both 2bpp and 4bpp decoding seems to work.
(A lot better than my terrible attempt, at least.)

[cmake] options.cmake: Added an option for PVRTC. The code is licensed
under the MIT license, but we might as well provide an option for it
because it's third-party code instead of my own code.

TODO:
- Fix R/B channel ordering.
- PVRTC-II decoding?
- Add PVRTC decoding to KTX and DDS.
2019-12-10 22:01:21 -05:00
David Korth
ad5baef669 [gettext.win32] lib.i386: I copied in the 64-bit DLL by mistake...
This now has the correct 32-bit DLL and supporting libraries.

The __imp_libintl_version symbol is present again.

This fixes a 32-bit Windows build regression from
commit bc41a4e845.
([gettext.win32] Recompiled gettext-0.20.1.)
2019-12-09 01:09:58 -05:00
David Korth
bc41a4e845 [gettext.win32] Recompiled gettext-0.20.1.
Compiled on Ubuntu 19.10 using MinGW-w64 with gcc-9.2.1-9ubuntu1+22~exp1ubuntu2.

The previous build was compiled on Ubuntu 19.04 using MinGW-w64
with gcc-8.3.0.

Some changes:
- The i386 .def file no longer has __imp_libintl_version.
- The .debug files are no longer compressed. I'm not sure how many
  Windows tools support compressed debug files.
2019-12-05 22:52:11 -05:00
David Korth
08e9c1557c [gettext.win32] Added lib.amd64/libgnuintl.dll.a.
This should have been added before, but apparently it wasn't added to
the repository due to the .gitignore rule, and I forgot to specify the
--force option. Oh well.
2019-12-05 21:49:31 -05:00
David Korth
4b4c8715b8 [inih] tests: Committed some files that I missed previously.
These were showing up as untracked in `git status`.
2019-12-02 22:09:11 -05:00
David Korth
91f5cd219e [minizip] mz_os_win32.c: Restored the FSCTL_GET_REPARSE_POINT definition.
This broke the AppVeyor build.
2019-10-25 01:08:22 -04:00
David Korth
aaf9fbf293 [inih] Updated to inih-r46 (+1 commit). 2019-10-25 00:52:07 -04:00
David Korth
1e2d39d479 [extlib] CMakeLists.txt: Set MZ_SIGNING.
New option added by minizip-2.9.0.
2019-10-25 00:31:57 -04:00
David Korth
0747e19e88 [minizip] Updated to v2.9.0 from the MiniZip fork.
https://github.com/nmoinvaz/minizip
2019-10-25 00:29:12 -04:00
David Korth
2e6a37b8e1 [libmspack-xenia] Rebased to libmspack-1.9.1.
Not too many changes. Most of it is casting and `register` keywords.
2019-09-23 00:14:42 -04:00
David Korth
47b4ea79c4 [libjpeg-turbo] Removed the bundled copy of libjpeg-turbo.
It was only used on Windows, and since we're using GDI+ for JPEG decoding
on Windows now, it's not needed.

If a Mac OS X UI frontend is added at some point, I'll probably use the
system JPEG decoder instead of re-adding libjpeg-turbo.
2019-09-21 12:28:58 -04:00
David Korth
e466e6a558 [tinyxml2] Missing ')'. 2019-09-01 15:58:12 -04:00
David Korth
5c0b31d745 [tinyxml2] Updated to tinyxml2-7.1.0. 2019-09-01 14:46:57 -04:00
David Korth
3d4258723e [inih] Updated _MODIFIED_INIH.txt. 2019-08-04 15:28:01 -04:00
David Korth
81f645717b [inih] Updated to inih-r45. 2019-08-04 15:24:02 -04:00
David Korth
45f624e7ac [minizip] mz_os_win32.c: #define FSCTL_GET_REPARSE_POINT if it isn't available.
It's not working properly on AppVeyor, even though we did set
_WIN32_WINNT=0x0600. (Then again, maybe it just needed winioctl.h...)

Removed the _WIN32_WINNT definition, since it's no longer needed.
2019-07-13 15:04:01 -04:00
David Korth
8d168e79eb [minizip] Updated to v2.8.9 from the MiniZip fork.
https://github.com/nmoinvaz/minizip

Added .lgtm.yml, which was present in earlier versions but missed due
to the leading dot.
2019-07-13 13:14:57 -04:00
David Korth
e4f85bbf93 Updated lots of includes using include-what-you-use. (v8.0.0)
[librpbase] TextFuncs.hpp:
- Don't #include "TextFuncs_libc.h". Anything that uses strnlen() or
  memmem() has to include this header file directly.
- Moved RP_WIS16 from config.librpbase.h to TextFuncs.hpp. This wasn't
  actually configured by cmake; it's set on Windows and unsaet on
  everything else.

[libromdata] WiiWAD.cpp: #include "librpbase/config.librpbase.h"
for ENABLE_DECRYPTION.
2019-06-09 13:37:29 -04:00
David Korth
1f73467c5e [extlib] CMakeLists.txt: MiniZip's project name is minizip, not libminizip.
PROJECT_NAME() was removed in commit 9ea341f40c:
[minizip] Updated to v2.8.4 from the MiniZip fork.

...and re-added with `minizip` in commit 9ea341f40c:
[minizip] CMakeLists.txt: Restore target_include_directories() changes.

Since this didn't update the main extlib CMakeLists.txt, this broke the
extlib properties for minizip. In particular, EXCLUDE_FROM_ALL wasn't
being set, so minizip was being built even when it wasn't needed.
2019-06-08 15:09:35 -04:00
David Korth
4fc3de9e36 [gettext.win32] Updated to gettext-0.20.1.
Compiled on Ubuntu 19.04 using MinGW-w64 with gcc-8.3.0.

Some patches were dropped:
- 05-always-use-libintl-vsnprintf.mingw.patch: Doesn't apply cleanly
  and isn't needed.
- 09-asm-underscore-mingw.patch: Merged upstream.

All other patches were applied, though some manual adjustments were
needed for a few patches, including the ctype/unistd include patch,
06-dont-include-ctype-after-gnulibs-wctype.mingw.patch.
2019-05-25 15:08:43 -04:00
David Korth
c2881bff39 [minizip] Fix configuration for FSCTL_GET_REPARSE_POINT and SYMBOLIC_LINK_FLAG_DIRECTORY.
- FSCTL_GET_REPARSE_POINT: _WIN32_WINNT >= 0x0500; #include <winioctl.h>
- SYMBOLIC_LINK_FLAG_DIRECTORY: _WIN32_WINNT >= 0x0600
2019-05-25 15:07:39 -04:00
David Korth
6ad2d84548 [inih] Updated to inih-r44.
The only differences from r43 involve the C++ wrapper, so there's
effectively no changes for rom-properties.
2019-05-25 13:28:58 -04:00
David Korth
150c5f9e11 [minizip] Updated _MODIFIED_MINIZIP.txt for v2.8.8. 2019-05-25 13:27:45 -04:00
David Korth
6a4aa1591c [minizip] Updated to v2.8.8 from the MiniZip fork.
https://github.com/nmoinvaz/minizip
2019-05-25 11:27:40 -04:00
David Korth
9c9498b1b1 [libpng] Updated to libpng-1.6.37. 2019-04-16 23:26:07 -04:00
David Korth
6d3e3e81ed [minizip] Updated to v2.8.6 from the MiniZip fork.
https://github.com/nmoinvaz/minizip
2019-04-13 14:06:37 -04:00
David Korth
354795436a [inih] Updated to inih-r43.
Removed ini_parse_w(), since this should be handled by the caller.

[librpbase] ConfReader.cpp: On Windows, use _wfopen() to open the file
using a Unicode pathname, then use ini_parse_file() to parse the opened
INI file.
2019-04-13 14:02:07 -04:00
David Korth
261e719b1e [minizip] Updated to v2.8.5 from the MiniZip fork.
https://github.com/nmoinvaz/minizip
2019-03-21 23:20:47 -04:00
David Korth
9ea341f40c [minizip] CMakeLists.txt: Restore target_include_directories() changes.
Otherwise, it can't find mz_zip.h.
2019-03-02 19:52:48 -05:00
David Korth
47d0abdc8c [minizip] CMakeLists.txt: Forgot to disable options.
This caused the Windows build to fail due to use of functionality
added in Windows 8 (CERT_FIND_HAS_PRIVATE_KEY) that isn't available
due to the WINVER and _WIN32_WINNT settings.

We don't need encryption enabled for rom-properties, anyway.
2019-03-02 17:10:24 -05:00
David Korth
bba05dc032 [libjpeg-turbo] Updated to libjpeg-turbo-2.0.2. 2019-03-02 04:08:03 -05:00
David Korth
a22f55d883 [minizip] Updated to v2.8.4 from the MiniZip fork.
https://github.com/nmoinvaz/minizip
2019-03-02 04:00:41 -05:00
David Korth
4026d0608a [minizip] Updated to v2.8.3 from the MiniZip fork.
https://github.com/nmoinvaz/minizip

[libromdata/tests] CMakeLists.txt: MiniZip now uses the target name
'minizip' instead of 'libminizip'.

[extlib] CMakeLists.txt: MiniZip's options are now prefixed with "MZ_".
2019-02-03 01:48:43 -05:00
David Korth
333a1e0537 [libmspack-xenia] xenia_lzx.c: Rearrange variable declarations to fix compilation with MSVC 2010.
MSVC 2010 requires all variables to be declared before code when
compiling C code.
2019-02-02 23:57:33 -05:00
David Korth
45c09e6cc2 [libmspack-xenia] lzxd.c: Removed calls to xenia_log().
This function isn't implemented in rom-properties for obvious reasons.
2019-02-02 09:28:50 -05:00
David Korth
58154ffe2c [libmspack-xenia] xenia_lzx.c: Silenced a few -Wunused-parameter warnings.
_MODIFIED_LIBMSPACK.txt: s/compiled/compiler/
2019-02-02 00:40:24 -05:00
David Korth
bab9228cf2 [libmspack-xenia] xenia_lzx.c, xenia_lzx.h: Added Xenia's lzx_decompress() wrapper function.
Partially rewritten so it compiles as C code.

References:
- https://github.com/xenia-project/xenia/blob/master/src/xenia/cpu/lzx.cc
- https://github.com/xenia-project/xenia/blob/master/src/xenia/cpu/lzx.h

debian/copyright: Added copyright notices for these files.
2019-02-01 22:37:26 -05:00