File tree 2 files changed +86
-56
lines changed
2 files changed +86
-56
lines changed Original file line number Diff line number Diff line change 81
81
#if (__ppc__ == 1 ) || (__POWERPC__ == 1 ) || (_ARCH_PPC == 1 )
82
82
#include <stdint.h>
83
83
#include <CoreFoundation/CFByteOrder.h>
84
- #endif
84
+ #endif
85
85
86
86
#define PKEXPORT
87
87
#define __SYS_ZLIB
96
96
97
97
#endif
98
98
99
+ #if !defined(PLATFORM_DEFINED ) && defined(__HAIKU__ )
100
+
101
+ #include <sys/types.h>
102
+ #include <sys/stat.h>
103
+ #include <sys/mman.h>
104
+ #include <fcntl.h>
105
+ #include <unistd.h>
106
+ #include <stdint.h>
107
+ #include <stdlib.h>
108
+ #include <stdio.h>
109
+ #include <stdarg.h>
110
+ #include <string.h>
111
+ #include <ctype.h>
112
+ #include <assert.h>
113
+ #include <errno.h>
114
+
115
+ #ifndef __BIG_ENDIAN__
116
+ #define PLATFORM_LITTLE_ENDIAN
117
+ #endif
118
+
119
+ #define PLATFORM_HAIKU
120
+ #define PLATFORM_DEFINED // The platform is known now
121
+
122
+ #endif
123
+
99
124
//-----------------------------------------------------------------------------
100
125
// Assumption: we are not on Windows nor Macintosh, so this must be linux *grin*
101
126
165
190
#ifndef _countof
166
191
#define _countof (x ) (sizeof(x) / sizeof(x[0]))
167
192
#endif
168
-
169
- #define WINAPI
193
+
194
+ #define WINAPI
170
195
171
196
#define FILE_BEGIN SEEK_SET
172
197
#define FILE_CURRENT SEEK_CUR
193
218
#endif // !PLATFORM_WINDOWS
194
219
195
220
// 64-bit calls are supplied by "normal" calls on Mac
196
- #if defined(PLATFORM_MAC )
221
+ #if defined(PLATFORM_MAC ) || defined( PLATFORM_HAIKU )
197
222
#define stat64 stat
198
223
#define fstat64 fstat
199
224
#define lseek64 lseek
200
225
#define ftruncate64 ftruncate
201
226
#define off64_t off_t
202
227
#define O_LARGEFILE 0
203
228
#endif
204
-
229
+
205
230
// Platform-specific error codes for UNIX-based platforms
206
- #if defined(PLATFORM_MAC ) || defined(PLATFORM_LINUX )
231
+ #if defined(PLATFORM_MAC ) || defined(PLATFORM_LINUX ) || defined( PLATFORM_HAIKU )
207
232
#define ERROR_SUCCESS 0
208
233
#define ERROR_FILE_NOT_FOUND ENOENT
209
234
#define ERROR_ACCESS_DENIED EPERM
You can’t perform that action at this time.
0 commit comments