Commit Graph

516 Commits

Author SHA1 Message Date
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
David Korth
22ef7f5637 [extlib] libmspack-xenia: Imported libmspack code from the Xenia emulator.
This is a stripped-down version of libmspack containing only the necessary
functionality for Xbox 360 executables.

Xenia commit: e706cf0d5413c31b7e80a50411cc88cc7c71af30
License: LGPLv2.1

config.h.in: Modified for cmake; removed unnecessary checks.

debian/copyright: Added copyright information.
cmake/options.cmake: Added an ENABLE_LIBMSPACK option. (default is ON)
2019-02-01 22:17:56 -05:00
David Korth
1f3a95efaa [minizip] Updated to v2.8.2 from the MiniZip fork.
https://github.com/nmoinvaz/minizip
2019-01-20 23:38:21 -05:00
David Korth
72202b6ef0 [libpng] CMakeLists.txt: Disable INSTALL(EXPORT).
This broke the AppVeyor build.
2019-01-12 20:56:40 -05:00
David Korth
b86919a466 [libpng] Updated to libpng-1.6.36. 2019-01-12 14:15:39 -05:00
David Korth
114cb78a1e [googletest] Removed test suites, scripts, and Xcode projects in order to reduce warnings on LGTM. 2018-12-30 16:38:18 -05:00
David Korth
829895dfb3 [tinyxml2] Updated to tinyxml2-7.0.1.
FIXME: Building tinyxml2 as a static library fails on my system:
/usr/bin/objcopy: illegal pathname found in archive member: /home/david/p/m/lib/../extlib/tinyxml2/CMakeFiles/tinyxml2.dir/tinyxml2.cpp.o

This seems to be a binutils security fix for CVE-2014-9447.
Unfortunately, cmake ends up using the full pathname in the static
library, which has a '..' because of the custom lib path.
2018-12-15 11:13:14 -05:00
David Korth
4d0b3a3c83 [libjpeg-turbo] Removed documentation.
It was causing LGTM to think that we have JavaScript code.
2018-12-15 10:55:38 -05:00
David Korth
0ad862932c [minizip] Updated to v2.8.0 from the MiniZip fork.
https://github.com/nmoinvaz/minizip
2018-12-15 10:55:16 -05:00
David Korth
267146266e [extlib, gtk] Use CPU_i386 and CPU_amd64 from platform.cmake. 2018-12-01 14:00:27 -05:00
David Korth
8ca252171b [minizip] Updated to v2.8.0 from the MiniZip fork.
https://github.com/nmoinvaz/minizip

[extlib] CMakeLists.txt: Define more options to ensure they have the
correct settings, since the option() statements in MiniZip's
CMakeLists.txt have been disabled.
2018-11-30 21:28:30 -05:00
David Korth
de24fd4ca9 [libjpeg-turbo] release/: These files shouldn't be marked as executable. 2018-11-18 01:08:26 -05:00
David Korth
1458529bd7 [libjpeg-turbo] Updated to libjpeg-turbo-2.0.1. 2018-11-18 01:08:09 -05:00
David Korth
1f3db35ddb [minizip] .gitignore: CMakeLists.txt generates zip.h and unzip.h for compatibility with older MiniZip.
Ignore these files so they don't get checked in accidentally.
2018-11-12 00:54:04 -05:00
David Korth
784d688a01 [minizip] Updated to v2.6.0 from the MiniZip fork.
https://github.com/nmoinvaz/minizip
2018-11-12 00:01:47 -05:00
David Korth
243bea473f [minizip] Updated to v2.6.0 from the MiniZip fork.
https://github.com/nmoinvaz/minizip
2018-10-14 15:50:09 -04:00
David Korth
2b1ce8b3f2 [unice68] Check for fileno() and _fileno().
It's still not finding it on MSVC 2010, but we might as well
check for it anyway.
2018-10-06 12:54:20 -04:00
David Korth
ded8ecea19 [unice68] Fixed MSVC build errors.
- `inline` isn't defined in C mode in MSVC 2010 and 2013.
  (It might be in 2015 and 2017?)

- main() must be `__cdecl`, but we're defaulting to `__stdcall`
  in 32-bit builds.

- myfileno(): Added a missing semicolon.
2018-10-06 12:51:08 -04:00
David Korth
b58a3b4d3e Merge branch 'feature/Audio-SNDH'
No metadata properties yet, but it's good enough for now.
2018-10-06 12:07:21 -04:00
David Korth
da90a646cd [unice68] CMakeLists.txt: Specify "-fpic -fPIC" for shared library compatibility.
This broke the travis-ci build:

/usr/bin/ld: ../../../lib/../extlib/unice68/CMakeFiles/unice68_lib.dir/unice68_unpack.c.o:
	relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
../../../lib/libunice68.a: error adding symbols: Bad value

I didn't see this locally because I was only building rpcli when testing
the SNDH unice68 functionality.
2018-10-06 12:00:32 -04:00
David Korth
997ee7ff87 [unice68] CMakeLists.txt: Write config files *after* checking includes and functions.
Otherwise, basename() won't be detected properly on the first pass.
2018-10-06 11:56:14 -04:00
David Korth
be1feb628f [googletest] Build as a DLL on Windows.
This significantly reduces the size of the test executables.

This can be done more easily on Windows than on other platforms because
Windows includes the program's directory as part of the DLL search path
by default.

NOTE: I was originally trying to fix a linkage issue with
g_linked_ptr_mutex that was showing up when building on MSVC 2010,
but that seems to have disappeared by itself...

References for the linkage issue:
- https://github.com/google/googletest/issues/292
- https://github.com/ornladios/ADIOS2/pull/477
- d9657bda86
2018-09-30 18:15:55 -04:00
David Korth
784ef57097 [googletest] Updated to v1.8.1. 2018-09-30 17:52:15 -04:00
David Korth
0237650c67 [minizip] .travis.yml doesn't need to be renamed.
travis-ci only checks the top-level .travis.yml file.
2018-09-30 17:41:58 -04:00
David Korth
0cf1b54bb0 [libjpeg-turbo] SIMD: Fix c000001d exception on Win 7 w/o SP1
Apparently Windows 7 without SP1 has O/S support for XSAVE but not for
YMM registers, and this exposed a bug in our usage of xgetbv.  The test
instruction will set ZF only if none of the bits match between the two
operarands, so in effect, we were enabling AVX2 instructions if the O/S
supported XSAVE and the CPU supported AVX2 but the O/S only supported
XMM registers.  This bug was not exposed on, for instance, Windows XP or
RHEL 5 because those O/S's do not support XSAVE.

Upstream commit:
d5f281b734
2018-09-30 17:35:12 -04:00
David Korth
2ae0815ab7 [minizip] Updated to v2.5.4 from the MiniZip fork.
https://github.com/nmoinvaz/minizip
2018-09-30 17:31:32 -04:00
David Korth
bb3b816448 [unice68] Fixed signed/unsigned comparison and fall-through warnings.
The fall-through is intentional, so fall-through comments were added.
2018-09-29 15:05:38 -04:00
David Korth
e827229667 [unice68] Renamed config.h to config.unice68.h; added HAVE_CONFIG_H to unice68_exe.
This fixes the build of unice68.

The unice68 executable can now be built in tree for testing purposes,
but it isn't built or installed as part of the normal build.
2018-09-29 15:01:05 -04:00
David Korth
a7bb4e5151 [unice68] Disable -Wempty-body and -Wshift-negative-value.
unice68_pack.c generates a lot of these warnings, and there doesn't
seem to be a straightforward fix.
2018-09-29 11:15:14 -04:00
David Korth
2d2c64f817 [extlib] unice68: Initial import of unice68-2.0.0.690.
This will be used to decompress Atari ST SNDH files.

Note that unice68 is GPLv3, so there's a compile-time option to
disable it.

TODO: Make it a DLL/SO instead and use dlopen().
2018-09-29 11:01:57 -04:00
David Korth
c2772eaf8f [minizip] mz_compat.h: Fix extern "C" {.
This was apparently broken in upstream commit 3eaa5560bfeda53a295651cca8e623493971ecd2.
(Added back ZEXPORT. Coeur/ZipArchive#444)
2018-09-08 22:08:23 -04:00
David Korth
dd85809cd8 [minizip] Updated to v2.5.2 (plus some additional patches) from the MiniZip fork.
https://github.com/nmoinvaz/minizip
2018-09-08 22:03:34 -04:00
David Korth
fbb1d58f2d extlib, tests: Marked target link libraries as PUBLIC and/or PRIVATE.
Tests are all executables, so none of the libraries need to be PUBLIC.

External libraries should not be exporting their dependencies if they
aren't needed.
2018-08-26 20:58:23 -04:00
David Korth
d8e9ba8641 [minizip] Updated to v2.5.1 from the MiniZip fork.
https://github.com/nmoinvaz/minizip

Removed the test files, since we don't need them here.
2018-08-25 11:43:01 -04:00
David Korth
576a2a135d [extlib] minizip: Added test/empty.txt to the repository. 2018-08-10 09:43:28 -04:00
David Korth
36fafbca18 [minizip] Updated to v2.4.0 from the MiniZip fork.
https://github.com/nmoinvaz/minizip
2018-08-10 09:25:51 -04:00
David Korth
6c50ecca39 [libjpeg-turbo] Added JPEGCALL to various functions in TurboJPEG files.
We're not using these, but they should still have JPEGCALL anyway.
2018-07-28 19:30:37 -04:00
David Korth
74d6f02ca1 [libjpeg-turbo] turbojpeg.h: #define JPEGCALL if it hasn't been defined already.
jmorecfg.h: Don't #define JPEGCALL if it has already been defined.
2018-07-28 19:20:06 -04:00
David Korth
45f61ca698 [libjpeg-turbo] Updated to libjpeg-turbo-2.0.0.
Major changes include AVX2 optimizations and a vastly improved
CMakeLists.txt that works on all platforms.

This includes the JPEGCALL changes required for /Gz on 32-bit MSVC.

libjpeg-turbo.rc: Moved from sharedlib/ to win/.
2018-07-28 19:05:39 -04:00
David Korth
ef4d518004 [libjpeg-turbo] Removed the executable bit from non-executable files. 2018-07-28 16:42:54 -04:00
David Korth
9f2d13fec1 [minizip] Updated to v2.3.9 (plus some patches) from the MiniZip fork.
https://github.com/nmoinvaz/minizip
2018-07-28 16:06:43 -04:00
David Korth
b8c52ea528 [libpng] Updated to libpng-1.6.35. 2018-07-23 15:15:20 -04:00
David Korth
7b17bd8a10 [extlib] CMakeLists.txt: Set EXCLUDE_FROM_ALL (extlib properties) for libminizip.
It's not needed if tests are disabled.
2018-07-23 14:54:37 -04:00
David Korth
76ccd13bb6 [minizip] Updated to v2.3.8 (plus some patches) from the MiniZip fork.
https://github.com/nmoinvaz/minizip

[extlib] CMakeLists.txt: Disabled MiniZip compression. We're currently
only using it for decompression, so there's no need to build the
compression code, which wastes time and disk space.
2018-07-23 14:51:36 -04:00
David Korth
369873ada4 [libromdata/tests] GcnFstTest: Fix issues caused by the minizip-2.3.2 update.
- #include "config.librpbase.h" in order to define HAVE_ZLIB, which tells
  mz_compat.h to #include <zlib.h>.
- #include <zlib.h> manually anyway.
- unz_file_info64.uncompressed_size is uint64_t, not uLong.
2018-06-02 12:28:07 -04:00
David Korth
38385ba897 [minizip] CMakeLists.txt: Disable optimizations in debug builds. 2018-06-02 12:27:48 -04:00
David Korth
f324e7b0b4 [minizip] Updated to v2.3.2 from the MiniZip fork.
https://github.com/nmoinvaz/minizip
2018-06-02 12:19:59 -04:00
David Korth
4027d6e370 Enabled delay-load for libgnuintl-8.dll.
libintl.h: Disabled libgnuintl wrappers for printf() functions.
We don't need to use the GNU versions for anything, and it causes problems
if libgnuintl-8.dll is unavailable, since we can't use printf() to print
an error message in that case.
- Redefine snprintf() as _snprintf() on older versions of MSVC.
  See c99-compat.msvcrt.h.

DelayLoadHelper.cmake: Delay-load libgnuintl-8.dll.

DelayLoadHelper.h: Added a 1-argument macro.

[win32] DllMain.cpp, DllGetClassObject() Fail if libgnuintl-8.dll can't
be loaded.

[rpcli] rpcli.cpp: Print an error message if libgnuintl-8.dll can't be
loaded.
- TODO: Print the program information.

[win32] ConfigDialog.cpp: Show an error message if libgnuintl-8.dll
can't be loaded.
- TODO: Move this to rp-config.c? Doing that will result in no error
  message if rundll32.exe is used, though...

This should be the last thing needed for issue #122:
[win32] Build and link in GNU gettext or equivalent
2018-05-17 22:48:03 -04:00
David Korth
d720bcdd0c [inih] Updated to inih-r42. 2018-05-17 22:22:52 -04:00
David Korth
583fc3a1cf [minizip] Updated to v2.3.1 from the MiniZip fork.
https://github.com/nmoinvaz/minizip
2018-05-11 23:13:52 -04:00
David Korth
57ca83fab7 [minizip] Updated to v2.3.0 from the MiniZip fork.
https://github.com/nmoinvaz/minizip
2018-05-05 16:14:20 -04:00
David Korth
7afea5cb73 Merge branch 'feature/gettext-win32'
Now with localization on Windows.
2018-05-02 22:45:48 -04:00
David Korth
16621dfffc [extlib] CMakeLists.txt: Build a static library for TinyXML2 on Mac OS X for now.
This will fix some of the unit tests that aren't running because they
can't find libtinyxml2.6.dylib.

FIXME: #include <fstream> is still causing fseeko()/ftello() issues in
bmp.cpp, but not rpcli.cpp or properties.cpp...
2018-05-02 01:58:51 -04:00
David Korth
f2e30e60a2 [tinyxml2] CMakeLists.txt: Fix ending block for WIN32 AND INSTALL_DEBUG. 2018-05-02 01:02:17 -04:00
David Korth
38ec96d4b0 [tinyxml2] Disable installation on non-Windows platforms.
We're building TinyXML2 as a static library on non-Windows platforms.

TODO: Build as a shared library on Mac OS X and install in the bundle?
2018-05-02 00:59:44 -04:00
David Korth
5e98aed6c7 [gettext.win32] Added support for Unicode paths on Windows.
loadmsgcat.c: Convert the filename from UTF-8 to UTF-16, then use
_wopen() to open the file.

[libi18n] i18n.c: Convert the filename to UTF-8 instead of ANSI.

gettext now works on Windows if non-ANSI characters are present in
rom-properties' path.
2018-04-29 16:15:15 -04:00
David Korth
314a8b7f81 Initial build of gettext for Win32.
The gettext libraries and executables were built on Ubuntu 18.04 using
MinGW-w64 with gcc-7.3.0.

iconv support has been disabled for the runtime, but it's still needed
for some of the build executables. For that, we're using win-iconv, which
is an iconv wrapper that uses the Windows API. [1]

In addition, several patches from the official MinGW package repository
were applied to gettext-0.19.8.1 in order to get it to build correctly
for Windows. [2]

TODO:
- Test packaging to ensure the correct DLL is packaged.
- Test bindtextdomain() to determine if it supports Unicode. If it
  doesn't, then another patch will be needed.

[1] https://github.com/win-iconv/win-iconv
[2] https://github.com/Alexpux/MINGW-packages/tree/master/mingw-w64-gettext
2018-04-29 13:32:20 -04:00
David Korth
62afa471c4 [libjpeg-turbo] simd/CMakeLists.txt: Fixed the $ENV{ProgramW6432} variable.
This fixes NASM detection on Win64 if 64-bit NASM is installed and
hasn't been added to PATH.

This should fix issue #79. (cmake can't find NASM on Win 10)
2018-04-29 12:28:46 -04:00
David Korth
9bac615d8e [minizip] Updated _MODIFIED_MINIZIP.txt. 2018-04-29 11:58:00 -04:00
David Korth
8bc01d6033 [minizip] CMakeLists.txt: Remove "/src" from TARGET_INCLUDE_DIRECTORIES().
This fixes a regression from commit e95756aaba.
([minizip] Updated to v2.2.9 from the MiniZip fork.)
2018-04-22 14:28:35 -04:00
David Korth
e95756aaba [minizip] Updated to v2.2.9 from the MiniZip fork.
https://github.com/nmoinvaz/minizip

Note that this release removes the AES-NI code, though we weren't
enabling encryption in the first place.

There's also some changes to use add_compile_options() and the
POSITION_INDEPENDENT_CODE property instead of manually setting
CMAKE_C_FLAGS and "-fpic -fPIC".

TODO: Use POSITION_INDEPENDENT_CODE in other libraries?
2018-04-21 13:56:44 -04:00
David Korth
3a37df04ce [tinyxml2] Updated to tinyxml2-6.2.0. 2018-04-14 14:01:14 -04:00
David Korth
7163ec1dc4 [libpng] _MODIFIED_LIBPNG.txt: 1.6.34, not 1.6.32. 2018-04-14 13:44:10 -04:00
David Korth
e10b592fd6 [extlib] Added Windows resource scripts to libjpeg-turbo and tinyxml2.
Based on zlib's resource script.

Using the default MSVC manifest, which sets isolation-awareness,
execution level asInvoker, and no UI access.
2018-04-04 00:13:34 -04:00
David Korth
de2efe2ba8 [tinyxml2] Updated to tinyxml2-6.0.0.
gcc7 fall-through comments were added upstream in 6.0.0, so it's
no longer listed in _MODIFIED_TINYXML2.txt.
2018-04-03 23:55:42 -04:00
David Korth
952769421e [inih] Updated to inih r41.
This adds INI_START_COMMENT_PREFIXES to allow changing start-of-line
comment characters. It also adds dynamic line buffer reallocation,
though it's disabled in rom-properties.
2018-03-30 09:31:58 -04:00
David Korth
0d973a8b94 [minizip] Updated to v2.2.8 from the MiniZip fork.
https://github.com/nmoinvaz/minizip
2018-03-18 16:42:33 -04:00
David Korth
fc1754054c [libjpeg-turbo] Fixed some JPEGCALL issues in 1.5.3.
This broke the 32-bit Windows build.
2018-03-04 12:39:43 -05:00
David Korth
a733259152 [libjpeg-turbo] _MODIFIED_LIBJPEG-TURBO.txt: Updated the version number. 2018-03-04 12:26:12 -05:00
David Korth
a172d9ca01 [libjpeg-turbo] Updated to libjpeg-turbo-1.5.3. 2018-03-04 12:25:34 -05:00
David Korth
1c1842e662 [minizip] Updated to v2.2.7+ from the MiniZip fork.
https://github.com/nmoinvaz/minizip

NOTE: The changes include removing the 16-bit size limitation, which only
really applies when building for DOS, but it was incorrectly set for all
platforms. I'm not going to change anything that uses it right now, though.
2018-03-04 10:44:45 -05:00
David Korth
c3fd222c1e [minizip] Updated to v2.2.4+ from the MiniZip fork.
https://github.com/nmoinvaz/minizip
2017-12-09 22:23:30 -05:00
David Korth
a8aaed8182 [minizip] mz_strm_split.c: snprintf() isn't defined before MSVC 2015.
_snprintf() is available, so use that instead.
2017-11-26 13:45:30 -05:00
David Korth
af9711f709 [minizip] CMakeLists.txt: Fix the libbsd check.
MiniZip already checks for libbsd, but doesn't fail if it's not found.
Added a failure if it's not found, and removed the broken FIND_PACKAGE()
call, which doesn't work because there's no CMake module for it.
2017-11-12 12:04:44 -05:00
David Korth
21ed4ba5c9 [minizip] libbsd is required for <bsd/stdlib.h>.
Updated .travis.yml, debian/control, and doc/COMPILING.md to require
libbsd-dev as a build dependency.
2017-11-12 11:58:25 -05:00
David Korth
b4d0346264 [minizip] Updated to v2.2.3+ from the MiniZip fork.
https://github.com/nmoinvaz/minizip

An additional fix for unzOpen() hasn't been merged yet:
https://github.com/nmoinvaz/minizip/pull/207

Note that MiniZip 2.x uses UTF-8 for filenames on all platforms,
including Windows. I'm keeping the fill_win32_filefunc64W() call
in place just in case, though.

Bzip2, LZMA, ZipCrypto, and AES support are all disabled for now,
but the sources are still included.
2017-11-12 11:35:59 -05:00
David Korth
8b9b214f51 [libpng] Updated to libpng-1.6.34. 2017-10-29 19:19:06 -04:00
David Korth
e2f45db263 [minizip] Updated to upstream commit d507f2e7e8b771a76f4eb96d5c5d4dee50988196.
5083bef59f

Merge pull request #124 from Coeur/patch-3
2017-09-16 12:34:10 -04:00
David Korth
2e96ec05b0 [inih] ini.h: Use __cdecl in function pointers on 32-bit MSVC builds.
This fixes a Run-Time Check Failure #0 on 32-bit builds with /Gz.

[librpbase] ConfReader: Use `INIHCALL` for the inih callbacks.
2017-09-02 13:09:18 -04:00
David Korth
d070af5148 [libjpeg-turbo] Use JPEGCALL to ensure use of cdecl in MSVC builds.
I'm going to try using stdcall to build the 32-bit version, which should
save a bit of space and improve performance slightly. However, in order
to preserve ABI compatibility, exported C functions must have __cdecl,
and libjpeg-turbo doesn't do this.

JPEGCALL expands to __cdecl on MSVC and nothing on other compilers.
JPEGCALL has been added to function declarations and function pointers
in order to fix compilation with /Gz on MSVC.
2017-09-02 11:55:31 -04:00
David Korth
775835d309 [libpng] Updated to libpng-1.6.32.
The eXIf functions added in 1.6.31 were broken, so two new functions
were added and the old ones stubbed. This shifts the ordinals for APNG
over by two again.
2017-09-02 11:46:27 -04:00
David Korth
3376deb2c5 [libjpeg-turbo] Updated to libjpeg-turbo-1.5.2.
Allow `yasm` to be used if `nasm` can't be found.
TODO: Add default paths for `yasm` on Windows.
2017-09-02 09:08:40 -04:00
David Korth
8293b727dd [extlib] TODO: Set TinyXML2::tinyxml2 and use it in libromdata? 2017-08-12 18:06:54 -04:00
David Korth
4649813f34 [libjpeg-turbo] simd/CMakeLists.txt: Replace backslashes with slashes in paths.
CMake uses slashes, but these variables have backslashes.

This may fix issue #79. (cmake can't find NASM on Win 10)
2017-08-06 12:43:14 -04:00
David Korth
5f46020b9f Merge branch 'feature/rp-config.AboutTab.kde' 2017-08-05 06:40:04 -04:00
David Korth
938bdb15cc [tinyxml2] CMakeLists.txt: Compile as PIC on Unix/Linux systems.
This is needed becuase tinyxml2 is linked into a shared library.

This bug was reported by @DankRank in #retro.
2017-08-05 06:17:01 -04:00
David Korth
8767e15e6c [libpng] .gitattributes: Set EOL for *.dfa.
This fixes issue #95. (libpng: pnglibconf.dfa needs to be LF line endings.)
2017-08-05 03:57:42 -04:00
David Korth
adc4f78991 [minizip] Added files new to this version of MiniZip that I forgot to add during the upgrade. 2017-08-04 22:32:38 -04:00
David Korth
e786162617 [minizip] unzip.c: Removed an extra ';' that caused compile errors on MSVC 2010.
MSVC didn't properly support C99 until MSVC 2015, so the extra ';' makes
MSVC think that we've started adding statements. Hence, it fails because
there are still some variable declarations after it.
2017-08-04 22:32:38 -04:00
David Korth
1fcfd9baa8 [minizip] Updated to an unofficial fork: https://github.com/nmoinvaz/minizip
Commit: d507f2e7e8b771a76f4eb96d5c5d4dee50988196
Merge pull request #124 from Coeur/patch-3

The original MiniZip hasn't been updated in quite a while. This fork has
a lot of new functionality, including support for AES (though we aren't
using it). It also has some of the stuff I manually added before,
including CMakeLists.txt and Windows fixes.

FIXME: It's not compiling on MSVC 2010, probably due to declaring
variables after statements.
2017-08-04 22:32:38 -04:00
David Korth
e5d0759f1c [libpng] scripts/makefile.linux-opt: Forgot to add this file to the repository. 2017-07-28 00:35:29 -04:00
David Korth
00988f0a3c [libpng] Updated to libpng-1.6.31.
Note that two new functions were added to the original libpng, so the
ordinals for APNG were shifted over by two. This shouldn't be a problem,
since programs should be accessing functions by name instead of by
ordinal in 2017.
2017-07-28 00:20:18 -04:00
David Korth
a6902185af [libpng] CMakeLists.txt: Fix CMAKE_HOST_WIN32 stuff. 2017-07-15 20:00:40 -04:00
David Korth
36b53e5111 [libpng] Updated to libpng-1.6.30. 2017-07-04 13:26:25 -04:00
David Korth
6be9ef6c32 [tinyxml2] Updated to tinyxml2-5.0.1.
Gentoo's xmltest.cpp patch was implemented upstream in 5.0.0, so it's
no longer listed in _MODIFIED_TINYXML2.txt.
2017-06-28 01:03:31 -04:00
David Korth
553f38afda [tinyxml2] Updated to tinyxml2-5.0.0.
Among other things, this update adds in reporting of the location oc
parsing errors, which was present in the original TinyXML but not
earlier versions of TinyXML2.
2017-06-26 01:12:50 -04:00
David Korth
a09a65c372 [inih] Updated to inih r40.
This adds a new function ini_parse_string(), which parses an INI file
from a loaded C string buffer.

Local changes, including ini_parse_w(), have been preserved.
2017-06-10 22:11:54 -04:00
David Korth
66918e42d9 [zlib] Don't compile zlib (DLL) on Linux, or zlibstatic on Windows.
Only compile what's needed.
2017-05-19 00:27:23 -04:00
David Korth
2792b9990f [minizip] CMakeLists: Link to ${ZLIB_LIBRARY} on Windows, not zlibstatic.
This didn't seem to actually cause any problems, but it could result in
the statically-linked zlib being used in test suites in addition to the
DLL zlib.
2017-05-19 00:21:00 -04:00
David Korth
51ffc94a13 [extlib] CMakeLists.txt: Make sure tinyxml2_static is built correctly when it's needed. 2017-05-14 14:01:04 -04:00
David Korth
7f84c707b9 [tinyxml2] CMakeLists.txt: Enable DLL builds.
Rebased CMakeLists.txt on the original TinyXML2 CMakeLists.txt,
but with lots of stuff disabled and some changes.

- Disable installation of everything except the DLL.
- Disable testing.
- Set TINYXML2_IMPORT as an interface definition when building
  as a DLL.
- Remove TINYXML2_EXPORT in the static library build, which didn't
  work anyway due to a typo.
- Added a debug postfix for debug DLLs.
- Disabled MSVC configuration that's alread yset in the platform
  configuration.
- Added other MSVC options, including split debug settings.
2017-05-14 13:35:02 -04:00