summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/OFApplication.m11
-rw-r--r--src/OFDate.m1
-rw-r--r--src/OFLocalization.m3
-rw-r--r--src/OFNumber.m1
-rw-r--r--src/OFObject.m2
-rw-r--r--src/OFString.h3
-rw-r--r--src/OFString.m5
-rw-r--r--src/OFTarArchiveEntry.m5
-rw-r--r--src/OFThread.m3
-rw-r--r--src/OFZIPArchiveEntry.m4
-rw-r--r--src/exceptions/OFBindFailedException.m2
-rw-r--r--src/exceptions/OFConnectionFailedException.m2
-rw-r--r--src/objfw-defs.h.in28
-rw-r--r--src/platform.h3
-rw-r--r--src/resolver.m4
-rw-r--r--src/runtime/ObjFW_RT.h2
-rw-r--r--src/runtime/private.h4
17 files changed, 65 insertions, 18 deletions
diff --git a/src/OFApplication.m b/src/OFApplication.m
index 0b951a1d..645ddfb0 100644
--- a/src/OFApplication.m
+++ b/src/OFApplication.m
@@ -36,7 +36,7 @@
#import "OFThread.h"
#import "OFThread+Private.h"
#import "OFSandbox.h"
-#ifdef OF_MORPHOS
+#ifdef OF_AMIGAOS
# import "OFFile.h"
# import "OFFileManager.h"
#endif
@@ -52,7 +52,10 @@
extern int _CRT_glob;
extern void __wgetmainargs(int *, wchar_t ***, wchar_t ***, int, int *);
-#elif defined(OF_MORPHOS)
+#elif defined(OF_AMIGAOS)
+# ifdef OF_AMIGAOS3
+# define INTUITION_CLASSES_H
+# endif
# include <proto/exec.h>
# include <proto/dos.h>
#elif !defined(OF_IOS)
@@ -179,6 +182,8 @@ of_application_main(int *argc, char **argv[],
{
#ifndef OF_PSP
exit(status);
+
+ OF_UNREACHABLE
#else
sceKernelExitGame();
@@ -249,7 +254,7 @@ of_application_main(int *argc, char **argv[],
}
FreeEnvironmentStringsW(env0);
-#elif defined(OF_MORPHOS)
+#elif defined(OF_AMIGAOS)
void *pool = objc_autoreleasePoolPush();
OFFileManager *fileManager = [OFFileManager defaultManager];
OFArray *envContents =
diff --git a/src/OFDate.m b/src/OFDate.m
index af364f95..ef271d97 100644
--- a/src/OFDate.m
+++ b/src/OFDate.m
@@ -17,7 +17,6 @@
#include "config.h"
-#include <inttypes.h>
#include <limits.h>
#include <time.h>
#include <math.h>
diff --git a/src/OFLocalization.m b/src/OFLocalization.m
index c4e28a58..7f493960 100644
--- a/src/OFLocalization.m
+++ b/src/OFLocalization.m
@@ -35,6 +35,9 @@
# define __NOGLOBALIFACE__
# define __USE_INLINE__
# endif
+# ifdef OF_AMIGAOS3
+# define INTUITION_CLASSES_H
+# endif
# include <proto/dos.h>
# include <proto/exec.h>
# include <proto/locale.h>
diff --git a/src/OFNumber.m b/src/OFNumber.m
index 30eed689..dd6ce45e 100644
--- a/src/OFNumber.m
+++ b/src/OFNumber.m
@@ -17,7 +17,6 @@
#include "config.h"
-#include <inttypes.h>
#include <math.h>
#import "OFNumber.h"
diff --git a/src/OFObject.m b/src/OFObject.m
index d27716dc..2533ed45 100644
--- a/src/OFObject.m
+++ b/src/OFObject.m
@@ -155,6 +155,8 @@ of_method_not_found(id obj, SEL sel)
* never return.
*/
abort();
+
+ OF_UNREACHABLE
}
void OF_NO_RETURN_FUNC
diff --git a/src/OFString.h b/src/OFString.h
index f7411d7f..c17877e3 100644
--- a/src/OFString.h
+++ b/src/OFString.h
@@ -30,6 +30,9 @@
#include <stdarg.h>
#include <stdint.h>
+#ifdef OF_HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
#import "OFObject.h"
#import "OFSerialization.h"
diff --git a/src/OFString.m b/src/OFString.m
index b79ee6a5..4ee8d5cc 100644
--- a/src/OFString.m
+++ b/src/OFString.m
@@ -69,6 +69,11 @@
# define strtod __strtod
#endif
+#ifdef OF_AMIGAOS3
+/* libnix has strtod, but not strtof */
+# define strtof strtod
+#endif
+
static struct {
Class isa;
} placeholder;
diff --git a/src/OFTarArchiveEntry.m b/src/OFTarArchiveEntry.m
index e17048e2..4b7c8738 100644
--- a/src/OFTarArchiveEntry.m
+++ b/src/OFTarArchiveEntry.m
@@ -17,12 +17,11 @@
#include "config.h"
-#include <inttypes.h>
-
#import "OFTarArchiveEntry.h"
#import "OFTarArchiveEntry+Private.h"
-#import "OFStream.h"
#import "OFDate.h"
+#import "OFStream.h"
+#import "OFString.h"
#import "OFOutOfRangeException.h"
diff --git a/src/OFThread.m b/src/OFThread.m
index 75c1a90a..aab7c04b 100644
--- a/src/OFThread.m
+++ b/src/OFThread.m
@@ -84,6 +84,9 @@
#ifdef OF_DJGPP
# define lrint(x) rint(x)
#endif
+#ifdef OF_AMIGAOS3
+# define lrint(x) ((long)x)
+#endif
#ifdef OF_HAVE_THREADS
# import "threading.h"
diff --git a/src/OFZIPArchiveEntry.m b/src/OFZIPArchiveEntry.m
index 1a42a0db..99aaaf22 100644
--- a/src/OFZIPArchiveEntry.m
+++ b/src/OFZIPArchiveEntry.m
@@ -17,14 +17,12 @@
#include "config.h"
-#include <inttypes.h>
-
#import "OFZIPArchiveEntry.h"
#import "OFZIPArchiveEntry+Private.h"
-#import "OFString.h"
#import "OFData.h"
#import "OFDate.h"
#import "OFStream.h"
+#import "OFString.h"
#import "OFInvalidArgumentException.h"
#import "OFInvalidFormatException.h"
diff --git a/src/exceptions/OFBindFailedException.m b/src/exceptions/OFBindFailedException.m
index 57cf5c6f..f0bf302b 100644
--- a/src/exceptions/OFBindFailedException.m
+++ b/src/exceptions/OFBindFailedException.m
@@ -17,8 +17,6 @@
#include "config.h"
-#include <inttypes.h>
-
#import "OFBindFailedException.h"
#import "OFString.h"
diff --git a/src/exceptions/OFConnectionFailedException.m b/src/exceptions/OFConnectionFailedException.m
index 411dfe75..7ad7e9de 100644
--- a/src/exceptions/OFConnectionFailedException.m
+++ b/src/exceptions/OFConnectionFailedException.m
@@ -17,8 +17,6 @@
#include "config.h"
-#include <inttypes.h>
-
#import "OFConnectionFailedException.h"
#import "OFString.h"
diff --git a/src/objfw-defs.h.in b/src/objfw-defs.h.in
index e03269de..ae101663 100644
--- a/src/objfw-defs.h.in
+++ b/src/objfw-defs.h.in
@@ -1,4 +1,6 @@
#undef INFINITY
+#undef LLONG_MAX
+#undef LLONG_MIN
#undef OF_APPLE_RUNTIME
#undef OF_BIG_ENDIAN
#undef OF_FLOAT_BIG_ENDIAN
@@ -12,6 +14,7 @@
#undef OF_HAVE_FILES
#undef OF_HAVE_FORWARDING_TARGET_FOR_SELECTOR
#undef OF_HAVE_IPV6
+#undef OF_HAVE_LIMITS_H
#undef OF_HAVE_LINK
#undef OF_HAVE_MAX_ALIGN_T
#undef OF_HAVE_NETINET_IN_H
@@ -38,5 +41,30 @@
#undef OF_NINTENDO_DS
#undef OF_OBJFW_RUNTIME
#undef OF_UNIVERSAL
+#undef PRId8
+#undef PRId16
+#undef PRId32
+#undef PRId64
+#undef PRIi8
+#undef PRIi16
+#undef PRIi32
+#undef PRIi64
+#undef PRIo8
+#undef PRIo16
+#undef PRIo32
+#undef PRIo64
+#undef PRIu8
+#undef PRIu16
+#undef PRIu32
+#undef PRIu64
+#undef PRIx8
+#undef PRIx16
+#undef PRIx32
+#undef PRIx64
+#undef PRIX8
+#undef PRIX16
+#undef PRIX32
+#undef PRIX64
#undef SIZE_MAX
#undef UINTPTR_MAX
+#undef ULLONG_MAX
diff --git a/src/platform.h b/src/platform.h
index 24c45bc1..10df3e54 100644
--- a/src/platform.h
+++ b/src/platform.h
@@ -109,6 +109,9 @@
#elif defined(__amigaos4__)
# define OF_AMIGAOS4
# define OF_AMIGAOS
+#elif defined(__amigaos__)
+# define OF_AMIGAOS3
+# define OF_AMIGAOS
#elif defined(__sun__)
# define OF_SOLARIS
#elif defined(__QNX__)
diff --git a/src/resolver.m b/src/resolver.m
index 9674b692..ab41e62f 100644
--- a/src/resolver.m
+++ b/src/resolver.m
@@ -22,10 +22,10 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <inttypes.h>
-#import "resolver.h"
+#import "OFString.h"
+#import "resolver.h"
#import "macros.h"
#if !defined(HAVE_THREADSAFE_GETADDRINFO) && defined(OF_HAVE_THREADS)
diff --git a/src/runtime/ObjFW_RT.h b/src/runtime/ObjFW_RT.h
index ad5fc57d..0aaa605a 100644
--- a/src/runtime/ObjFW_RT.h
+++ b/src/runtime/ObjFW_RT.h
@@ -29,6 +29,8 @@
#include <stddef.h>
#include <stdint.h>
+#import "platform.h"
+
#ifndef __has_feature
# define __has_feature(x) 0
#endif
diff --git a/src/runtime/private.h b/src/runtime/private.h
index 457dee72..50c013a4 100644
--- a/src/runtime/private.h
+++ b/src/runtime/private.h
@@ -17,7 +17,8 @@
#include "config.h"
-#include "platform.h"
+#import "macros.h"
+#import "platform.h"
#if !defined(__has_feature) || !__has_feature(nullability)
# ifndef _Nonnull
@@ -224,4 +225,5 @@ objc_dtable_get(const struct objc_dtable *_Nonnull dtable, uint32_t idx)
fprintf(stderr, __VA_ARGS__); \
fputs("\n", stderr); \
abort(); \
+ OF_UNREACHABLE \
}