Skip to content
Permalink
Browse files
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.
  • Loading branch information
icculus committed Jul 6, 2017
1 parent 4b80422 commit 15c18b0c04a80be9dee250876d78ccacee0baab4
Showing with 686 additions and 9 deletions.
  1. +1 −1 CMakeLists.txt
  2. +2 −0 docs/TODO.txt
  3. +7 −5 src/physfs.h
  4. +1 −1 src/physfs_internal.h
  5. +2 −2 src/physfs_platforms.h
  6. +673 −0 src/platform_os2.c
@@ -185,7 +185,7 @@ if(UNIX)
endif()
endif()

if(WINDOWS)
if(WINDOWS OR OS2)
set(PHYSFS_HAVE_CDROM_SUPPORT TRUE)
set(PHYSFS_HAVE_THREAD_SUPPORT TRUE)
endif()
@@ -74,6 +74,8 @@ Other stuff I thought of...
- Reduce the BAIL and GOTO macro use. A lot of these don't add anything.
- Modernize CMakeLists.txt
- Change the term "search path" to something less confusing.
- OS/2 codepages. No full Unicode in the filesystem, but we can probably make
a conversion effort.

Probably other stuff. Requests and recommendations are welcome.

@@ -187,11 +187,11 @@
* PhysicsFS offers basic encoding conversion support, but not a whole string
* library. Get your stuff into whatever format you can work with.
*
* All platforms supported by PhysicsFS 2.1 and later fully support Unicode.
* We have dropped platforms that don't (OS/2, Mac OS 9, Windows 95, etc), as
* even an OS that's over a decade old should be expected to handle this well.
* If you absolutely must support one of these platforms, you should use an
* older release of PhysicsFS.
* Most platforms supported by PhysicsFS 2.1 and later fully support Unicode.
* Some older platforms have been dropped (Windows 95, Mac OS 9). Some, like
* OS/2, might be able to convert to a local codepage or will just fail to
* open/create the file. Modern OSes (macOS, Linux, Windows, etc) should all
* be fine.
*
* Many game-specific archivers are seriously unprepared for Unicode (the
* Descent HOG/MVL and Build Engine GRP archivers, for example, only offer a
@@ -251,6 +251,8 @@ extern "C" {
/* do nothing. */
#elif defined(__WIN32__) && !defined(__GNUC__)
#define PHYSFS_CALL __cdecl
#elif defined(__OS2__) || defined(OS2) /* should work across all compilers. */
#define PHYSFS_CALL _System
#else
#define PHYSFS_CALL
#endif
@@ -330,7 +330,7 @@ int UNPK_stat(void *opaque, const char *fn, PHYSFS_Stat *st);
* Obviously, this isn't a function. If you need more than one char for this,
* you'll need to pull some old pieces of PhysicsFS out of revision control.
*/
#if PHYSFS_PLATFORM_WINDOWS
#if PHYSFS_PLATFORM_WINDOWS || PHYSFS_PLATFORM_OS2
#define __PHYSFS_platformDirSeparator '\\'
#else
#define __PHYSFS_platformDirSeparator '/'
@@ -27,8 +27,8 @@
# define PHYSFS_PLATFORM_WINDOWS 1
#elif (((defined _WIN32) || (defined _WIN64)) && (!defined __CYGWIN__))
# define PHYSFS_PLATFORM_WINDOWS 1
#elif (defined OS2)
# error OS/2 support was dropped from PhysicsFS 2.1. Sorry.
#elif defined(__OS2__) || defined(OS2)
# define PHYSFS_PLATFORM_OS2 1
#elif ((defined __MACH__) && (defined __APPLE__))
/* To check if iphone or not, we need to include this file */
# include <TargetConditionals.h>

0 comments on commit 15c18b0

Please sign in to comment.