From 4de0b054a58bfee6974afabd831538dcedc23e22 Mon Sep 17 00:00:00 2001 From: Cameron Cawley Date: Thu, 13 Oct 2022 13:38:07 +0100 Subject: [PATCH] Improve portability to RISC OS. --- README | 2 -- old/Makefile.riscos | 2 +- test/example.c | 4 +++- test/minigzip.c | 10 ++++++---- zutil.h | 2 +- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/README b/README index 4391368..75da520 100644 --- a/README +++ b/README @@ -69,8 +69,6 @@ Notes for some targets: - zlib doesn't work on HP-UX 9.05 with some versions of /bin/cc. It works with other compilers. Use "make test" to check your compiler. -- gzdopen is not supported on RISCOS or BEOS. - - For PalmOs, see http://palmzlib.sourceforge.net/ diff --git a/old/Makefile.riscos b/old/Makefile.riscos index 57e29d3..0f503ff 100644 --- a/old/Makefile.riscos +++ b/old/Makefile.riscos @@ -3,7 +3,7 @@ # test works out-of-the-box, installs `somewhere' on demand # Toolflags: -CCflags = -c -depend !Depend -IC: -g -throwback -DRISCOS -fah +CCflags = -c -depend !Depend -IC: -g -throwback -fah C++flags = -c -depend !Depend -IC: -throwback Linkflags = -aif -c++ -o $@ ObjAsmflags = -throwback -NoCache -depend !Depend diff --git a/test/example.c b/test/example.c index c3521dd..e9cb806 100644 --- a/test/example.c +++ b/test/example.c @@ -13,8 +13,10 @@ # include #endif -#if defined(VMS) || defined(RISCOS) +#if defined(VMS) # define TESTFILE "foo-gz" +#elif defined(__riscos) && !defined(__TARGET_UNIXLIB__) +# define TESTFILE "foo/gz" #else # define TESTFILE "foo.gz" #endif diff --git a/test/minigzip.c b/test/minigzip.c index 134e10e..7c9eb79 100644 --- a/test/minigzip.c +++ b/test/minigzip.c @@ -48,10 +48,12 @@ # define unlink delete # define GZ_SUFFIX "-gz" #endif -#ifdef RISCOS -# define unlink remove -# define GZ_SUFFIX "-gz" -# define fileno(file) file->__file +#if defined(__riscos) && !defined(__TARGET_UNIXLIB__) +# define GZ_SUFFIX "/gz" +# ifndef __GNUC__ +# define unlink remove +# define fileno(file) file->__file +# endif #endif #if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os # include /* for fileno */ diff --git a/zutil.h b/zutil.h index 48dd7fe..630bc11 100644 --- a/zutil.h +++ b/zutil.h @@ -141,7 +141,7 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ # define OS_CODE 7 #endif -#ifdef __acorn +#if defined(__acorn) || defined(__riscos) # define OS_CODE 13 #endif