Skip to content

Commit

Permalink
os2: added OS/2 support back in.
Browse files Browse the repository at this point in the history
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 15c18b0
Show file tree
Hide file tree
Showing 6 changed files with 686 additions and 9 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Expand Up @@ -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()
Expand Down
2 changes: 2 additions & 0 deletions docs/TODO.txt
Expand Up @@ -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.

Expand Down
12 changes: 7 additions & 5 deletions src/physfs.h
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/physfs_internal.h
Expand Up @@ -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 '/'
Expand Down
4 changes: 2 additions & 2 deletions src/physfs_platforms.h
Expand Up @@ -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>
Expand Down

0 comments on commit 15c18b0

Please sign in to comment.