summaryrefslogtreecommitdiff
path: root/tiff/contrib/acorn/convert
diff options
context:
space:
mode:
Diffstat (limited to 'tiff/contrib/acorn/convert')
-rw-r--r--tiff/contrib/acorn/convert175
1 files changed, 175 insertions, 0 deletions
diff --git a/tiff/contrib/acorn/convert b/tiff/contrib/acorn/convert
new file mode 100644
index 0000000..1f64ed2
--- /dev/null
+++ b/tiff/contrib/acorn/convert
@@ -0,0 +1,175 @@
+RISC OS Conversion log
+======================
+
+mkversion.c
+~~~~~~~~~~~
+The RISC OS command-line does not allow the direct creation of the version.h
+file in the proper manner. To remedy this in such a way that the version
+header is made at compiletime, I wrote this small program. It is fully
+portable, so should work quite happily for any other platform that might need
+it.
+
+msg3states.c
+~~~~~~~~~~~~
+Needed getopt.c from the port folder, then compiled and worked fine.
+
+
+tiff.h
+~~~~~~
+
+====1====
+
+The symbol _MIPS_SZLONG, if not defined, causes a compiler error. Fixed by
+ensuring it does exist. This looks to me like this wouldn't be an
+Acorn-specific problem. The new code fragment is as follows:
+
+#ifndef _MIPS_SZLONG
+#define _MIPS_SZLONG 32
+#endif
+#if defined(__alpha) || _MIPS_SZLONG == 64
+
+
+
+tiffcomp.h
+~~~~~~~~~~
+
+====1====
+
+#if !defined(__MWERKS__) && !defined(THINK_C)
+#include <sys/types.h>
+#endif
+
+Acorn also doesn't have this header so:
+
+#if !defined(__MWERKS__) && !defined(THINK_C) && !defined(__acorn)
+#include <sys/types.h>
+#endif
+
+====2====
+
+#ifdef VMS
+#include <file.h>
+#include <unixio.h>
+#else
+#include <fcntl.h>
+#endif
+
+This seems to indicate that fcntl.h is included on all systems except
+VMS. Odd, because I've never heard of it before. Sure it's in the ANSI
+definition? Anyway, following change:
+
+#ifdef VMS
+#include <file.h>
+#include <unixio.h>
+#else
+#ifndef __acorn
+#include <fcntl.h>
+#endif
+#endif
+
+This will probably change when I find out what it wants from fcntl.h!
+
+====3====
+
+#if defined(__MWERKS__) || defined(THINK_C) || defined(applec)
+#include <stdlib.h>
+#define BSDTYPES
+#endif
+
+Added RISC OS to above thus:
+
+#if defined(__MWERKS__) || defined(THINK_C) || defined(applec) || defined(__acorn)
+#include <stdlib.h>
+#define BSDTYPES
+#endif
+
+====4====
+
+/*
+ * The library uses the ANSI C/POSIX SEEK_*
+ * definitions that should be defined in unistd.h
+ * (except on VMS where they are in stdio.h and
+ * there is no unistd.h).
+ */
+#ifndef SEEK_SET
+#if !defined(VMS) && !defined (applec) && !defined(THINK_C) && !defined(__MWERKS__)
+#include <unistd.h>
+#endif
+
+RISC OS is like VMS and Mac in this regard. So changed to:
+
+/*
+ * The library uses the ANSI C/POSIX SEEK_*
+ * definitions that should be defined in unistd.h
+ * (except on VMS or the Mac or RISC OS, where they are in stdio.h and
+ * there is no unistd.h).
+ */
+#ifndef SEEK_SET
+#if !defined(VMS) && !defined (applec) && !defined(THINK_C) && !defined(__MWERKS__) && !defined(__acorn)
+#include <unistd.h>
+#endif
+#endif
+
+====5====
+
+NB: HAVE_IEEEFP is defined in tiffconf.h, not tiffcomp.h as mentioned
+in libtiff.README. (Note written on original port from 3.4beta004)
+
+Acorn C/C++ claims to accord with IEEE 754, so no change (yet) to
+tiffconf.h.
+
+====6====
+
+Unsure about whether this compiler supports inline functions. Will
+leave it on for the time being and see if it works! (Likely if
+everything else does.)
+
+... Seems to be OK ...
+
+====7====
+
+Added to the end:
+
+/*
+ * osfcn.h is part of C++Lib on Acorn C/C++, and as such can't be used
+ * on C alone. For that reason, the relevant functions have been
+ * implemented by myself in tif_acorn.c, and the elements from the header
+ * included here.
+ */
+
+#ifdef __acorn
+#ifdef __cplusplus
+#include <osfcn.h>
+#else
+#include "kernel.h"
+#define O_RDONLY 0
+#define O_WRONLY 1
+#define O_RDWR 2
+#define O_APPEND 8
+#define O_CREAT 0x200
+#define O_TRUNC 0x400
+typedef long off_t;
+extern int open(const char *name, int flags, int mode);
+extern int close(int fd);
+extern int write(int fd, const char *buf, int nbytes);
+extern int read(int fd, char *buf, int nbytes);
+extern off_t lseek(int fd, off_t offset, int whence);
+#endif
+#endif
+
+
+===============================================================================
+
+tif_acorn.c
+~~~~~~~~~~~
+
+Created file tif_acorn.c, copied initially from tif_unix.c
+
+Documented internally where necessary.
+
+Note that I have implemented the low-level file-handling functions normally
+found in osfcn.h in here, and put the header info at the bottom of
+tiffcomp.h. This is further documented from a RISC OS perspective inside the
+file.
+
+===============================================================================