summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Schleifer <js@heap.zone>2018-05-13 21:24:28 +0200
committerJonathan Schleifer <js@heap.zone>2018-05-13 21:24:28 +0200
commit6100f23feeca21acf39ef8c150cde8400464f191 (patch)
treeb9eedb282d5aa8635db5d3e4067d9f0598b81e12
parent615bc14924f104e38f1a8b1eab3c300f26f95196 (diff)
platform.h: Rename OF_AMIGAOS3 to OF_AMIGAOS_M68K
The reason for this is that, in theory, this also supports versions older than 3.
-rw-r--r--src/OFApplication.m2
-rw-r--r--src/OFFile.m2
-rw-r--r--src/OFFileManager.m2
-rw-r--r--src/OFLocalization.m2
-rw-r--r--src/OFStdIOStream.h4
-rw-r--r--src/OFStdIOStream.m2
-rw-r--r--src/OFString.m6
-rw-r--r--src/OFSystemInfo.m4
-rw-r--r--src/OFThread.m2
-rw-r--r--src/OFURLHandler_file.m2
-rw-r--r--src/platform.h2
-rw-r--r--src/runtime/amiga-library.m29
-rw-r--r--src/runtime/linklib/linklib.m6
-rw-r--r--tests/OFStringTests.m4
14 files changed, 33 insertions, 36 deletions
diff --git a/src/OFApplication.m b/src/OFApplication.m
index 645ddfb0..f5acf15b 100644
--- a/src/OFApplication.m
+++ b/src/OFApplication.m
@@ -53,7 +53,7 @@
extern int _CRT_glob;
extern void __wgetmainargs(int *, wchar_t ***, wchar_t ***, int, int *);
#elif defined(OF_AMIGAOS)
-# ifdef OF_AMIGAOS3
+# ifdef OF_AMIGAOS_M68K
# define INTUITION_CLASSES_H
# endif
# include <proto/exec.h>
diff --git a/src/OFFile.m b/src/OFFile.m
index 075b3cad..7b860a06 100644
--- a/src/OFFile.m
+++ b/src/OFFile.m
@@ -58,7 +58,7 @@
#endif
#ifdef OF_AMIGAOS
-# ifdef OF_AMIGAOS3
+# ifdef OF_AMIGAOS_M68K
# define INTUITION_CLASSES_H
# endif
# include <proto/dos.h>
diff --git a/src/OFFileManager.m b/src/OFFileManager.m
index 00c0cf23..0df959a1 100644
--- a/src/OFFileManager.m
+++ b/src/OFFileManager.m
@@ -58,7 +58,7 @@
#endif
#ifdef OF_AMIGAOS
-# ifdef OF_AMIGAOS3
+# ifdef OF_AMIGAOS_M68K
# define INTUITION_CLASSES_H
# endif
# include <proto/exec.h>
diff --git a/src/OFLocalization.m b/src/OFLocalization.m
index 5a45f300..58243375 100644
--- a/src/OFLocalization.m
+++ b/src/OFLocalization.m
@@ -35,7 +35,7 @@
# define __NOGLOBALIFACE__
# define __USE_INLINE__
# endif
-# ifdef OF_AMIGAOS3
+# ifdef OF_AMIGAOS_M68K
# define INTUITION_CLASSES_H
# endif
# include <proto/dos.h>
diff --git a/src/OFStdIOStream.h b/src/OFStdIOStream.h
index 4d38ec8e..4d173666 100644
--- a/src/OFStdIOStream.h
+++ b/src/OFStdIOStream.h
@@ -19,11 +19,11 @@
#import "OFKernelEventObserver.h"
#ifdef OF_AMIGAOS
-# ifdef OF_AMIGAOS3
+# ifdef OF_AMIGAOS_M68K
# define INTUITION_CLASSES_H
# endif
# include <proto/dos.h>
-# ifdef OF_AMIGAOS3
+# ifdef OF_AMIGAOS_M68K
# undef INTUITION_CLASSES_H
# endif
#endif
diff --git a/src/OFStdIOStream.m b/src/OFStdIOStream.m
index 52feea20..853b6bf3 100644
--- a/src/OFStdIOStream.m
+++ b/src/OFStdIOStream.m
@@ -42,7 +42,7 @@
#import "OFWriteFailedException.h"
#ifdef OF_AMIGAOS
-# ifdef OF_AMIGAOS3
+# ifdef OF_AMIGAOS_M68K
# define INTUITION_CLASSES_H
# endif
# include <proto/exec.h>
diff --git a/src/OFString.m b/src/OFString.m
index 4a5cf44f..fa8dcb17 100644
--- a/src/OFString.m
+++ b/src/OFString.m
@@ -69,7 +69,7 @@
# define strtod __strtod
#endif
-#ifdef OF_AMIGAOS3
+#ifdef OF_AMIGAOS_M68K
/* libnix has strtod, but not strtof */
# define strtof strtod
#endif
@@ -2506,7 +2506,7 @@ decomposedString(OFString *self, const char *const *const *table, size_t size)
{
void *pool = objc_autoreleasePoolPush();
-#if defined(OF_AMIGAOS3) || defined(OF_MORPHOS)
+#if defined(OF_AMIGAOS_M68K) || defined(OF_MORPHOS)
OFString *stripped = [self stringByDeletingEnclosingWhitespaces];
if ([stripped caseInsensitiveCompare: @"INF"] == OF_ORDERED_SAME ||
@@ -2556,7 +2556,7 @@ decomposedString(OFString *self, const char *const *const *table, size_t size)
{
void *pool = objc_autoreleasePoolPush();
-#if defined(OF_AMIGAOS3) || defined(OF_MORPHOS)
+#if defined(OF_AMIGAOS_M68K) || defined(OF_MORPHOS)
OFString *stripped = [self stringByDeletingEnclosingWhitespaces];
if ([stripped caseInsensitiveCompare: @"INF"] == OF_ORDERED_SAME ||
diff --git a/src/OFSystemInfo.m b/src/OFSystemInfo.m
index a375439e..8dc0b460 100644
--- a/src/OFSystemInfo.m
+++ b/src/OFSystemInfo.m
@@ -113,7 +113,7 @@ initOperatingSystemName(void)
operatingSystemName = @"Windows";
#elif defined(OF_ANDROID)
operatingSystemName = @"Android";
-#elif defined(OF_AMIGAOS3)
+#elif defined(OF_AMIGAOS_M68K)
operatingSystemName = @"AmigaOS";
#elif defined(OF_MORPHOS)
operatingSystemName = @"MorphOS";
@@ -217,7 +217,7 @@ initOperatingSystemVersion(void)
/* TODO */
#elif defined(OF_AMIGAOS4)
/* TODO */
-#elif defined(OF_AMIGAOS3)
+#elif defined(OF_AMIGAOS_M68K)
/* TODO */
#elif defined(OF_WII) || defined(NINTENDO_3DS) || defined(OF_NINTENDO_DS) || \
defined(OF_PSP) || defined(OF_MSDOS)
diff --git a/src/OFThread.m b/src/OFThread.m
index c3fa04f7..ca0de7d6 100644
--- a/src/OFThread.m
+++ b/src/OFThread.m
@@ -33,7 +33,7 @@
#include "platform.h"
#ifdef OF_AMIGAOS
-# ifdef OF_AMIGAOS3
+# ifdef OF_AMIGAOS_M68K
# define INTUITION_CLASSES_H
# endif
# include <proto/dos.h>
diff --git a/src/OFURLHandler_file.m b/src/OFURLHandler_file.m
index c64ef159..adfbf283 100644
--- a/src/OFURLHandler_file.m
+++ b/src/OFURLHandler_file.m
@@ -67,7 +67,7 @@
#endif
#ifdef OF_AMIGAOS
-# ifdef OF_AMIGAOS3
+# ifdef OF_AMIGAOS_M68K
# define INTUITION_CLASSES_H
# endif
# include <proto/dos.h>
diff --git a/src/platform.h b/src/platform.h
index 59ff80fb..7c53297c 100644
--- a/src/platform.h
+++ b/src/platform.h
@@ -127,7 +127,7 @@
# define OF_AMIGAOS4
# define OF_AMIGAOS
#elif defined(__amigaos__)
-# define OF_AMIGAOS3
+# define OF_AMIGAOS_M68K
# define OF_AMIGAOS
#elif defined(__sun__)
# define OF_SOLARIS
diff --git a/src/runtime/amiga-library.m b/src/runtime/amiga-library.m
index c685473c..80172e8d 100644
--- a/src/runtime/amiga-library.m
+++ b/src/runtime/amiga-library.m
@@ -20,7 +20,7 @@
#import "ObjFW_RT.h"
#import "private.h"
-#ifdef OF_AMIGAOS3
+#ifdef OF_AMIGAOS_M68K
# define INTUITION_CLASSES_H
#endif
@@ -33,14 +33,14 @@
#define CONCAT_VERSION(major, minor) CONCAT_VERSION2(major, minor)
#define VERSION_STRING CONCAT_VERSION(OBJFW_RT_LIB_MAJOR, OBJFW_RT_LIB_MINOR)
-#if defined(OF_AMIGAOS3)
+#if defined(OF_AMIGAOS_M68K)
# define DATA_OFFSET 0x7FFE
#elif defined(OF_MORPHOS)
# define DATA_OFFSET 0x8000
#endif
-#ifdef OF_AMIGAOS3
-# define OBJC_M68K_REG(reg) __asm__ (#reg)
+#ifdef OF_AMIGAOS_M68K
+# define OBJC_M68K_REG(reg) __asm__(#reg)
#else
# define OBJC_M68K_REG(reg)
#endif
@@ -60,7 +60,7 @@ struct ObjFWRTBase {
bool initialized;
};
-#ifdef OF_AMIGAOS3
+#ifdef OF_AMIGAOS_M68K
extern uintptr_t __CTOR_LIST__[];
extern const void *_EH_FRAME_BEGINS__;
extern void *_EH_FRAME_OBJECTS__;
@@ -141,7 +141,7 @@ struct objc_libc libc;
FILE *stdout;
FILE *stderr;
-#if defined(OF_AMIGAOS3)
+#if defined(OF_AMIGAOS_M68K)
__asm__ (
".text\n"
".globl ___restore_a4\n"
@@ -169,7 +169,7 @@ get_data_seg(void)
{
char *data_seg;
-#if defined(OF_AMIGAOS3)
+#if defined(OF_AMIGAOS_M68K)
__asm__ (
"move.l #___a4_init, %0"
: "=r"(data_seg)
@@ -190,7 +190,7 @@ get_data_size(void)
{
size_t data_size;
-#if defined(OF_AMIGAOS3)
+#if defined(OF_AMIGAOS_M68K)
__asm__ (
"move.l #___data_size, %0"
: "=r"(data_size)
@@ -215,7 +215,7 @@ get_datadata_relocs(void)
{
size_t *datadata_relocs;
-#if defined(OF_AMIGAOS3)
+#if defined(OF_AMIGAOS_M68K)
__asm__ (
"move.l #___datadata_relocs, %0"
: "=r"(datadata_relocs)
@@ -236,7 +236,7 @@ lib_init(struct ObjFWRTBase *base OBJC_M68K_REG(d0),
void *seg_list OBJC_M68K_REG(a0),
struct ExecBase *sys_base OBJC_M68K_REG(a6))
{
-#if defined(OF_AMIGAOS3)
+#if defined(OF_AMIGAOS_M68K)
__asm__ __volatile__ (
"move.l a6, _SysBase"
:: "a"(sys_base)
@@ -351,7 +351,7 @@ lib_close(void)
if (base->parent != NULL) {
struct ObjFWRTBase *parent;
-#ifdef OF_AMIGAOS3
+#ifdef OF_AMIGAOS_M68K
if (base->initialized)
for (size_t i = 1; i <= (size_t)_EH_FRAME_BEGINS__; i++)
libc.__deregister_frame_info(
@@ -398,7 +398,7 @@ objc_init_m68k(void)
stdout = stdout_;
stderr = stderr_;
-#ifdef OF_AMIGAOS3
+#ifdef OF_AMIGAOS_M68K
if ((size_t)_EH_FRAME_BEGINS__ != (size_t)_EH_FRAME_OBJECTS__)
return false;
@@ -607,11 +607,8 @@ struct Resident resident = {
.rt_MatchTag = &resident,
.rt_EndSkip = &resident + 1,
.rt_Flags = RTF_AUTOINIT
-#ifndef OF_AMIGAOS3
- | RTF_PPC
-#endif
#ifdef OF_MORPHOS
- | RTF_EXTENDED
+ | RTF_PPC | RTF_EXTENDED
#endif
,
.rt_Version = OBJFW_RT_LIB_MAJOR,
diff --git a/src/runtime/linklib/linklib.m b/src/runtime/linklib/linklib.m
index 33496d1c..fd473b65 100644
--- a/src/runtime/linklib/linklib.m
+++ b/src/runtime/linklib/linklib.m
@@ -21,7 +21,7 @@
#import "private.h"
#import "macros.h"
-#ifdef OF_AMIGAOS3
+#ifdef OF_AMIGAOS_M68K
# define INTUITION_CLASSES_H
#endif
#include <proto/exec.h>
@@ -182,7 +182,7 @@ objc_get_class(const char *name)
void
objc_exception_throw(id object)
{
-#ifdef OF_AMIGAOS3
+#ifdef OF_AMIGAOS_M68K
/*
* This does not use the glue code to hack around a compiler bug.
*
@@ -246,7 +246,7 @@ objc_setPropertyStruct(void *dest, const void *src, ptrdiff_t size, bool atomic,
void
objc_enumerationMutation(id object)
{
-#ifdef OF_AMIGAOS3
+#ifdef OF_AMIGAOS_M68K
/*
* This does not use the glue code to hack around a compiler bug.
*
diff --git a/tests/OFStringTests.m b/tests/OFStringTests.m
index a8c1cd31..8601d7bc 100644
--- a/tests/OFStringTests.m
+++ b/tests/OFStringTests.m
@@ -883,12 +883,12 @@ static uint16_t sutf16str[] = {
isnan([C(@" NAN\t\t") floatValue]))
#if !defined(OF_ANDROID) && !defined(OF_SOLARIS) && !defined(OF_DJGPP) && \
- !defined(OF_AMIGAOS3)
+ !defined(OF_AMIGAOS_M68K)
# define INPUT @"\t-0x1.FFFFFFFFFFFFFP-1020 "
# define EXPECTED -0x1.FFFFFFFFFFFFFP-1020
#else
/* Android, Solaris, DJGPP and AmigaOS3 do not accept 0x for strtod() */
-# if (!defined(OF_SOLARIS) || !defined(OF_X86)) && !defined(OF_AMIGAOS3)
+# if (!defined(OF_SOLARIS) || !defined(OF_X86)) && !defined(OF_AMIGAOS_M68K)
# define INPUT @"\t-0.123456789 "
# define EXPECTED -0.123456789
# else