From 1822399aec7646f58b110fb182f880fc7947c14a Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 11 Nov 2003 14:08:32 +0000 Subject: [PATCH] Patched to compile on OS/2. --- makeos2.cmd | 3 ++- platform/os2.c | 9 +++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/makeos2.cmd b/makeos2.cmd index 7532dc8..56e695d 100644 --- a/makeos2.cmd +++ b/makeos2.cmd @@ -7,7 +7,8 @@ rem Patches go to icculus@clutteredmind.org ... set PHYSFSLANG=PHYSFS_LANG_ENGLISH set DEBUGFLAGS=-D_NDEBUG -O2 -s -set CFLAGS=%DEBUGFLAGS% -Wall -Werror -Zomf -Zmt -Zmtd -I. -Izlib114 -c -D__ST_MT_ERRNO__ -DOS2 -DPHYSFS_SUPPORTS_ZIP -DPHYSFS_SUPPORTS_GRP -DPHYSFS_SUPPORTS_QPAK -DPHYSFS_SUPPORTS_HOG -DPHYSFS_SUPPORTS_MVL -DPHYSFS_LANG=%PHYSFSLANG% -DHAVE_ASSERT_H=1 +rem set CFLAGS=%DEBUGFLAGS% -Wall -Werror -Zomf -Zmt -Zmtd -I. -Izlib114 -c -D__ST_MT_ERRNO__ -DOS2 -DPHYSFS_SUPPORTS_ZIP -DPHYSFS_SUPPORTS_GRP -DPHYSFS_SUPPORTS_QPAK -DPHYSFS_SUPPORTS_HOG -DPHYSFS_SUPPORTS_MVL -DPHYSFS_LANG=%PHYSFSLANG% -DHAVE_ASSERT_H +set CFLAGS=%DEBUGFLAGS% -Wall -Werror -Zomf -Zmt -Zmtd -I. -Izlib114 -c -D__ST_MT_ERRNO__ -DOS2 -DPHYSFS_SUPPORTS_ZIP -DPHYSFS_SUPPORTS_GRP -DPHYSFS_SUPPORTS_QPAK -DPHYSFS_SUPPORTS_HOG -DPHYSFS_SUPPORTS_MVL -DHAVE_ASSERT_H @echo on mkdir bin diff --git a/platform/os2.c b/platform/os2.c index 8b3c466..c3a23ba 100644 --- a/platform/os2.c +++ b/platform/os2.c @@ -23,6 +23,7 @@ #define INCL_DOSMISC #include +#include #include #include #include @@ -61,11 +62,11 @@ static const char *get_os2_error_string(APIRET rc) case ERROR_NO_MORE_SEARCH_HANDLES: return(ERR_TOO_MANY_HANDLES); case ERROR_SEEK_ON_DEVICE: return(ERR_SEEK_ERROR); case ERROR_NEGATIVE_SEEK: return(ERR_SEEK_OUT_OF_RANGE); - case ERROR_DEL_CURRENT_DIRECTORY: return(ERR_DEL_CWD); + /*!!! FIXME: Where did this go? case ERROR_DEL_CURRENT_DIRECTORY: return(ERR_DEL_CWD);*/ case ERROR_WRITE_PROTECT: return(ERR_WRITE_PROTECT_ERROR); case ERROR_WRITE_FAULT: return(ERR_WRITE_FAULT); case ERROR_LOCK_VIOLATION: return(ERR_LOCK_VIOLATION); - case ERROR_GEN_FAILURE: return(ERR_GENERAL_FAILURE); + case ERROR_GEN_FAILURE: return(ERR_GEN_FAILURE); case ERROR_UNCERTAIN_MEDIA: return(ERR_UNCERTAIN_MEDIA); case ERROR_PROTECTION_VIOLATION: return(ERR_PROT_VIOLATION); case ERROR_BROKEN_PIPE: return(ERR_BROKEN_PIPE); @@ -98,14 +99,14 @@ static APIRET os2err(APIRET retval) const char *err = get_os2_error_string(retval); if (err == ERR_OS2_GENERIC) { - snprintf(buf, ERR_OS2_GENERIC, (int) retval); + snprintf(buf, sizeof (buf), ERR_OS2_GENERIC, (int) retval); err = buf; } /* if */ if (err != NULL) __PHYSFS_setError(err); - return(err); + return(retval); } /* os2err */