]> git.saurik.com Git - wxWidgets.git/blame - src/tiff/contrib/acorn/convert
xti changes
[wxWidgets.git] / src / tiff / contrib / acorn / convert
CommitLineData
8414a40c
VZ
1RISC OS Conversion log
2======================
3
4mkversion.c
5~~~~~~~~~~~
6The RISC OS command-line does not allow the direct creation of the version.h
7file in the proper manner. To remedy this in such a way that the version
8header is made at compiletime, I wrote this small program. It is fully
9portable, so should work quite happily for any other platform that might need
10it.
11
12msg3states.c
13~~~~~~~~~~~~
14Needed getopt.c from the port folder, then compiled and worked fine.
15
16
17tiff.h
18~~~~~~
19
20====1====
21
22The symbol _MIPS_SZLONG, if not defined, causes a compiler error. Fixed by
23ensuring it does exist. This looks to me like this wouldn't be an
24Acorn-specific problem. The new code fragment is as follows:
25
26#ifndef _MIPS_SZLONG
27#define _MIPS_SZLONG 32
28#endif
29#if defined(__alpha) || _MIPS_SZLONG == 64
30
31
32
33tiffcomp.h
34~~~~~~~~~~
35
36====1====
37
38#if !defined(__MWERKS__) && !defined(THINK_C)
39#include <sys/types.h>
40#endif
41
42Acorn also doesn't have this header so:
43
44#if !defined(__MWERKS__) && !defined(THINK_C) && !defined(__acorn)
45#include <sys/types.h>
46#endif
47
48====2====
49
50#ifdef VMS
51#include <file.h>
52#include <unixio.h>
53#else
54#include <fcntl.h>
55#endif
56
57This seems to indicate that fcntl.h is included on all systems except
58VMS. Odd, because I've never heard of it before. Sure it's in the ANSI
59definition? Anyway, following change:
60
61#ifdef VMS
62#include <file.h>
63#include <unixio.h>
64#else
65#ifndef __acorn
66#include <fcntl.h>
67#endif
68#endif
69
70This will probably change when I find out what it wants from fcntl.h!
71
72====3====
73
74#if defined(__MWERKS__) || defined(THINK_C) || defined(applec)
75#include <stdlib.h>
76#define BSDTYPES
77#endif
78
79Added RISC OS to above thus:
80
81#if defined(__MWERKS__) || defined(THINK_C) || defined(applec) || defined(__acorn)
82#include <stdlib.h>
83#define BSDTYPES
84#endif
85
86====4====
87
88/*
89 * The library uses the ANSI C/POSIX SEEK_*
90 * definitions that should be defined in unistd.h
91 * (except on VMS where they are in stdio.h and
92 * there is no unistd.h).
93 */
94#ifndef SEEK_SET
95#if !defined(VMS) && !defined (applec) && !defined(THINK_C) && !defined(__MWERKS__)
96#include <unistd.h>
97#endif
98
99RISC OS is like VMS and Mac in this regard. So changed to:
100
101/*
102 * The library uses the ANSI C/POSIX SEEK_*
103 * definitions that should be defined in unistd.h
104 * (except on VMS or the Mac or RISC OS, where they are in stdio.h and
105 * there is no unistd.h).
106 */
107#ifndef SEEK_SET
108#if !defined(VMS) && !defined (applec) && !defined(THINK_C) && !defined(__MWERKS__) && !defined(__acorn)
109#include <unistd.h>
110#endif
111#endif
112
113====5====
114
115NB: HAVE_IEEEFP is defined in tiffconf.h, not tiffcomp.h as mentioned
116in libtiff.README. (Note written on original port from 3.4beta004)
117
118Acorn C/C++ claims to accord with IEEE 754, so no change (yet) to
119tiffconf.h.
120
121====6====
122
123Unsure about whether this compiler supports inline functions. Will
124leave it on for the time being and see if it works! (Likely if
125everything else does.)
126
127... Seems to be OK ...
128
129====7====
130
131Added to the end:
132
133/*
134 * osfcn.h is part of C++Lib on Acorn C/C++, and as such can't be used
135 * on C alone. For that reason, the relevant functions have been
136 * implemented by myself in tif_acorn.c, and the elements from the header
137 * included here.
138 */
139
140#ifdef __acorn
141#ifdef __cplusplus
142#include <osfcn.h>
143#else
144#include "kernel.h"
145#define O_RDONLY 0
146#define O_WRONLY 1
147#define O_RDWR 2
148#define O_APPEND 8
149#define O_CREAT 0x200
150#define O_TRUNC 0x400
151typedef long off_t;
152extern int open(const char *name, int flags, int mode);
153extern int close(int fd);
154extern int write(int fd, const char *buf, int nbytes);
155extern int read(int fd, char *buf, int nbytes);
156extern off_t lseek(int fd, off_t offset, int whence);
157#endif
158#endif
159
160
161===============================================================================
162
163tif_acorn.c
164~~~~~~~~~~~
165
166Created file tif_acorn.c, copied initially from tif_unix.c
167
168Documented internally where necessary.
169
170Note that I have implemented the low-level file-handling functions normally
171found in osfcn.h in here, and put the header info at the bottom of
172tiffcomp.h. This is further documented from a RISC OS perspective inside the
173file.
174
175===============================================================================