Blame contrib/acorn/convert

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