Commit Graph

479 Commits

Author SHA1 Message Date
Ryan C. Gordon ee9687bca9 Reworked enumeration to be more powerful.
Now callbacks can stop further enumeration and report errors, if they had a
catastrophic issue or just found what they needed and don't need to process
any more items.

Also, the actual enumerators can report errors instead of silently dropping
items. This led to several other fixes as all these implementations got
audited and reworked.

The original, non-callback enumerator now returns NULL if it can't produce a
complete list instead of dropping items and returning a partial list.
2017-08-12 02:19:22 -04:00
Ryan C. Gordon b082bc3432 Removed __PHYSFS_stricmpASCII functions.
Nothing was using them, except one OS/2 thing that could live with stricmp.
2017-08-11 01:45:29 -04:00
Ryan C. Gordon 78c1a985ec Made physfs_lzmasdk.h's include-once blockers match other files' formatting. 2017-08-11 01:29:38 -04:00
Ryan C. Gordon d1f2637ca8 utf8: big improvements to case-insensitive UTF-8 string compare.
- Dramatically reduce RAM usage: uses between 8 and 11 kilobytes less static
memory for its internal case-folding tables.
- Actually works now. It would fail unconditionally if a codepoint folded
into multiple codepoints, even if the compared string contained those exact
codepoints.
- Now a public API!
- Removed __PHYSFS_utf8strnicmp(): nothing was using it, it was incorrect
anyhow, and what does 'n' represent when either string might case-fold to
something larger in-flight, anyhow?
2017-08-11 01:39:22 -04:00
Ryan C. Gordon 587ec88a0d FIXME removal: this code is fine, I guess. 2017-08-10 12:31:41 -04:00
Ryan C. Gordon 1efdb62a8f haiku: CD-ROM detection should report any mounted volume on a B_CD device.
Most discs only use the "raw" device, but it turns out the Haiku installation
"anyboot" images don't, and those would fail to detect here. If there's
some multi-partition disc thing and the OS mounted each separately, we should
report each of them.
2017-08-10 12:31:06 -04:00
Ryan C. Gordon 0e778b0b16 FIXME removal: it's okay for the PHYSFS_Io to be NULL here.
We use this technique in several other places, too.
2017-08-08 15:27:32 -04:00
Ryan C. Gordon 961c0604dc apple: Patched to compile on XCode versions < 7. 2017-08-08 11:57:44 -04:00
Ryan C. Gordon c52be25d1e windows: minor cleanup. 2017-08-08 03:37:09 -04:00
Ryan C. Gordon 982411ec8a apple: Start using some Cocoa APIs, clean up a few related things. 2017-08-08 03:36:56 -04:00
Ryan C. Gordon 0a730433ae Rename physfs_platform_macos.c to physfs_platform_apple.m
It's not really "macOS," it's all of Apple's platforms (iOS, watchOS,
tvOS...AppleCarOS? heh), and second...we're about to need access to Cocoa
APIs, so we need it to be Objective-C. I fought as long as I could.  :/
2017-08-08 02:34:25 -04:00
Ryan C. Gordon eb46d82500 Fixed compiler warnings on GCC. 2017-08-06 15:59:46 -04:00
Ryan C. Gordon af555317b9 Fixed compiler warnings on Visual Studio. 2017-08-06 15:58:39 -04:00
Ryan C. Gordon f0eb5c0db9 Marked a bunch of things as "FIXME-3.0" that I want resolved before 3.0 ships. 2017-08-06 15:54:44 -04:00
Ryan C. Gordon 0287160f3c Removed some FIXMEs that aren't valid. 2017-08-06 13:56:45 -04:00
Ryan C. Gordon 1d6c519c5e windows: Patched to compile! (...?) 2017-08-06 12:27:18 -04:00
Ryan C. Gordon 2176364a16 windows: (maybe) patched to compile on Visual Studio. 2017-08-06 12:19:33 -04:00
Ryan C. Gordon 36c51d40d1 PHYSFS_File buffering now uses size_t.
This lets you have the full address space but not take up unnecessary space
on 32-bit platforms...not to mention removes a bunch of typecasting.
2017-08-06 10:33:21 -04:00
Ryan C. Gordon 114bfd1b21 windows: PHYSFS_FILETYPE_OTHER files now report real filesize in PHYSFS_stat().
I don't know if it's _meaningful_, but if the OS reports it, so do we.
2017-08-06 09:25:05 -04:00
Ryan C. Gordon a7ce178eec Add basic atomic operations for refcounting, etc. 2017-08-06 09:21:38 -04:00
Ryan C. Gordon 61bdee4d78 __PHYSFS_platformDeinit() should return void.
What are you going to do if this fails, anyhow?
2017-08-06 01:30:58 -04:00
Ryan C. Gordon 248167af40 windows: Removed (what I think is) a copy/paste error. 2017-08-05 01:26:07 -04:00
Ryan C. Gordon be9bf023d0 windows: Use a real synchronization primitive for CD detection thread init.
Before we were waiting on a volatile int in a tight loop with a Sleep(50).
2017-08-05 01:24:53 -04:00
Ryan C. Gordon befc894b1f More FIXME cleanups. 2017-08-04 22:35:49 -04:00
Ryan C. Gordon b6e139fc22 Make compile-time asserts more readable. 2017-08-04 22:32:57 -04:00
Ryan C. Gordon 0d249cae36 FIXME removal: This is an appropriate error code already. 2017-08-04 22:32:34 -04:00
Ryan C. Gordon cc2c29b207 Removed FIXME: this was already fixed at some point. 2017-08-04 22:31:56 -04:00
Ryan C. Gordon 093dcb555b os/2: Patched to compile (?). 2017-08-02 16:40:07 -04:00
Ryan C. Gordon 3f9ffddc83 os/2: attempt to get cpuid support on OpenWatcom builds. 2017-08-02 16:34:02 -04:00
Ryan C. Gordon 1e850d32ea windows: Patched to compile. 2017-08-02 13:06:56 -04:00
Ryan C. Gordon 007c2fc037 windows: Just pass HANDLEs around instead of wrapping in a struct.
We don't need the "readonly" field of this struct, because it was only used
to protect flushes on non-writable handles, but PHYSFS_flush() also keeps
track of what's read-only and won't call into the platform layer anyhow.

HANDLEs are typedef'd to be "void *" on Windows, so this is safe (so long as
we check for INVALID_HANDLE_VALUE, which is ((void*)-1), when creating new
handles.
2017-08-02 13:02:43 -04:00
Ryan C. Gordon bea510def0 windows: Fixed logic bug. 2017-08-02 12:48:40 -04:00
Ryan C. Gordon 02c2c4736e windows: better test for WinRT vs win32 (...I think...?) 2017-08-02 12:48:31 -04:00
Ryan C. Gordon 5ab8df339d Updated Unicode case folding support to something 10 years newer. :) 2017-07-31 16:32:47 -04:00
Ryan C. Gordon 32930ef41d Fixed compiler warning. 2017-07-26 16:08:32 -04:00
Ryan C. Gordon 0e7f3ee6a1 Added an assert for a FIXME that is now handled elsewhere. 2017-07-25 19:55:58 -04:00
Ryan C. Gordon 1e2650b6fc Serious cleanup and update of Windows RT support.
This compiles for WinRT, but isn't otherwise tested at all yet.
2017-07-24 03:29:33 -04:00
Ryan C. Gordon c74f4cb007 Minor cleanup. 2017-07-24 02:37:22 -04:00
Ryan C. Gordon a5461ddcd9 Some minor preprocessor nitpicks. 2017-07-24 02:36:58 -04:00
Ryan C. Gordon 8c13bd27d6 unix: getmntinfo() should proabably be set to MNT_NOWAIT to avoid blocking. 2017-07-22 20:05:17 -04:00
Ryan C. Gordon bc28fb74b4 Minor QNX fix; don't warn about CD-ROM support (for now). 2017-07-22 20:04:38 -04:00
Ryan C. Gordon e2750bff62 Apple refers to "Mac OS X" as "macOS" now. 2017-07-22 13:50:40 -04:00
Ryan C. Gordon 6d91dde273 Rename __PHYSFS_Archiver_SZIP to __PHYSFS_Archiver_7Z. 2017-07-22 13:50:03 -04:00
Ryan C. Gordon 1fa4be6f66 Minor documentation updates. 2017-07-22 13:48:31 -04:00
Ryan C. Gordon db349bd067 Update filename comments. 2017-07-22 13:19:57 -04:00
Ryan C. Gordon 18c89c1cbc Renamed all the sources to start with "physfs_"
So now you can drop this into your program and not worry about filename
conflicts, or where "platform_unix.c" came from in the debugger, etc.

Also renamed the "beos" sources to "haiku" and "macosx" to "macos" to match
modern platform names.
2017-07-22 12:59:06 -04:00
Ryan C. Gordon ace324cdc8 Minor code cleanups: whitespace fixes, 80-column overflows, wrong comments. 2017-07-22 12:47:32 -04:00
Ryan C. Gordon c1defd3ec4 vdf: Migrated to new, improved unpacked archiver infrastructure. 2017-07-22 12:42:34 -04:00
Ryan C. Gordon eefc757398 Added some TODOs to the ISO9660 code. 2017-07-22 12:16:37 -04:00
Ryan C. Gordon 8ee7f5d351 Fixed compiler warnings. 2017-07-21 22:38:50 -04:00
Ryan C. Gordon a7616f3960 Removed unused variable. 2017-07-21 22:35:30 -04:00
Ryan C. Gordon 03097332ca unpacked: let archivers specify create and modified times, hook up to iso9660. 2017-07-21 22:01:51 -04:00
Ryan C. Gordon 3c9351c0ad unpacked: let archivers "abandon" the archive instead of closing it.
This lets you preserve the PHYSFS_Io in case of error during archive opening.
2017-07-21 19:01:41 -04:00
Ryan C. Gordon 91a19982ca iso9660: rewritten and simplified.
This now builds on top of the "unpacked" archiver and reads only the
structures it needs, serializing the parts it cares about. Lots of other
cleanups.

Lost a little bit of functionality, to be restored later.
2017-07-21 13:56:21 -04:00
Ryan C. Gordon 2dd3d7c28a unpacked: Don't list a position or length for directory entries. 2017-07-21 13:55:03 -04:00
Ryan C. Gordon d3ac612b61 DirTrees and unpacked archives shouldn't demand a count of entries for init. 2017-07-21 13:54:42 -04:00
Ryan C. Gordon 32ed71db48 slb: be more aggressive about rejecting non-SLB files. 2017-07-20 17:00:21 -04:00
Ryan C. Gordon 7e30657f54 Attempt to fix compilation against the latest Windows SDK. 2017-07-18 09:59:23 -04:00
Ryan C. Gordon adb7ea4dfc It's not messy to compile NOW. :) 2017-07-17 16:39:15 -04:00
Ryan C. Gordon 28f32ad240 Removed C++ single-line comments from LZMA SDK. 2017-07-17 16:25:17 -04:00
Ryan C. Gordon 823061758b Disable unaligned reads in LZMA SDK; it upsets GCC's strict-aliasing rules. 2017-07-17 16:22:29 -04:00
Ryan C. Gordon 0bda50c276 More unused LZMA SDK code. 2017-07-17 15:50:04 -04:00
Ryan C. Gordon 1d616dcaf1 Fixed compiler warning. 2017-07-17 15:43:39 -04:00
Ryan C. Gordon 4557dbf0f7 Another LZMA SDK trim. 2017-07-17 14:57:02 -04:00
Ryan C. Gordon 7ab5cc52ce Fixed 64-bit ints in LZMA SDK on Watcom C. 2017-07-17 14:56:52 -04:00
Ryan C. Gordon f6c830968c Workaround strict-aliasing warnings on some versions of GCC. 2017-07-17 14:46:36 -04:00
Ryan C. Gordon 3765efb652 Still more LZMA SDK trimming. 2017-07-17 14:43:36 -04:00
Ryan C. Gordon a28a01c124 Patched to compile on Visual Studio. 2017-07-17 14:37:02 -04:00
Ryan C. Gordon 8553113870 Patched to compile on OpenWatcom. 2017-07-17 14:35:47 -04:00
Ryan C. Gordon 7fed370cfd Chopped more unused pieces out of the LZMA SDK. 2017-07-17 14:35:36 -04:00
Ryan C. Gordon 43f8ffcd2d Chopped out some unused code from the LZMA SDK. 2017-07-17 14:27:51 -04:00
Ryan C. Gordon afacf0395e Static analysis fix. 2017-07-17 14:19:29 -04:00
Ryan C. Gordon d38c10dea7 Removed unused variables. 2017-07-17 12:42:09 -04:00
Ryan C. Gordon f83e36a8be Static analysis fix (maybe?). 2017-07-17 12:41:28 -04:00
Ryan C. Gordon c375504463 Removed unused variable. 2017-07-17 12:39:43 -04:00
Ryan C. Gordon 8c3501491c Whoops, forgot to add the file. :) 2017-07-17 12:35:35 -04:00
Ryan C. Gordon da1561a09f Removed ancient LZMA SDK. 2017-07-17 12:20:14 -04:00
Ryan C. Gordon a5d3dd498e Rewrote the 7zip archiver.
This also updates the LZMA SDK to something more modern, which is now public
domain code, and squashed it into a single header for easier building.
2017-07-17 12:26:50 -04:00
Ryan C. Gordon 63de092cb7 zip: fail with correct error code if opening a directory. 2017-07-17 12:21:26 -04:00
Ryan C. Gordon e84277a1df Corrected reported value for unknown PHYSFS_stat() access times. 2017-07-17 12:21:02 -04:00
Ryan C. Gordon 62ad133862 Reworked the "unpacked" archivers to use DirTree.
This cleaned up a lot of code and improved things, and also allowed a lot of
the restrictions on unpacked archivers to be removed.
2017-07-16 04:39:14 -04:00
Ryan C. Gordon ffa1836335 Moved ZIP tree management up to a higher level, to be reused elsewhere. 2017-07-15 15:59:55 -04:00
Ryan C. Gordon 56bddb0b78 Fixed some comments. 2017-07-16 04:35:46 -04:00
Ryan C. Gordon 5afd9754e2 Reenable QPAK support by default. 2017-07-16 04:34:52 -04:00
Ryan C. Gordon 9cec66be3e Removed SWIG ifdefs in physfs.h 2017-07-16 04:36:40 -04:00
Ryan C. Gordon 53225ca62c Fixed more Visual Studio compiler warnings. 2017-07-13 00:21:25 -04:00
Ryan C. Gordon 1bacc6d6af Fixed some compiler warnings with Visual Studio. 2017-07-13 00:16:24 -04:00
Ryan C. Gordon bf9999af2d Fixed compiler warnings on Visual Studio about const qualifiers. 2017-07-12 23:54:45 -04:00
Ryan C. Gordon efd71e08f6 Move headers around to get those MSVC anti-portability nags to go away. 2017-07-12 20:55:58 -04:00
Ryan C. Gordon a681fe258d unix: OS-specific paths should also chop filename off base path. 2017-07-12 20:52:51 -04:00
Ryan C. Gordon 187d04ae9e Debian/kFreeBSD should use the FreeBSD-specific codepaths, not generic Unix. 2017-07-12 20:49:53 -04:00
Ryan C. Gordon 19b15d34a1 Cleaned up what symbols are exported from the library. 2017-07-12 15:41:12 -04:00
Ryan C. Gordon 2cb1f73737 Cygwin has mntent.h, and no need to check for CMake tests now. 2017-07-12 02:41:28 -04:00
Ryan C. Gordon 4b2180dd17 unix: Don't #error if no CD-ROM support, because we already give a #warning. 2017-07-12 02:33:15 -04:00
Ryan C. Gordon 68ad1fa8c5 Removed BeOS support (Haiku still supported, though!).
Since Haiku has pthread support, dropped the BLocker code and use the pthread
code from platform_posix.c instead.
2017-07-12 00:16:57 -04:00
Ryan C. Gordon c2c1c7ac30 Removed __PHYSFS_platformSetDefaultAllocator(); nothing uses it now.
We can pull it back from revision control if something needs it later.
2017-07-11 23:52:13 -04:00
Ryan C. Gordon 0be0e3fd33 mac: Removed Carbon header include and custom allocator (just use malloc). 2017-07-11 23:47:48 -04:00
Ryan C. Gordon 73070339a4 Simplify CMakeLists.txt, etc.
Try to test things with preprocessor macros instead of CMake, and get rid of
silly options like turning off thread safety.
2017-07-11 23:32:46 -04:00
Ryan C. Gordon fe55814681 vdf: make private functions static. 2017-07-11 23:25:20 -04:00
Ryan C. Gordon 4015689068 Patched to compile on BeOS/Haiku. 2017-07-09 20:50:48 -04:00
Ryan C. Gordon 53c81e216a Checking if this #pragma pack works better on gcc 2.95. 2017-07-09 20:46:31 -04:00
Ryan C. Gordon 2dbd784cc1 Fixed some DOS newlines. 2017-07-09 20:45:34 -04:00
Ryan C. Gordon 3324ec88a9 Maybe fix compiler warnings on Cygwin. 2017-07-09 18:21:54 -04:00
Ryan C. Gordon f5c6383b4b Patched to compile on Visual Studio. 2017-07-09 18:17:33 -04:00
Ryan C. Gordon cf11d2ec99 Workaround snprintf() deficiencies on Visual Studio. 2017-07-09 17:46:53 -04:00
Ryan C. Gordon c057f2d7dd Fixed compiler warnings on FreeBSD. 2017-07-09 17:31:27 -04:00
Ryan C. Gordon 083940aef1 Don't try to build CD-ROM support on Emscripten. 2017-07-09 17:28:33 -04:00
Ryan C. Gordon f8ed5c6f7e Replaced sprintf() calls with snprintf(). 2017-07-09 17:06:37 -04:00
Ryan C. Gordon e4c035a99f Pacify compiler warning. 2017-07-09 17:02:13 -04:00
Ryan C. Gordon bae1f440ba Patched to compile on Windows. 2017-07-09 15:03:12 -04:00
Ryan C. Gordon 84231feb0f windows: (re)added support for symbolic links. 2017-07-09 15:01:17 -04:00
Ryan C. Gordon 59a07020a8 Turn on all the archivers by default.
(Except for the lzma archiver, since it needs a bunch of external code.)

The difference in binary size, for Linux/amd64 compiled for size (-Os),
is 4 kilobytes. It's senseless to not just compile them all in.
2017-07-08 18:25:20 -04:00
Ryan C. Gordon 4cbffd39e8 OS/2: actually working again, now. 2017-07-07 13:55:52 -04:00
Ryan C. Gordon 683216def8 OS/2: more work on getting this to compile. 2017-07-07 13:06:44 -04:00
Ryan C. Gordon 9a19eba065 Patched to compile with C89 compilers. 2017-07-07 09:21:06 -04:00
Ryan C. Gordon 2bd8c33fe5 OS/2: implemented Unicode support, modernized platform_os2.c's code.
(untested.)
Implemented Unicode support, ripped out old APIs that aren't used any more,
corrected some things.
2017-07-06 21:34:24 -04:00
Ryan C. Gordon 32da097a55 Cleanup BAIL_* and GOTO_* macros to be less cluttered.
This also fixes really aggressive compiler warnings about the "if (!ERRPASS)"
construct producing unreachable code.
2017-07-06 11:51:41 -04:00
Ryan C. Gordon 9aebcff5ba OS/2: base dir needs to end with a path separator. 2017-07-06 00:47:36 -04:00
Ryan C. Gordon 34009cf762 Fix some endlines. 2017-07-06 00:04:10 -04:00
Ryan C. Gordon d1e40af4e3 OS/2: fix up the base/user/pref dir code.
There might be better ways to do this in modern times than shove it all into
the base dir, though.
2017-07-06 00:03:49 -04:00
Ryan C. Gordon 062bdc2c5b Patched to compile with OpenWatcom. 2017-07-05 23:49:10 -04:00
Ryan C. Gordon 9ca88e3794 Patched platform_os2.c to compile. 2017-07-05 23:48:21 -04:00
Ryan C. Gordon 58bca6ae05 Watcom C should include malloc.h to make the alloca macro available. 2017-07-05 21:30:39 -04:00
Ryan C. Gordon 15c18b0c04 os2: added OS/2 support back in.
With the release of ArcaOS, this is a live platform again.

This code probably doesn't compile yet; I've just given it a first shot at
resolving the changes between the last OS/2-supported revision and now.

This still needs Unicode support added in any case.
2017-07-05 21:29:37 -04:00
Francesco Bertolaccini 4b80422a79 vdf: Remove unused chunks of code, fix endianness. 2017-07-03 14:47:25 -04:00
Francesco Bertolaccini dc5958ec71 Remove unused variable. 2017-07-03 14:41:08 -04:00
Ryan C. Gordon 656a9b92c0 Changed some URLs from http:// to https://, where supported. 2017-06-20 14:06:13 -04:00
Francesco Bertolaccini e4206408e5 Add support for VDF 2017-06-20 13:22:41 -04:00
Ryan C. Gordon 2777b5efe2 Added a mostly-harmless FIXME. 2016-09-12 15:39:35 -04:00
Ryan C. Gordon 66b7767cec Added support for password-protected .zip files.
To use: mount a .zip file as usual, open a file as usual, but append '$' plus
the password to the end of the path, like so:

    PHYSFS_File *f = PHYSFS_openRead("/path/to/my/file.txt$MyPassword");

Note that this is the "traditional" PKWARE crypto, like you might get from
PkZip 2.04g or Info-ZIP. They have more advanced cryptography in the modern
.zip spec, but that's not implemented here. If you've ever tried to unzip
an archive and were prompted for a password, you probably saw the traditional
crypto at work.

Note that this is NOT a secure thing: if you ship an app that contains a
password, someone with a debugger can retrieve it. Note also that this
password could be available to any code registered as a PHYSFS_Archiver, and
that due to how archives combine into a single file tree, the wrong archiver
can get the password, at a minimum causing it to fail because passwords don't
match.

In short: make sure you know what you're doing before you use this!
2016-09-12 15:38:30 -04:00
Ryan C. Gordon ab7eb81a4a Platform deinit should happen last, since other deinit bits might depend on it. 2016-09-07 21:21:59 -04:00
Ryan C. Gordon dfd658ff92 Fixed miniz code that triggers recent GCCs' -Wmisleading-indentation. 2016-08-26 18:46:11 -04:00
Ryan C. Gordon 8363d15439 Fixed some documentation typos (thanks, Paul!). 2016-08-17 17:19:50 -04:00
Ryan C. Gordon b66b2d4563 Replace unsigned long cast with cast to size_t (thanks, David!).
When targeting MinGW-w64's x86_64 target, unsigned long is 4 bytes but void* is
8 bytes. This mismatch triggers the pointer-to-int-cast warning.

(This patch was originally David Yip's work, with uintptr_t instead of size_t).
2016-08-16 14:46:53 -04:00
David Yip 51f0807cb3 Remove unused functions and variables in platform_windows.
Under gcc 5.3.0, the presence of these functions and variables generate unused
function / unused variable warnings, which in combination with -Werror causes
a compile error.
2016-08-15 05:41:36 -05:00
David Yip 9293c3dc8d Remove unused variable in zip_hash_ancestors.
Under gcc 5.4.0, this generates unused variable warnings, which in combination
with -Werror causes a compile error.
2016-08-15 00:50:58 -05:00
Ryan C. Gordon c3cc732a70 Updated byte order tests to match what SDL does now.
That is: you're more likely to be on Linux or a little-endian machine,
so deal with the non-Linux bigendian as the exceptional case.
2016-02-25 02:55:11 -05:00
Ryan C. Gordon 32d4f4541e HTTPS all the things. 2016-02-25 02:51:28 -05:00
Ryan C. Gordon b479c57bcb zip: Reworked how we organize ZIP entries.
We now use a hashtable for lookups of specific paths, and organize the
entries into a directory tree. The end result is fast lookup and fast
enumeration without having to search a sorted array or tapdance with
substrings...which means the rare, mysterious bug where we failed
to find an existing file should be gone now, too.
2016-02-25 02:20:52 -05:00
Ryan C. Gordon acd00dda94 Fixed a comment. 2016-02-25 01:16:42 -05:00
Ryan C. Gordon e608c5c3de Move __PHYSFS_strdup() declaration up with other string helpers. 2016-02-25 00:40:17 -05:00
Ryan C. Gordon 0278c30776 zip: Don't allocate a 256k buffer on the stack for zip64 parsing. 2016-02-24 11:15:00 -05:00
Ryan C. Gordon ce85702893 Added a minor comment. 2016-02-24 11:14:10 -05:00
Ryan C. Gordon 57bbcc3eb3 Fixed compiler warning about unused variable because assert() is awful. 2015-07-02 23:36:33 -04:00
Ryan C. Gordon 1ab2afda15 Removed a few tabstops to test something on the Mercurial server. 2015-06-18 00:12:15 -04:00
Ryan C. Gordon fb31167e11 Fixed incorrect logic ("!x != 5" instead of "x != 5").
Thanks to Xian Nox for pointing this out!
2015-06-16 10:46:56 -04:00
Ryan C. Gordon 6cafcc4bc7 Added some FIXMEs. 2015-04-19 23:28:14 -04:00
Ryan C. Gordon 3d38708088 dos2unix'd platform_winrt.cpp 2015-04-19 23:26:02 -04:00
Ryan C. Gordon e13803c101 Removed some tabs and an extra semicolon. 2015-04-19 23:25:29 -04:00
Martin Ahrnbom 9d55f3f099 Added support for WinRT 8.1 Universal Apps.
Hopefully this will work on Win10 as well... Only time will tell!
Here's what's changed:
1. Added a platform_winrt.cpp file. It's based on platform_windows.c but has some WinRT-specific changes.
2. Changed physfs_platforms.h to define PHYSFS_PLATFORM_WINRT when running on WinRT. PHYSFS_PLATFORM_WINDOWS should also be defined, as WinRT behaves a lot like "normal" Windows and this flag is tested against in multiple parts of the PhysFS source code.
3. Changed platform_windows.c to not be used when PHYSFS_PLATFORM_WINRT is defined.
4. In order to work on Windows ARM devices, I had to change in physfs_internal.h, to include _M_ARM as a flag for running on ARM as "ARM" and "__arm__" aren't defined when running on a Windows ARM device.

What I've tested:
* Setting up a "sane folder configuration"
* Reading and writing files
* Mounting zip files
* Using seek & tell
* Checking file length

All of these work fine. I couldn't get the actual test software to run on WinRT, but it seems like eveyrthing's working. I've tested these things on my Windows 8.1 computer, as well as my Lumia 920 which is currently running Windows 8.1.
2015-03-29 07:03:30 +02:00