Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -45,22 +45,10 @@ LIBS="$LIBS -ldebug" enable_files="yes" # Required for reading ENV: enable_shared="no" with_tls="no" - supports_amiga_lib="yes" - - AS_IF([test x"$enable_amiga_lib" != x"no"], [ - AC_SUBST(OBJFWRT_AMIGA_LIB, - ['objfwrt${OBJFWRT_LIB_MAJOR}.library']) - dnl For 68000, GCC emits calls to helper functions that - dnl do not work properly in a library. - t="-mcpu=68020 -fbaserel -noixemul -ffreestanding" - AC_SUBST(AMIGA_LIB_CFLAGS, $t) - t="$t -resident -nostartfiles -nodefaultlibs -ldebug -lc" - AC_SUBST(AMIGA_LIB_LDFLAGS, $t) - ]) AC_SUBST(LIBBASES_M, libbases.m) ;; powerpc-*-amigaos*) CPPFLAGS="$CPPFLAGS -D__USE_INLINE__" @@ -78,20 +66,10 @@ LDFLAGS="$LDFLAGS -noixemul" LIBS="$LIBS -ldebug" enable_files="yes" # Required for reading ENV: enable_shared="no" - supports_amiga_lib="yes" - - AS_IF([test x"$enable_amiga_lib" != x"no"], [ - AC_SUBST(OBJFWRT_AMIGA_LIB, - ['objfwrt${OBJFW_LIB_MAJOR}ppc.library']) - t="-mresident32 -ffreestanding -noixemul" - AC_SUBST(AMIGA_LIB_CFLAGS, $t) - t="-mresident32 -nostartfiles -nodefaultlibs -noixemul -ldebug" - AC_SUBST(AMIGA_LIB_LDFLAGS, "$t -lc") - ]) AC_SUBST(LIBBASES_M, libbases.m) ;; *-msdosdjgpp*) enable_shared="no" @@ -443,22 +421,12 @@ TESTS_LIBS="\${RUNTIME_LIBS} $TESTS_LIBS" TESTS_LIBS="-L../src/runtime -L../src/runtime/linklib $TESTS_LIBS" TESTS_LIBS="-L../src -lobjfw $TESTS_LIBS" ]) -AC_ARG_ENABLE(amiga-lib, - AS_HELP_STRING([--disable-amiga-lib], [do not build Amiga library])) -AS_IF([test x"$supports_amiga_lib" != x"yes"], [enable_amiga_lib="no"]) -AS_IF([test x"$enable_amiga_lib" != x"no"], [ - AC_SUBST(OBJFW_STATIC_LIB, "libobjfw.a") - AC_SUBST(EXCEPTIONS_A, "exceptions.a") - AC_SUBST(FORWARDING_A, "forwarding.a") - AC_SUBST(LOOKUP_ASM_AMIGALIB_A, "lookup-asm.amigalib.a") -]) - AC_ARG_ENABLE(static, AS_HELP_STRING([--enable-static], [build static library])) -AS_IF([test x"$enable_shared" = x"no" -a x"$enable_amiga_lib" = x"no"], [ +AS_IF([test x"$enable_shared" = x"no"], [ enable_static="yes" ]) AS_IF([test x"$enable_static" = x"yes"], [ AC_SUBST(OBJFW_STATIC_LIB, "libobjfw.a") AC_SUBST(EXCEPTIONS_A, "exceptions.a") @@ -596,22 +564,13 @@ AS_IF([test x"$build_framework" = x"yes"], [ AC_SUBST(OBJFWRT_FRAMEWORK, "ObjFWRT.framework") AC_SUBST(RUNTIME_FRAMEWORK_LIBS, "-framework ObjFWRT") ]) - AS_IF([test x"$enable_amiga_lib" != x"no"], [ - AC_SUBST(RUNTIME_LIBS, "-lobjfwrt.library") - AC_SUBST(LINKLIB, linklib) - tmp="../src/runtime/linklib/libobjfwrt.library.a" - AC_SUBST(LIBOBJFWRT_DEP, "$tmp") - AC_SUBST(LIBOBJFWRT_DEP_LVL2, "../$tmp") - ], [ - AC_SUBST(RUNTIME_LIBS, "-lobjfwrt") - ]) - - AS_IF([test x"$enable_shared" = x"no" \ - -a x"$enable_amiga_lib" = x"no"], [ + AC_SUBST(RUNTIME_LIBS, "-lobjfwrt") + + AS_IF([test x"$enable_shared" = x"no"], [ AC_SUBST(LIBOBJFWRT_DEP, "../src/runtime/libobjfwrt.a") AC_SUBST(LIBOBJFWRT_DEP_LVL2, "../../src/runtime/libobjfwrt.a") ]) AS_IF([test x"$enable_seluid24" = x"yes"], [ Index: extra.mk.in ================================================================== --- extra.mk.in +++ extra.mk.in @@ -6,11 +6,10 @@ OBJFW_LIB_MAJOR_MINOR = ${OBJFW_LIB_MAJOR}.${OBJFW_LIB_MINOR} OBJFWRT_SHARED_LIB = @OBJFWRT_SHARED_LIB@ OBJFWRT_STATIC_LIB = @OBJFWRT_STATIC_LIB@ OBJFWRT_FRAMEWORK = @OBJFWRT_FRAMEWORK@ -OBJFWRT_AMIGA_LIB = @OBJFWRT_AMIGA_LIB@ OBJFWRT_LIB_MAJOR = 0 OBJFWRT_LIB_MINOR = 0 OBJFWRT_LIB_MAJOR_MINOR = ${OBJFWRT_LIB_MAJOR}.${OBJFWRT_LIB_MINOR} OBJFWBRIDGE_SHARED_LIB = @OBJFWBRIDGE_SHARED_LIB@ @@ -36,11 +35,10 @@ LIBOBJFWRT_DEP_LVL2 = @LIBOBJFWRT_DEP_LVL2@ LIBOBJFW_DEP = @LIBOBJFW_DEP@ LIBOBJFW_DEP_LVL2 = @LIBOBJFW_DEP_LVL2@ LINKLIB = @LINKLIB@ LOOKUP_ASM_A = @LOOKUP_ASM_A@ -LOOKUP_ASM_AMIGALIB_A = @LOOKUP_ASM_AMIGALIB_A@ LOOKUP_ASM_LIB_A = @LOOKUP_ASM_LIB_A@ MAP_LDFLAGS = @MAP_LDFLAGS@ OBJC_SYNC = @OBJC_SYNC@ OBJFW_NEW = @OBJFW_NEW@ OFARC = @OFARC@ DELETED generators/library/FuncArrayGenerator.h Index: generators/library/FuncArrayGenerator.h ================================================================== --- generators/library/FuncArrayGenerator.h +++ generators/library/FuncArrayGenerator.h @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2008-2023 Jonathan Schleifer - * - * All rights reserved. - * - * This file is part of ObjFW. It may be distributed under the terms of the - * Q Public License 1.0, which can be found in the file LICENSE.QPL included in - * the packaging of this file. - * - * Alternatively, it may be distributed under the terms of the GNU General - * Public License, either version 2 or 3, which can be found in the file - * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this - * file. - */ - -#import "OFObject.h" - -#import "OFStream.h" -#import "OFXMLElement.h" - -@interface FuncArrayGenerator: OFObject -{ - OFXMLElement *_library; - OFStream *_include; -} - -- (instancetype)initWithLibrary: (OFXMLElement *)library - include: (OFStream *)include; -- (void)generate; -@end DELETED generators/library/FuncArrayGenerator.m Index: generators/library/FuncArrayGenerator.m ================================================================== --- generators/library/FuncArrayGenerator.m +++ generators/library/FuncArrayGenerator.m @@ -1,78 +0,0 @@ -/* - * Copyright (c) 2008-2023 Jonathan Schleifer - * - * All rights reserved. - * - * This file is part of ObjFW. It may be distributed under the terms of the - * Q Public License 1.0, which can be found in the file LICENSE.QPL included in - * the packaging of this file. - * - * Alternatively, it may be distributed under the terms of the GNU General - * Public License, either version 2 or 3, which can be found in the file - * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this - * file. - */ - -#include "config.h" - -#import "OFArray.h" -#import "OFXMLAttribute.h" - -#import "FuncArrayGenerator.h" - -#import "OFInvalidFormatException.h" -#import "OFUnsupportedVersionException.h" - -#import "copyright.h" - -@implementation FuncArrayGenerator -- (instancetype)initWithLibrary: (OFXMLElement *)library - include: (OFStream *)include -{ - self = [super init]; - - @try { - OFXMLAttribute *version; - - if (![library.name isEqual: @"amiga-library"] || - library.namespace != nil) - @throw [OFInvalidFormatException exception]; - - if ((version = [library attributeForName: @"version"]) == nil) - @throw [OFInvalidFormatException exception]; - - if (![version.stringValue isEqual: @"1.0"]) - @throw [OFUnsupportedVersionException - exceptionWithVersion: version.stringValue]; - - _library = [library retain]; - _include = [include retain]; - } @catch (id e) { - [self release]; - @throw e; - } - - return self; -} - -- (void)dealloc -{ - [_library release]; - [_include release]; - - [super dealloc]; -} - -- (void)generate -{ - [_include writeString: COPYRIGHT]; - [_include writeString: - @"/* This file is automatically generated from amiga-library.xml */" - @"\n\n"]; - - for (OFXMLElement *function in [_library elementsForName: @"function"]) - [_include writeFormat: - @"(CONST_APTR)glue_%@,\n", - [function attributeForName: @"name"].stringValue]; -} -@end DELETED generators/library/GlueGenerator.h Index: generators/library/GlueGenerator.h ================================================================== --- generators/library/GlueGenerator.h +++ generators/library/GlueGenerator.h @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2008-2023 Jonathan Schleifer - * - * All rights reserved. - * - * This file is part of ObjFW. It may be distributed under the terms of the - * Q Public License 1.0, which can be found in the file LICENSE.QPL included in - * the packaging of this file. - * - * Alternatively, it may be distributed under the terms of the GNU General - * Public License, either version 2 or 3, which can be found in the file - * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this - * file. - */ - -#import "OFObject.h" - -#import "OFStream.h" -#import "OFXMLElement.h" - -@interface GlueGenerator: OFObject -{ - OFXMLElement *_library; - OFStream *_header, *_impl; -} - -- (instancetype)initWithLibrary: (OFXMLElement *)library - header: (OFStream *)header - implementation: (OFStream *)implementation; -- (void)generate; -@end DELETED generators/library/GlueGenerator.m Index: generators/library/GlueGenerator.m ================================================================== --- generators/library/GlueGenerator.m +++ generators/library/GlueGenerator.m @@ -1,207 +0,0 @@ -/* - * Copyright (c) 2008-2023 Jonathan Schleifer - * - * All rights reserved. - * - * This file is part of ObjFW. It may be distributed under the terms of the - * Q Public License 1.0, which can be found in the file LICENSE.QPL included in - * the packaging of this file. - * - * Alternatively, it may be distributed under the terms of the GNU General - * Public License, either version 2 or 3, which can be found in the file - * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this - * file. - */ - -#include "config.h" - -#import "OFArray.h" -#import "OFXMLAttribute.h" - -#import "GlueGenerator.h" - -#import "OFInvalidFormatException.h" -#import "OFUnsupportedVersionException.h" - -#import "copyright.h" - -@implementation GlueGenerator -- (instancetype)initWithLibrary: (OFXMLElement *)library - header: (OFStream *)header - implementation: (OFStream *)impl -{ - self = [super init]; - - @try { - OFXMLAttribute *version; - - if (![library.name isEqual: @"amiga-library"] || - library.namespace != nil) - @throw [OFInvalidFormatException exception]; - - if ((version = [library attributeForName: @"version"]) == nil) - @throw [OFInvalidFormatException exception]; - - if (![version.stringValue isEqual: @"1.0"]) - @throw [OFUnsupportedVersionException - exceptionWithVersion: version.stringValue]; - - _library = [library retain]; - _header = [header retain]; - _impl = [impl retain]; - } @catch (id e) { - [self release]; - @throw e; - } - - return self; -} - -- (void)dealloc -{ - [_library release]; - [_header release]; - [_impl release]; - - [super dealloc]; -} - -- (void)generate -{ - [_header writeString: COPYRIGHT]; - [_impl writeString: COPYRIGHT]; - - [_header writeString: - @"/* This file is automatically generated from amiga-library.xml */" - @"\n\n"]; - - [_impl writeString: - @"/* This file is automatically generated from amiga-library.xml */" - @"\n\n" - @"#include \"config.h\"\n" - @"\n" - @"#import \"amiga-glue.h\"\n" - @"\n"]; - - for (OFXMLElement *include in [_library elementsForName: @"include"]) - [_header writeFormat: @"#import \"%@\"\n", include.stringValue]; - - [_header writeString: - @"\n" - @"#ifdef OF_AMIGAOS_M68K\n" - @"# define PPC_PARAMS(...) (void)\n" - @"# define M68K_ARG(type, name, reg)\t\t\\\n" - @"\tregister type reg##name __asm__(#reg);\t\\\n" - @"\ttype name = reg##name;\n" - @"#else\n" - @"# define PPC_PARAMS(...) (__VA_ARGS__)\n" - @"# define M68K_ARG(...)\n" - @"#endif\n" - @"\n"]; - [_impl writeString: - @"#ifdef OF_MORPHOS\n" - @"/* All __saveds functions in this file need to use the SysV " - @"ABI */\n" - @"__asm__ (\n" - @" \".section .text\\n\"\n" - @" \".align 2\\n\"\n" - @" \"__restore_r13:\\n\"\n" - @" \"\tlwz\t%r13, 44(%r12)\\n\"\n" - @" \"\tblr\\n\"\n" - @");\n" - @"#endif\n"]; - - for (OFXMLElement *function in - [_library elementsForName: @"function"]) { - OFString *name = - [function attributeForName: @"name"].stringValue; - OFString *returnType = - [function attributeForName: @"return-type"].stringValue; - OFArray OF_GENERIC(OFXMLElement *) *arguments = - [function elementsForName: @"argument"]; - size_t argumentIndex; - - if (returnType == nil) - returnType = @"void"; - - [_header writeFormat: - @"extern %@%@glue_%@", - returnType, - (![returnType hasSuffix: @"*"] ? @" " : @""), - name]; - - [_impl writeFormat: @"\n" - @"%@ __saveds\n" - @"glue_%@", - returnType, name]; - - if (arguments.count > 0) { - [_header writeString: @" PPC_PARAMS("]; - [_impl writeString: @" PPC_PARAMS("]; - } else { - [_header writeString: @"(void"]; - [_impl writeString: @"(void"]; - } - - argumentIndex = 0; - for (OFXMLElement *argument in arguments) { - OFString *argName = - [argument attributeForName: @"name"].stringValue; - OFString *argType = - [argument attributeForName: @"type"].stringValue; - - if (argumentIndex++ > 0) { - [_header writeString: @", "]; - [_impl writeString: @", "]; - } - - [_header writeString: argType]; - [_impl writeString: argType]; - if (![argType hasSuffix: @"*"]) { - [_header writeString: @" "]; - [_impl writeString: @" "]; - } - [_header writeString: argName]; - [_impl writeString: argName]; - } - - [_header writeString: @");\n"]; - - [_impl writeString: @")\n{\n"]; - for (OFXMLElement *argument in arguments) { - OFString *argName = - [argument attributeForName: @"name"].stringValue; - OFString *argType = - [argument attributeForName: @"type"].stringValue; - OFString *m68kReg = [argument - attributeForName: @"m68k-reg"].stringValue; - - [_impl writeFormat: @"\tM68K_ARG(%@, %@, %@)\n", - argType, argName, m68kReg]; - } - - if (arguments.count > 0) - [_impl writeString: @"\n"]; - - if (![returnType isEqual: @"void"]) - [_impl writeString: @"\treturn "]; - else - [_impl writeString: @"\t"]; - - [_impl writeFormat: @"%@(", name]; - - argumentIndex = 0; - for (OFXMLElement *argument in arguments) { - OFString *argName = - [argument attributeForName: @"name"].stringValue; - - if (argumentIndex++ > 0) - [_impl writeString: @", "]; - - [_impl writeString: argName]; - } - - [_impl writeString: @");\n}\n"]; - } -} -@end DELETED generators/library/LibraryGenerator.m Index: generators/library/LibraryGenerator.m ================================================================== --- generators/library/LibraryGenerator.m +++ generators/library/LibraryGenerator.m @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2008-2023 Jonathan Schleifer - * - * All rights reserved. - * - * This file is part of ObjFW. It may be distributed under the terms of the - * Q Public License 1.0, which can be found in the file LICENSE.QPL included in - * the packaging of this file. - * - * Alternatively, it may be distributed under the terms of the GNU General - * Public License, either version 2 or 3, which can be found in the file - * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this - * file. - */ - -#include "config.h" - -#import "OFApplication.h" -#import "OFFile.h" -#import "OFFileManager.h" -#import "OFIRI.h" -#import "OFXMLElement.h" - -#import "FuncArrayGenerator.h" -#import "GlueGenerator.h" -#import "LinkLibGenerator.h" - -@interface LibraryGenerator: OFObject -@end - -OF_APPLICATION_DELEGATE(LibraryGenerator) - -@implementation LibraryGenerator -- (void)applicationDidFinishLaunching: (OFNotification *)notification -{ - OFIRI *sourcesIRI = [[OFFileManager defaultManager].currentDirectoryIRI - IRIByAppendingPathComponent: @"../../src"]; - OFIRI *runtimeLibraryIRI = [sourcesIRI - IRIByAppendingPathComponent: @"runtime/amiga-library.xml"]; - OFIRI *runtimeLinkLibIRI = [sourcesIRI - IRIByAppendingPathComponent: @"runtime/linklib/linklib.m"]; - OFIRI *runtimeGlueHeaderIRI = [sourcesIRI - IRIByAppendingPathComponent: @"runtime/amiga-glue.h"]; - OFIRI *runtimeGlueIRI = [sourcesIRI - IRIByAppendingPathComponent: @"runtime/amiga-glue.m"]; - OFIRI *runtimeFuncArrayIRI = [sourcesIRI - IRIByAppendingPathComponent: @"runtime/amiga-funcarray.inc"]; - OFXMLElement *runtimeLibrary = [OFXMLElement elementWithStream: - [OFFile fileWithPath: runtimeLibraryIRI.fileSystemRepresentation - mode: @"r"]]; - OFFile *runtimeLinkLib = - [OFFile fileWithPath: runtimeLinkLibIRI.fileSystemRepresentation - mode: @"w"]; - OFFile *runtimeGlueHeader = - [OFFile fileWithPath: runtimeGlueHeaderIRI.fileSystemRepresentation - mode: @"w"]; - OFFile *runtimeGlue = - [OFFile fileWithPath: runtimeGlueIRI.fileSystemRepresentation - mode: @"w"]; - OFFile *runtimeFuncArray = - [OFFile fileWithPath: runtimeFuncArrayIRI.fileSystemRepresentation - mode: @"w"]; - LinkLibGenerator *runtimeLinkLibGenerator = [[[LinkLibGenerator alloc] - initWithLibrary: runtimeLibrary - implementation: runtimeLinkLib] autorelease]; - GlueGenerator *runtimeGlueGenerator = [[[GlueGenerator alloc] - initWithLibrary: runtimeLibrary - header: runtimeGlueHeader - implementation: runtimeGlue] autorelease]; - FuncArrayGenerator *runtimeFuncArrayGenerator; - runtimeFuncArrayGenerator = [[[FuncArrayGenerator alloc] - initWithLibrary: runtimeLibrary - include: runtimeFuncArray] autorelease]; - - [runtimeLinkLibGenerator generate]; - [runtimeGlueGenerator generate]; - [runtimeFuncArrayGenerator generate]; - - [OFApplication terminate]; -} -@end DELETED generators/library/LinkLibGenerator.h Index: generators/library/LinkLibGenerator.h ================================================================== --- generators/library/LinkLibGenerator.h +++ generators/library/LinkLibGenerator.h @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2008-2023 Jonathan Schleifer - * - * All rights reserved. - * - * This file is part of ObjFW. It may be distributed under the terms of the - * Q Public License 1.0, which can be found in the file LICENSE.QPL included in - * the packaging of this file. - * - * Alternatively, it may be distributed under the terms of the GNU General - * Public License, either version 2 or 3, which can be found in the file - * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this - * file. - */ - -#import "OFObject.h" -#import "OFStream.h" -#import "OFXMLElement.h" - -@interface LinkLibGenerator: OFObject -{ - OFXMLElement *_library; - OFStream *_impl; -} - -- (instancetype)initWithLibrary: (OFXMLElement *)library - implementation: (OFStream *)impl; -- (void)generate; -@end DELETED generators/library/LinkLibGenerator.m Index: generators/library/LinkLibGenerator.m ================================================================== --- generators/library/LinkLibGenerator.m +++ generators/library/LinkLibGenerator.m @@ -1,226 +0,0 @@ -/* - * Copyright (c) 2008-2023 Jonathan Schleifer - * - * All rights reserved. - * - * This file is part of ObjFW. It may be distributed under the terms of the - * Q Public License 1.0, which can be found in the file LICENSE.QPL included in - * the packaging of this file. - * - * Alternatively, it may be distributed under the terms of the GNU General - * Public License, either version 2 or 3, which can be found in the file - * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this - * file. - */ - -#include "config.h" - -#import "OFArray.h" -#import "OFXMLAttribute.h" - -#import "LinkLibGenerator.h" - -#import "OFInvalidFormatException.h" -#import "OFUnsupportedVersionException.h" - -#import "copyright.h" - -@implementation LinkLibGenerator -- (instancetype)initWithLibrary: (OFXMLElement *)library - implementation: (OFStream *)impl -{ - self = [super init]; - - @try { - OFXMLAttribute *version; - - if (![library.name isEqual: @"amiga-library"] || - library.namespace != nil) - @throw [OFInvalidFormatException exception]; - - if ((version = [library attributeForName: @"version"]) == nil) - @throw [OFInvalidFormatException exception]; - - if (![version.stringValue isEqual: @"1.0"]) - @throw [OFUnsupportedVersionException - exceptionWithVersion: version.stringValue]; - - _library = [library retain]; - _impl = [impl retain]; - } @catch (id e) { - [self release]; - @throw e; - } - - return self; -} - -- (void)dealloc -{ - [_library release]; - [_impl release]; - - [super dealloc]; -} - -- (void)generate -{ - OFString *libBase = [_library attributeForName: @"base"].stringValue; - OFArray OF_GENERIC(OFXMLElement *) *functions; - size_t funcIndex = 0; - - [_impl writeString: COPYRIGHT]; - [_impl writeString: - @"/* This file is automatically generated from amiga-library.xml */" - @"\n\n" - @"#include \"config.h\"\n" - @"\n"]; - - for (OFXMLElement *include in [_library elementsForName: @"include"]) - [_impl writeFormat: @"#import \"%@\"\n", - include.stringValue]; - - [_impl writeFormat: @"\n" - @"extern struct Library *%@;\n" - @"\n", - libBase]; - - functions = [_library elementsForName: @"function"]; - for (OFXMLElement *function in functions) { - OFString *name = - [function attributeForName: @"name"].stringValue; - OFString *returnType = - [function attributeForName: @"return-type"].stringValue; - OFArray OF_GENERIC(OFXMLElement *) *arguments = - [function elementsForName: @"argument"]; - size_t argumentIndex; - - if (returnType == nil) - returnType = @"void"; - - [_impl writeFormat: @"%@\n%@(", returnType, name]; - - argumentIndex = 0; - for (OFXMLElement *argument in - [function elementsForName: @"argument"]) { - OFString *argName = - [argument attributeForName: @"name"].stringValue; - OFString *argType = - [argument attributeForName: @"type"].stringValue; - - if (argumentIndex++ > 0) - [_impl writeString: @", "]; - - [_impl writeString: argType]; - if (![argType hasSuffix: @"*"]) - [_impl writeString: @" "]; - [_impl writeString: argName]; - } - - [_impl writeFormat: - @")\n" - @"{\n" - @"#if defined(OF_AMIGAOS_M68K)\n" - @"\tregister struct Library *a6 __asm__(\"a6\") = %@;\n" - @"\t(void)a6;\n" - @"\t", libBase]; - - if (![returnType isEqual: @"void"]) - [_impl writeString: @"return "]; - - [_impl writeString: @"(("]; - [_impl writeString: returnType]; - if (![returnType hasSuffix: @"*"]) - [_impl writeString: @" "]; - [_impl writeString: @"(*)("]; - - argumentIndex = 0; - for (OFXMLElement *argument in arguments) { - OFString *argType = - [argument attributeForName: @"type"].stringValue; - OFString *m68kReg = [argument - attributeForName: @"m68k-reg"].stringValue; - - if (argumentIndex++ > 0) - [_impl writeString: @", "]; - - [_impl writeString: argType]; - if (![argType hasSuffix: @"*"]) - [_impl writeString: @" "]; - [_impl writeFormat: @"__asm__(\"%@\")", - m68kReg]; - } - - [_impl writeFormat: @"))(((uintptr_t)%@) - %zu))(", - libBase, 30 + funcIndex * 6]; - - argumentIndex = 0; - for (OFXMLElement *argument in - [function elementsForName: @"argument"]) { - OFString *argName = - [argument attributeForName: @"name"].stringValue; - - if (argumentIndex++ > 0) - [_impl writeString: @", "]; - - [_impl writeString: argName]; - } - - [_impl writeFormat: @");\n" - @"#elif defined(OF_MORPHOS)\n" - @"\t__asm__ __volatile__ (\n" - @"\t \"mr\t\t%%%%r12, %%0\"\n" - @"\t :: \"r\"(%@) : \"r12\"\n" - @"\t);\n" - @"\n" - @"\t", - libBase, libBase]; - - if (![returnType isEqual: @"void"]) - [_impl writeString: @"return "]; - - [_impl writeString: @"__extension__ (("]; - [_impl writeString: returnType]; - if (![returnType hasSuffix: @"*"]) - [_impl writeString: @" "]; - [_impl writeString: @"(*)("]; - - argumentIndex = 0; - for (OFXMLElement *argument in arguments) { - OFString *argType = - [argument attributeForName: @"type"].stringValue; - - if (argumentIndex++ > 0) - [_impl writeString: @", "]; - - [_impl writeString: argType]; - } - - [_impl writeFormat: @"))*(void **)(((uintptr_t)%@) - %zu))(", - libBase, 28 + funcIndex * 6]; - - argumentIndex = 0; - for (OFXMLElement *argument in - [function elementsForName: @"argument"]) { - OFString *argName = - [argument attributeForName: @"name"].stringValue; - - if (argumentIndex++ > 0) - [_impl writeString: @", "]; - - [_impl writeString: argName]; - } - - [_impl writeString: @");\n" - @"#endif\n"]; - - if ([function attributeForName: @"noreturn"] != nil) - [_impl writeString: @"\n\tOF_UNREACHABLE\n"]; - - [_impl writeString: @"}\n"]; - - if (++funcIndex < functions.count) - [_impl writeString: @"\n"]; - } -} -@end DELETED generators/library/Makefile Index: generators/library/Makefile ================================================================== --- generators/library/Makefile +++ generators/library/Makefile @@ -1,75 +0,0 @@ -include ../../extra.mk - -PROG_NOINST = gen_libraries${PROG_SUFFIX} -SRCS = FuncArrayGenerator.m \ - GlueGenerator.m \ - LibraryGenerator.m \ - LinkLibGenerator.m - -include ../../buildsys.mk - -.PHONY: run -run: all - rm -f libobjfw.so.${OBJFW_LIB_MAJOR} - rm -f libobjfw.so.${OBJFW_LIB_MAJOR_MINOR} - rm -f objfw${OBJFW_LIB_MAJOR}.dll libobjfw.${OBJFW_LIB_MAJOR}.dylib - rm -f libobjfwrt.so.${OBJFWRT_LIB_MAJOR} - rm -f libobjfwrt.so.${OBJFWRT_LIB_MAJOR_MINOR} - rm -f objfwrt${OBJFWRT_LIB_MAJOR}.dll - rm -f libobjfwrt.${OBJFWRT_LIB_MAJOR}.dylib - rm -f ${OBJFWRT_AMIGA_LIB} - if test -f ../../src/libobjfw.so; then \ - ${LN_S} ../../src/libobjfw.so libobjfw.so.${OBJFW_LIB_MAJOR}; \ - ${LN_S} ../../src/libobjfw.so \ - libobjfw.so.${OBJFW_LIB_MAJOR_MINOR}; \ - elif test -f ../../src/libobjfw.so.${OBJFW_LIB_MAJOR_MINOR}; then \ - ${LN_S} ../../src/libobjfw.so.${OBJFW_LIB_MAJOR_MINOR} \ - libobjfw.so.${OBJFW_LIB_MAJOR_MINOR}; \ - fi - if test -f ../../src/objfw${OBJFW_LIB_MAJOR}.dll; then \ - ${LN_S} ../../src/objfw${OBJFW_LIB_MAJOR}.dll \ - objfw${OBJFW_LIB_MAJOR}.dll; \ - fi - if test -f ../../src/libobjfw.dylib; then \ - ${LN_S} ../../src/libobjfw.dylib \ - libobjfw.${OBJFW_LIB_MAJOR}.dylib; \ - fi - if test -f ../../src/runtime/libobjfwrt.so; then \ - ${LN_S} ../../src/runtime/libobjfwrt.so \ - libobjfwrt.so.${OBJFWRT_LIB_MAJOR}; \ - ${LN_S} ../../src/runtime/libobjfwrt.so \ - libobjfwrt.so.${OBJFWRT_LIB_MAJOR_MINOR}; \ - elif test -f ../../src/runtime/libobjfwrt.so.${OBJFWRT_LIB_MAJOR_MINOR}; then \ - ${LN_S} ../../src/runtime/libobjfwrt.so.${OBJFWRT_LIB_MAJOR_MINOR} libobjfwrt.so.${OBJFWRT_LIB_MAJOR_MINOR}; \ - fi - if test -f ../../src/runtime/objfwrt${OBJFWRT_LIB_MAJOR}.dll; then \ - ${LN_S} ../../src/runtime/objfwrt${OBJFWRT_LIB_MAJOR}.dll \ - objfwrt${OBJFWRT_LIB_MAJOR}.dll; \ - fi - if test -f ../../src/runtime/libobjfwrt.dylib; then \ - ${LN_S} ../../src/runtime/libobjfwrt.dylib \ - libobjfwrt.${OBJFWRT_LIB_MAJOR}.dylib; \ - fi - if test -f ../../src/runtime/${OBJFWRT_AMIGA_LIB}; then \ - ${LN_S} ../../src/runtime/${OBJFWRT_AMIGA_LIB} \ - ${OBJFWRT_AMIGA_LIB}; \ - fi - LD_LIBRARY_PATH=.$${LD_LIBRARY_PATH+:}$$LD_LIBRARY_PATH \ - DYLD_FRAMEWORK_PATH=../../src:../../src/runtime$${DYLD_FRAMEWORK_PATH+:}$$DYLD_FRAMEWORK_PATH \ - DYLD_LIBRARY_PATH=.$${DYLD_LIBRARY_PATH+:}$$DYLD_LIBRARY_PATH \ - LIBRARY_PATH=.$${LIBRARY_PATH+:}$$LIBRARY_PATH \ - ASAN_OPTIONS=allocator_may_return_null=1 \ - ${WRAPPER} ./${PROG_NOINST}; EXIT=$$?; \ - rm -f libobjfw.so.${OBJFW_LIB_MAJOR}; \ - rm -f libobjfw.so.${OBJFW_LIB_MAJOR_MINOR}; \ - rm -f objfw${OBJFW_LIB_MAJOR}.dll; \ - rm -f libobjfw.${OBJFW_LIB_MAJOR}.dylib; \ - rm -f libobjfwrt.so.${OBJFWRT_LIB_MAJOR}; \ - rm -f libobjfwrt.so.${OBJFWRT_LIB_MAJOR_MINOR}; \ - rm -f objfwrt${OBJFWRT_LIB_MAJOR}.dll; \ - rm -f libobjfwrt.${OBJFWRT_LIB_MAJOR}.dylib; \ - exit $$EXIT - -CPPFLAGS += -I../../src -I../../src/exceptions -I../../src/runtime -I../.. -LIBS := -L../../src -lobjfw -L../../src/runtime ${RUNTIME_LIBS} ${LIBS} -LD = ${OBJC} DELETED generators/library/copyright.h Index: generators/library/copyright.h ================================================================== --- generators/library/copyright.h +++ generators/library/copyright.h @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2008-2023 Jonathan Schleifer - * - * All rights reserved. - * - * This file is part of ObjFW. It may be distributed under the terms of the - * Q Public License 1.0, which can be found in the file LICENSE.QPL included in - * the packaging of this file. - * - * Alternatively, it may be distributed under the terms of the GNU General - * Public License, either version 2 or 3, which can be found in the file - * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this - * file. - */ - -#import "OFString.h" - -#define COPYRIGHT \ - @"/*\n" \ - @" * Copyright (c) 2008-2023 Jonathan Schleifer \n" \ - @" *\n" \ - @" * All rights reserved.\n" \ - @" *\n" \ - @" * This file is part of ObjFW. It may be distributed under the terms " \ - @"of the\n" \ - @" * Q Public License 1.0, which can be found in the file LICENSE.QPL " \ - @"included in\n" \ - @" * the packaging of this file.\n" \ - @" *\n" \ - @" * Alternatively, it may be distributed under the terms of the GNU " \ - @"General\n" \ - @" * Public License, either version 2 or 3, which can be found in the " \ - @"file\n" \ - @" * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the " \ - @"packaging of this\n" \ - @" * file.\n" \ - @" */\n" \ - @"\n" Index: generators/unicode/Makefile ================================================================== --- generators/unicode/Makefile +++ generators/unicode/Makefile @@ -12,11 +12,10 @@ rm -f objfw${OBJFW_LIB_MAJOR}.dll libobjfw.${OBJFW_LIB_MAJOR}.dylib rm -f libobjfwrt.so.${OBJFWRT_LIB_MAJOR} rm -f libobjfwrt.so.${OBJFWRT_LIB_MAJOR_MINOR} rm -f objfwrt${OBJFWRT_LIB_MAJOR}.dll rm -f libobjfwrt.${OBJFWRT_LIB_MAJOR}.dylib - rm -f ${OBJFWRT_AMIGA_LIB} if test -f ../../src/libobjfw.so; then \ ${LN_S} ../../src/libobjfw.so libobjfw.so.${OBJFW_LIB_MAJOR}; \ ${LN_S} ../../src/libobjfw.so \ libobjfw.so.${OBJFW_LIB_MAJOR_MINOR}; \ elif test -f ../../src/libobjfw.so.${OBJFW_LIB_MAJOR_MINOR}; then \ @@ -45,14 +44,10 @@ fi if test -f ../../src/runtime/libobjfwrt.dylib; then \ ${LN_S} ../../src/runtime/libobjfwrt.dylib \ libobjfwrt.${OBJFWRT_LIB_MAJOR}.dylib; \ fi - if test -f ../../src/runtime/${OBJFWRT_AMIGA_LIB}; then \ - ${LN_S} ../../src/runtime/${OBJFWRT_AMIGA_LIB} \ - ${OBJFWRT_AMIGA_LIB}; \ - fi LD_LIBRARY_PATH=.$${LD_LIBRARY_PATH+:}$$LD_LIBRARY_PATH \ DYLD_FRAMEWORK_PATH=../../src:../../src/runtime$${DYLD_FRAMEWORK_PATH+:}$$DYLD_FRAMEWORK_PATH \ DYLD_LIBRARY_PATH=.$${DYLD_LIBRARY_PATH+:}$$DYLD_LIBRARY_PATH \ LIBRARY_PATH=.$${LIBRARY_PATH+:}$$LIBRARY_PATH \ ASAN_OPTIONS=allocator_may_return_null=1 \ Index: src/runtime/Makefile ================================================================== --- src/runtime/Makefile +++ src/runtime/Makefile @@ -5,11 +5,10 @@ DISTCLEAN = Info.plist SHARED_LIB = ${OBJFWRT_SHARED_LIB} STATIC_LIB = ${OBJFWRT_STATIC_LIB} FRAMEWORK = ${OBJFWRT_FRAMEWORK} -AMIGA_LIB = ${OBJFWRT_AMIGA_LIB} LIB_MAJOR = ${OBJFWRT_LIB_MAJOR} LIB_MINOR = ${OBJFWRT_LIB_MINOR} SRCS = arc.m \ autorelease.m \ @@ -41,25 +40,19 @@ INCLUDES = ObjFWRT.h includesubdir = ObjFWRT OBJS_EXTRA = lookup-asm/lookup-asm.a LIB_OBJS_EXTRA = lookup-asm/lookup-asm.lib.a -AMIGA_LIB_OBJS_START = amiga-library.amigalib.o -AMIGA_LIB_OBJS_EXTRA = amiga-glue.amigalib.o \ - lookup-asm/lookup-asm.amigalib.a \ - amiga-end.amigalib.o include ../../buildsys.mk CPPFLAGS += -I. -I.. -I../.. \ -DOBJC_COMPILING_RUNTIME \ - -DOBJFWRT_AMIGA_LIB=\"${OBJFWRT_AMIGA_LIB}\" \ -DOBJFWRT_LIB_MAJOR=${OBJFWRT_LIB_MAJOR} \ -DOBJFWRT_LIB_MINOR=${OBJFWRT_LIB_MINOR} -AMIGA_LIB_CFLAGS += -DOBJC_COMPILING_AMIGA_LIBRARY LD = ${OBJC} FRAMEWORK_LIBS = ${LIBS} RCFLAGS = --use-temp-file \ -DOBJFWRT_LIB_MAJOR=${OBJFWRT_LIB_MAJOR} \ -DOBJFWRT_LIB_MINOR=${OBJFWRT_LIB_MINOR} \ -DOBJFWRT_LIB_VERSION=\"${OBJFWRT_LIB_MAJOR}.${OBJFWRT_LIB_MINOR}\" \ -DOBJFWRT_SHARED_LIB=\"${OBJFWRT_SHARED_LIB}\" DELETED src/runtime/amiga-end.m Index: src/runtime/amiga-end.m ================================================================== --- src/runtime/amiga-end.m +++ src/runtime/amiga-end.m @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2008-2023 Jonathan Schleifer - * - * All rights reserved. - * - * This file is part of ObjFW. It may be distributed under the terms of the - * Q Public License 1.0, which can be found in the file LICENSE.QPL included in - * the packaging of this file. - * - * Alternatively, it may be distributed under the terms of the GNU General - * Public License, either version 2 or 3, which can be found in the file - * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this - * file. - */ - -#include "config.h" - -#include "platform.h" - -#if defined(OF_MORPHOS) -__asm__ ( - ".section .eh_frame, \"aw\"\n" - " .long 0\n" - ".section .ctors, \"aw\"\n" - " .long 0" -); -#elif defined(OF_AMIGAOS_M68K) -__asm__ ( - ".section .list___EH_FRAME_BEGINS__, \"aw\"\n" - " .long 0\n" - ".section .dlist___EH_FRAME_OBJECTS__, \"aw\"\n" - " .long 0\n" - ".section .list___CTOR_LIST__, \"aw\"\n" - " .long 0" -); -#endif DELETED src/runtime/amiga-funcarray.inc Index: src/runtime/amiga-funcarray.inc ================================================================== --- src/runtime/amiga-funcarray.inc +++ src/runtime/amiga-funcarray.inc @@ -1,106 +0,0 @@ -/* - * Copyright (c) 2008-2023 Jonathan Schleifer - * - * All rights reserved. - * - * This file is part of ObjFW. It may be distributed under the terms of the - * Q Public License 1.0, which can be found in the file LICENSE.QPL included in - * the packaging of this file. - * - * Alternatively, it may be distributed under the terms of the GNU General - * Public License, either version 2 or 3, which can be found in the file - * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this - * file. - */ - -/* This file is automatically generated from amiga-library.xml */ - -(CONST_APTR)glue_objc_init, -(CONST_APTR)glue___objc_exec_class, -(CONST_APTR)glue_objc_msg_lookup, -(CONST_APTR)glue_objc_msg_lookup_stret, -(CONST_APTR)glue_objc_msg_lookup_super, -(CONST_APTR)glue_objc_msg_lookup_super_stret, -(CONST_APTR)glue_objc_lookUpClass, -(CONST_APTR)glue_objc_getClass, -(CONST_APTR)glue_objc_getRequiredClass, -(CONST_APTR)glue_objc_lookup_class, -(CONST_APTR)glue_objc_get_class, -(CONST_APTR)glue_objc_exception_throw, -(CONST_APTR)glue_objc_sync_enter, -(CONST_APTR)glue_objc_sync_exit, -(CONST_APTR)glue_objc_getProperty, -(CONST_APTR)glue_objc_setProperty, -(CONST_APTR)glue_objc_getPropertyStruct, -(CONST_APTR)glue_objc_setPropertyStruct, -(CONST_APTR)glue_objc_enumerationMutation, -(CONST_APTR)glue___gnu_objc_personality, -(CONST_APTR)glue_objc_retain, -(CONST_APTR)glue_objc_retainBlock, -(CONST_APTR)glue_objc_retainAutorelease, -(CONST_APTR)glue_objc_release, -(CONST_APTR)glue_objc_autorelease, -(CONST_APTR)glue_objc_autoreleaseReturnValue, -(CONST_APTR)glue_objc_retainAutoreleaseReturnValue, -(CONST_APTR)glue_objc_retainAutoreleasedReturnValue, -(CONST_APTR)glue_objc_storeStrong, -(CONST_APTR)glue_objc_storeWeak, -(CONST_APTR)glue_objc_loadWeakRetained, -(CONST_APTR)glue_objc_initWeak, -(CONST_APTR)glue_objc_destroyWeak, -(CONST_APTR)glue_objc_loadWeak, -(CONST_APTR)glue_objc_copyWeak, -(CONST_APTR)glue_objc_moveWeak, -(CONST_APTR)glue_sel_registerName, -(CONST_APTR)glue_sel_getName, -(CONST_APTR)glue_sel_isEqual, -(CONST_APTR)glue_objc_allocateClassPair, -(CONST_APTR)glue_objc_registerClassPair, -(CONST_APTR)glue_objc_getClassList, -(CONST_APTR)glue_objc_copyClassList, -(CONST_APTR)glue_class_isMetaClass, -(CONST_APTR)glue_class_getName, -(CONST_APTR)glue_class_getSuperclass, -(CONST_APTR)glue_class_getInstanceSize, -(CONST_APTR)glue_class_respondsToSelector, -(CONST_APTR)glue_class_conformsToProtocol, -(CONST_APTR)glue_class_getMethodImplementation, -(CONST_APTR)glue_class_getMethodImplementation_stret, -(CONST_APTR)glue_class_getInstanceMethod, -(CONST_APTR)glue_class_addMethod, -(CONST_APTR)glue_class_replaceMethod, -(CONST_APTR)glue_object_getClass, -(CONST_APTR)glue_object_setClass, -(CONST_APTR)glue_object_getClassName, -(CONST_APTR)glue_protocol_getName, -(CONST_APTR)glue_protocol_isEqual, -(CONST_APTR)glue_protocol_conformsToProtocol, -(CONST_APTR)glue_objc_setUncaughtExceptionHandler, -(CONST_APTR)glue_objc_setForwardHandler, -(CONST_APTR)glue_objc_setEnumerationMutationHandler, -(CONST_APTR)glue_objc_constructInstance, -(CONST_APTR)glue_objc_deinit, -(CONST_APTR)glue_class_copyIvarList, -(CONST_APTR)glue_ivar_getName, -(CONST_APTR)glue_ivar_getTypeEncoding, -(CONST_APTR)glue_ivar_getOffset, -(CONST_APTR)glue_class_copyMethodList, -(CONST_APTR)glue_method_getName, -(CONST_APTR)glue_method_getTypeEncoding, -(CONST_APTR)glue_class_copyPropertyList, -(CONST_APTR)glue_property_getName, -(CONST_APTR)glue_property_copyAttributeValue, -(CONST_APTR)glue_objc_destructInstance, -(CONST_APTR)glue_objc_autoreleasePoolPush, -(CONST_APTR)glue_objc_autoreleasePoolPop, -(CONST_APTR)glue__objc_rootAutorelease, -(CONST_APTR)glue_objc_hashtable_new, -(CONST_APTR)glue_objc_hashtable_set, -(CONST_APTR)glue_objc_hashtable_get, -(CONST_APTR)glue_objc_hashtable_delete, -(CONST_APTR)glue_objc_hashtable_free, -(CONST_APTR)glue_objc_setTaggedPointerSecret, -(CONST_APTR)glue_objc_registerTaggedPointerClass, -(CONST_APTR)glue_object_isTaggedPointer, -(CONST_APTR)glue_object_getTaggedPointerValue, -(CONST_APTR)glue_objc_createTaggedPointer, DELETED src/runtime/amiga-glue.h Index: src/runtime/amiga-glue.h ================================================================== --- src/runtime/amiga-glue.h +++ src/runtime/amiga-glue.h @@ -1,119 +0,0 @@ -/* - * Copyright (c) 2008-2023 Jonathan Schleifer - * - * All rights reserved. - * - * This file is part of ObjFW. It may be distributed under the terms of the - * Q Public License 1.0, which can be found in the file LICENSE.QPL included in - * the packaging of this file. - * - * Alternatively, it may be distributed under the terms of the GNU General - * Public License, either version 2 or 3, which can be found in the file - * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this - * file. - */ - -/* This file is automatically generated from amiga-library.xml */ - -#import "ObjFWRT.h" -#import "private.h" - -#ifdef OF_AMIGAOS_M68K -# define PPC_PARAMS(...) (void) -# define M68K_ARG(type, name, reg) \ - register type reg##name __asm__(#reg); \ - type name = reg##name; -#else -# define PPC_PARAMS(...) (__VA_ARGS__) -# define M68K_ARG(...) -#endif - -extern bool glue_objc_init PPC_PARAMS(unsigned int version, struct objc_libc *libc); -extern void glue___objc_exec_class PPC_PARAMS(struct objc_module *_Nonnull module); -extern IMP _Nonnull glue_objc_msg_lookup PPC_PARAMS(id _Nullable object, SEL _Nonnull selector); -extern IMP _Nonnull glue_objc_msg_lookup_stret PPC_PARAMS(id _Nullable object, SEL _Nonnull selector); -extern IMP _Nonnull glue_objc_msg_lookup_super PPC_PARAMS(struct objc_super *_Nonnull super, SEL _Nonnull selector); -extern IMP _Nonnull glue_objc_msg_lookup_super_stret PPC_PARAMS(struct objc_super *_Nonnull super, SEL _Nonnull selector); -extern Class _Nullable glue_objc_lookUpClass PPC_PARAMS(const char *_Nonnull name); -extern Class _Nullable glue_objc_getClass PPC_PARAMS(const char *_Nonnull name); -extern Class _Nonnull glue_objc_getRequiredClass PPC_PARAMS(const char *_Nonnull name); -extern Class _Nullable glue_objc_lookup_class PPC_PARAMS(const char *_Nonnull name); -extern Class _Nonnull glue_objc_get_class PPC_PARAMS(const char *_Nonnull name); -extern void glue_objc_exception_throw PPC_PARAMS(id _Nonnull object); -extern int glue_objc_sync_enter PPC_PARAMS(id _Nullable object); -extern int glue_objc_sync_exit PPC_PARAMS(id _Nullable object); -extern id _Nullable glue_objc_getProperty PPC_PARAMS(id _Nonnull self, SEL _Nonnull _cmd, ptrdiff_t offset, bool atomic); -extern void glue_objc_setProperty PPC_PARAMS(id _Nonnull self, SEL _Nonnull _cmd, ptrdiff_t offset, id _Nullable value, bool atomic, signed char copy); -extern void glue_objc_getPropertyStruct PPC_PARAMS(void *_Nonnull dest, const void *_Nonnull src, ptrdiff_t size, bool atomic, bool strong); -extern void glue_objc_setPropertyStruct PPC_PARAMS(void *_Nonnull dest, const void *_Nonnull src, ptrdiff_t size, bool atomic, bool strong); -extern void glue_objc_enumerationMutation PPC_PARAMS(id _Nonnull object); -extern int glue___gnu_objc_personality PPC_PARAMS(int version, int actions, uint64_t *_Nonnull exClass, void *_Nonnull ex, void *_Nonnull ctx); -extern id _Nullable glue_objc_retain PPC_PARAMS(id _Nullable object); -extern id _Nullable glue_objc_retainBlock PPC_PARAMS(id _Nullable block); -extern id _Nullable glue_objc_retainAutorelease PPC_PARAMS(id _Nullable object); -extern void glue_objc_release PPC_PARAMS(id _Nullable object); -extern id _Nullable glue_objc_autorelease PPC_PARAMS(id _Nullable object); -extern id _Nullable glue_objc_autoreleaseReturnValue PPC_PARAMS(id _Nullable object); -extern id _Nullable glue_objc_retainAutoreleaseReturnValue PPC_PARAMS(id _Nullable object); -extern id _Nullable glue_objc_retainAutoreleasedReturnValue PPC_PARAMS(id _Nullable object); -extern id _Nullable glue_objc_storeStrong PPC_PARAMS(id _Nullable *_Nonnull object, id _Nullable value); -extern id _Nullable glue_objc_storeWeak PPC_PARAMS(id _Nullable *_Nonnull object, id _Nullable value); -extern id _Nullable glue_objc_loadWeakRetained PPC_PARAMS(id _Nullable *_Nonnull object); -extern id _Nullable glue_objc_initWeak PPC_PARAMS(id _Nullable *_Nonnull object, id _Nullable value); -extern void glue_objc_destroyWeak PPC_PARAMS(id _Nullable *_Nonnull object); -extern id _Nullable glue_objc_loadWeak PPC_PARAMS(id _Nullable *_Nonnull object); -extern void glue_objc_copyWeak PPC_PARAMS(id _Nullable *_Nonnull dest, id _Nullable *_Nonnull src); -extern void glue_objc_moveWeak PPC_PARAMS(id _Nullable *_Nonnull dest, id _Nullable *_Nonnull src); -extern SEL _Nonnull glue_sel_registerName PPC_PARAMS(const char *_Nonnull name); -extern const char *_Nonnull glue_sel_getName PPC_PARAMS(SEL _Nonnull selector); -extern bool glue_sel_isEqual PPC_PARAMS(SEL _Nonnull selector1, SEL _Nonnull selector2); -extern Class _Nonnull glue_objc_allocateClassPair PPC_PARAMS(Class _Nullable superclass, const char *_Nonnull name, size_t extraBytes); -extern void glue_objc_registerClassPair PPC_PARAMS(Class _Nonnull class); -extern unsigned int glue_objc_getClassList PPC_PARAMS(Class _Nonnull *_Nullable buffer, unsigned int count); -extern Class _Nonnull *_Nonnull glue_objc_copyClassList PPC_PARAMS(unsigned int *_Nullable length); -extern bool glue_class_isMetaClass PPC_PARAMS(Class _Nullable class); -extern const char *_Nullable glue_class_getName PPC_PARAMS(Class _Nullable class); -extern Class _Nullable glue_class_getSuperclass PPC_PARAMS(Class _Nullable class); -extern unsigned long glue_class_getInstanceSize PPC_PARAMS(Class _Nullable class); -extern bool glue_class_respondsToSelector PPC_PARAMS(Class _Nullable class, SEL _Nonnull selector); -extern bool glue_class_conformsToProtocol PPC_PARAMS(Class _Nullable class, Protocol *_Nonnull p); -extern IMP _Nullable glue_class_getMethodImplementation PPC_PARAMS(Class _Nullable class, SEL _Nonnull selector); -extern IMP _Nullable glue_class_getMethodImplementation_stret PPC_PARAMS(Class _Nullable class, SEL _Nonnull selector); -extern Method _Nullable glue_class_getInstanceMethod PPC_PARAMS(Class _Nullable class, SEL _Nonnull selector); -extern bool glue_class_addMethod PPC_PARAMS(Class _Nonnull class, SEL _Nonnull selector, IMP _Nonnull implementation, const char *_Nullable typeEncoding); -extern IMP _Nullable glue_class_replaceMethod PPC_PARAMS(Class _Nonnull class, SEL _Nonnull selector, IMP _Nonnull implementation, const char *_Nullable typeEncoding); -extern Class _Nullable glue_object_getClass PPC_PARAMS(id _Nullable object); -extern Class _Nullable glue_object_setClass PPC_PARAMS(id _Nullable object, Class _Nonnull class); -extern const char *_Nullable glue_object_getClassName PPC_PARAMS(id _Nullable object); -extern const char *_Nonnull glue_protocol_getName PPC_PARAMS(Protocol *_Nonnull protocol); -extern bool glue_protocol_isEqual PPC_PARAMS(Protocol *_Nonnull protocol1, Protocol *_Nonnull protocol2); -extern bool glue_protocol_conformsToProtocol PPC_PARAMS(Protocol *_Nonnull protocol1, Protocol *_Nonnull protocol2); -extern _Nullable objc_uncaught_exception_handler glue_objc_setUncaughtExceptionHandler PPC_PARAMS(objc_uncaught_exception_handler _Nullable handler); -extern void glue_objc_setForwardHandler PPC_PARAMS(IMP _Nullable forward, IMP _Nullable stretForward); -extern void glue_objc_setEnumerationMutationHandler PPC_PARAMS(objc_enumeration_mutation_handler _Nullable hadler); -extern id _Nullable glue_objc_constructInstance PPC_PARAMS(Class _Nullable class, void *_Nullable bytes); -extern void glue_objc_deinit(void); -extern Ivar _Nullable *_Nullable glue_class_copyIvarList PPC_PARAMS(Class _Nullable class, unsigned int *_Nullable outCount); -extern const char *_Nonnull glue_ivar_getName PPC_PARAMS(Ivar _Nonnull ivar); -extern const char *_Nonnull glue_ivar_getTypeEncoding PPC_PARAMS(Ivar _Nonnull ivar); -extern ptrdiff_t glue_ivar_getOffset PPC_PARAMS(Ivar _Nonnull ivar); -extern Method _Nullable *_Nullable glue_class_copyMethodList PPC_PARAMS(Class _Nullable class, unsigned int *_Nullable outCount); -extern SEL _Nonnull glue_method_getName PPC_PARAMS(Method _Nonnull method); -extern const char *_Nullable glue_method_getTypeEncoding PPC_PARAMS(Method _Nonnull method); -extern objc_property_t _Nullable *_Nullable glue_class_copyPropertyList PPC_PARAMS(Class _Nullable class, unsigned int *_Nullable outCount); -extern const char *_Nonnull glue_property_getName PPC_PARAMS(objc_property_t _Nonnull property); -extern char *_Nullable glue_property_copyAttributeValue PPC_PARAMS(objc_property_t _Nonnull property, const char *_Nonnull name); -extern void *_Nullable glue_objc_destructInstance PPC_PARAMS(id _Nullable object); -extern void *_Null_unspecified glue_objc_autoreleasePoolPush(void); -extern void glue_objc_autoreleasePoolPop PPC_PARAMS(void *_Null_unspecified pool); -extern id _Nullable glue__objc_rootAutorelease PPC_PARAMS(id _Nullable object); -extern struct objc_hashtable *_Nonnull glue_objc_hashtable_new PPC_PARAMS(objc_hashtable_hash_func hash, objc_hashtable_equal_func equal, uint32_t size); -extern void glue_objc_hashtable_set PPC_PARAMS(struct objc_hashtable *_Nonnull table, const void *_Nonnull key, const void *_Nonnull object); -extern void *_Nullable glue_objc_hashtable_get PPC_PARAMS(struct objc_hashtable *_Nonnull table, const void *_Nonnull key); -extern void glue_objc_hashtable_delete PPC_PARAMS(struct objc_hashtable *_Nonnull table, const void *_Nonnull key); -extern void glue_objc_hashtable_free PPC_PARAMS(struct objc_hashtable *_Nonnull table); -extern void glue_objc_setTaggedPointerSecret PPC_PARAMS(uintptr_t secret); -extern int glue_objc_registerTaggedPointerClass PPC_PARAMS(Class _Nonnull class); -extern bool glue_object_isTaggedPointer PPC_PARAMS(id _Nullable object); -extern uintptr_t glue_object_getTaggedPointerValue PPC_PARAMS(id _Nonnull object); -extern id _Nullable glue_objc_createTaggedPointer PPC_PARAMS(int class, uintptr_t value); DELETED src/runtime/amiga-glue.m Index: src/runtime/amiga-glue.m ================================================================== --- src/runtime/amiga-glue.m +++ src/runtime/amiga-glue.m @@ -1,800 +0,0 @@ -/* - * Copyright (c) 2008-2023 Jonathan Schleifer - * - * All rights reserved. - * - * This file is part of ObjFW. It may be distributed under the terms of the - * Q Public License 1.0, which can be found in the file LICENSE.QPL included in - * the packaging of this file. - * - * Alternatively, it may be distributed under the terms of the GNU General - * Public License, either version 2 or 3, which can be found in the file - * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this - * file. - */ - -/* This file is automatically generated from amiga-library.xml */ - -#include "config.h" - -#import "amiga-glue.h" - -#ifdef OF_MORPHOS -/* All __saveds functions in this file need to use the SysV ABI */ -__asm__ ( - ".section .text\n" - ".align 2\n" - "__restore_r13:\n" - " lwz %r13, 44(%r12)\n" - " blr\n" -); -#endif - -bool __saveds -glue_objc_init PPC_PARAMS(unsigned int version, struct objc_libc *libc) -{ - M68K_ARG(unsigned int, version, d0) - M68K_ARG(struct objc_libc *, libc, a0) - - return objc_init(version, libc); -} - -void __saveds -glue___objc_exec_class PPC_PARAMS(struct objc_module *_Nonnull module) -{ - M68K_ARG(struct objc_module *_Nonnull, module, a0) - - __objc_exec_class(module); -} - -IMP _Nonnull __saveds -glue_objc_msg_lookup PPC_PARAMS(id _Nullable object, SEL _Nonnull selector) -{ - M68K_ARG(id _Nullable, object, a0) - M68K_ARG(SEL _Nonnull, selector, a1) - - return objc_msg_lookup(object, selector); -} - -IMP _Nonnull __saveds -glue_objc_msg_lookup_stret PPC_PARAMS(id _Nullable object, SEL _Nonnull selector) -{ - M68K_ARG(id _Nullable, object, a0) - M68K_ARG(SEL _Nonnull, selector, a1) - - return objc_msg_lookup_stret(object, selector); -} - -IMP _Nonnull __saveds -glue_objc_msg_lookup_super PPC_PARAMS(struct objc_super *_Nonnull super, SEL _Nonnull selector) -{ - M68K_ARG(struct objc_super *_Nonnull, super, a0) - M68K_ARG(SEL _Nonnull, selector, a1) - - return objc_msg_lookup_super(super, selector); -} - -IMP _Nonnull __saveds -glue_objc_msg_lookup_super_stret PPC_PARAMS(struct objc_super *_Nonnull super, SEL _Nonnull selector) -{ - M68K_ARG(struct objc_super *_Nonnull, super, a0) - M68K_ARG(SEL _Nonnull, selector, a1) - - return objc_msg_lookup_super_stret(super, selector); -} - -Class _Nullable __saveds -glue_objc_lookUpClass PPC_PARAMS(const char *_Nonnull name) -{ - M68K_ARG(const char *_Nonnull, name, a0) - - return objc_lookUpClass(name); -} - -Class _Nullable __saveds -glue_objc_getClass PPC_PARAMS(const char *_Nonnull name) -{ - M68K_ARG(const char *_Nonnull, name, a0) - - return objc_getClass(name); -} - -Class _Nonnull __saveds -glue_objc_getRequiredClass PPC_PARAMS(const char *_Nonnull name) -{ - M68K_ARG(const char *_Nonnull, name, a0) - - return objc_getRequiredClass(name); -} - -Class _Nullable __saveds -glue_objc_lookup_class PPC_PARAMS(const char *_Nonnull name) -{ - M68K_ARG(const char *_Nonnull, name, a0) - - return objc_lookup_class(name); -} - -Class _Nonnull __saveds -glue_objc_get_class PPC_PARAMS(const char *_Nonnull name) -{ - M68K_ARG(const char *_Nonnull, name, a0) - - return objc_get_class(name); -} - -void __saveds -glue_objc_exception_throw PPC_PARAMS(id _Nonnull object) -{ - M68K_ARG(id _Nonnull, object, a0) - - objc_exception_throw(object); -} - -int __saveds -glue_objc_sync_enter PPC_PARAMS(id _Nullable object) -{ - M68K_ARG(id _Nullable, object, a0) - - return objc_sync_enter(object); -} - -int __saveds -glue_objc_sync_exit PPC_PARAMS(id _Nullable object) -{ - M68K_ARG(id _Nullable, object, a0) - - return objc_sync_exit(object); -} - -id _Nullable __saveds -glue_objc_getProperty PPC_PARAMS(id _Nonnull self, SEL _Nonnull _cmd, ptrdiff_t offset, bool atomic) -{ - M68K_ARG(id _Nonnull, self, a0) - M68K_ARG(SEL _Nonnull, _cmd, a1) - M68K_ARG(ptrdiff_t, offset, d0) - M68K_ARG(bool, atomic, d1) - - return objc_getProperty(self, _cmd, offset, atomic); -} - -void __saveds -glue_objc_setProperty PPC_PARAMS(id _Nonnull self, SEL _Nonnull _cmd, ptrdiff_t offset, id _Nullable value, bool atomic, signed char copy) -{ - M68K_ARG(id _Nonnull, self, a0) - M68K_ARG(SEL _Nonnull, _cmd, a1) - M68K_ARG(ptrdiff_t, offset, d0) - M68K_ARG(id _Nullable, value, a2) - M68K_ARG(bool, atomic, d1) - M68K_ARG(signed char, copy, d2) - - objc_setProperty(self, _cmd, offset, value, atomic, copy); -} - -void __saveds -glue_objc_getPropertyStruct PPC_PARAMS(void *_Nonnull dest, const void *_Nonnull src, ptrdiff_t size, bool atomic, bool strong) -{ - M68K_ARG(void *_Nonnull, dest, a0) - M68K_ARG(const void *_Nonnull, src, a1) - M68K_ARG(ptrdiff_t, size, d0) - M68K_ARG(bool, atomic, d1) - M68K_ARG(bool, strong, d2) - - objc_getPropertyStruct(dest, src, size, atomic, strong); -} - -void __saveds -glue_objc_setPropertyStruct PPC_PARAMS(void *_Nonnull dest, const void *_Nonnull src, ptrdiff_t size, bool atomic, bool strong) -{ - M68K_ARG(void *_Nonnull, dest, a0) - M68K_ARG(const void *_Nonnull, src, a1) - M68K_ARG(ptrdiff_t, size, d0) - M68K_ARG(bool, atomic, d1) - M68K_ARG(bool, strong, d2) - - objc_setPropertyStruct(dest, src, size, atomic, strong); -} - -void __saveds -glue_objc_enumerationMutation PPC_PARAMS(id _Nonnull object) -{ - M68K_ARG(id _Nonnull, object, a0) - - objc_enumerationMutation(object); -} - -int __saveds -glue___gnu_objc_personality PPC_PARAMS(int version, int actions, uint64_t *_Nonnull exClass, void *_Nonnull ex, void *_Nonnull ctx) -{ - M68K_ARG(int, version, d0) - M68K_ARG(int, actions, d1) - M68K_ARG(uint64_t *_Nonnull, exClass, d2) - M68K_ARG(void *_Nonnull, ex, a0) - M68K_ARG(void *_Nonnull, ctx, a1) - - return __gnu_objc_personality(version, actions, exClass, ex, ctx); -} - -id _Nullable __saveds -glue_objc_retain PPC_PARAMS(id _Nullable object) -{ - M68K_ARG(id _Nullable, object, a0) - - return objc_retain(object); -} - -id _Nullable __saveds -glue_objc_retainBlock PPC_PARAMS(id _Nullable block) -{ - M68K_ARG(id _Nullable, block, a0) - - return objc_retainBlock(block); -} - -id _Nullable __saveds -glue_objc_retainAutorelease PPC_PARAMS(id _Nullable object) -{ - M68K_ARG(id _Nullable, object, a0) - - return objc_retainAutorelease(object); -} - -void __saveds -glue_objc_release PPC_PARAMS(id _Nullable object) -{ - M68K_ARG(id _Nullable, object, a0) - - objc_release(object); -} - -id _Nullable __saveds -glue_objc_autorelease PPC_PARAMS(id _Nullable object) -{ - M68K_ARG(id _Nullable, object, a0) - - return objc_autorelease(object); -} - -id _Nullable __saveds -glue_objc_autoreleaseReturnValue PPC_PARAMS(id _Nullable object) -{ - M68K_ARG(id _Nullable, object, a0) - - return objc_autoreleaseReturnValue(object); -} - -id _Nullable __saveds -glue_objc_retainAutoreleaseReturnValue PPC_PARAMS(id _Nullable object) -{ - M68K_ARG(id _Nullable, object, a0) - - return objc_retainAutoreleaseReturnValue(object); -} - -id _Nullable __saveds -glue_objc_retainAutoreleasedReturnValue PPC_PARAMS(id _Nullable object) -{ - M68K_ARG(id _Nullable, object, a0) - - return objc_retainAutoreleasedReturnValue(object); -} - -id _Nullable __saveds -glue_objc_storeStrong PPC_PARAMS(id _Nullable *_Nonnull object, id _Nullable value) -{ - M68K_ARG(id _Nullable *_Nonnull, object, a0) - M68K_ARG(id _Nullable, value, a1) - - return objc_storeStrong(object, value); -} - -id _Nullable __saveds -glue_objc_storeWeak PPC_PARAMS(id _Nullable *_Nonnull object, id _Nullable value) -{ - M68K_ARG(id _Nullable *_Nonnull, object, a0) - M68K_ARG(id _Nullable, value, a1) - - return objc_storeWeak(object, value); -} - -id _Nullable __saveds -glue_objc_loadWeakRetained PPC_PARAMS(id _Nullable *_Nonnull object) -{ - M68K_ARG(id _Nullable *_Nonnull, object, a0) - - return objc_loadWeakRetained(object); -} - -id _Nullable __saveds -glue_objc_initWeak PPC_PARAMS(id _Nullable *_Nonnull object, id _Nullable value) -{ - M68K_ARG(id _Nullable *_Nonnull, object, a0) - M68K_ARG(id _Nullable, value, a1) - - return objc_initWeak(object, value); -} - -void __saveds -glue_objc_destroyWeak PPC_PARAMS(id _Nullable *_Nonnull object) -{ - M68K_ARG(id _Nullable *_Nonnull, object, a0) - - objc_destroyWeak(object); -} - -id _Nullable __saveds -glue_objc_loadWeak PPC_PARAMS(id _Nullable *_Nonnull object) -{ - M68K_ARG(id _Nullable *_Nonnull, object, a0) - - return objc_loadWeak(object); -} - -void __saveds -glue_objc_copyWeak PPC_PARAMS(id _Nullable *_Nonnull dest, id _Nullable *_Nonnull src) -{ - M68K_ARG(id _Nullable *_Nonnull, dest, a0) - M68K_ARG(id _Nullable *_Nonnull, src, a1) - - objc_copyWeak(dest, src); -} - -void __saveds -glue_objc_moveWeak PPC_PARAMS(id _Nullable *_Nonnull dest, id _Nullable *_Nonnull src) -{ - M68K_ARG(id _Nullable *_Nonnull, dest, a0) - M68K_ARG(id _Nullable *_Nonnull, src, a1) - - objc_moveWeak(dest, src); -} - -SEL _Nonnull __saveds -glue_sel_registerName PPC_PARAMS(const char *_Nonnull name) -{ - M68K_ARG(const char *_Nonnull, name, a0) - - return sel_registerName(name); -} - -const char *_Nonnull __saveds -glue_sel_getName PPC_PARAMS(SEL _Nonnull selector) -{ - M68K_ARG(SEL _Nonnull, selector, a0) - - return sel_getName(selector); -} - -bool __saveds -glue_sel_isEqual PPC_PARAMS(SEL _Nonnull selector1, SEL _Nonnull selector2) -{ - M68K_ARG(SEL _Nonnull, selector1, a0) - M68K_ARG(SEL _Nonnull, selector2, a1) - - return sel_isEqual(selector1, selector2); -} - -Class _Nonnull __saveds -glue_objc_allocateClassPair PPC_PARAMS(Class _Nullable superclass, const char *_Nonnull name, size_t extraBytes) -{ - M68K_ARG(Class _Nullable, superclass, a0) - M68K_ARG(const char *_Nonnull, name, a1) - M68K_ARG(size_t, extraBytes, d0) - - return objc_allocateClassPair(superclass, name, extraBytes); -} - -void __saveds -glue_objc_registerClassPair PPC_PARAMS(Class _Nonnull class) -{ - M68K_ARG(Class _Nonnull, class, a0) - - objc_registerClassPair(class); -} - -unsigned int __saveds -glue_objc_getClassList PPC_PARAMS(Class _Nonnull *_Nullable buffer, unsigned int count) -{ - M68K_ARG(Class _Nonnull *_Nullable, buffer, a0) - M68K_ARG(unsigned int, count, d0) - - return objc_getClassList(buffer, count); -} - -Class _Nonnull *_Nonnull __saveds -glue_objc_copyClassList PPC_PARAMS(unsigned int *_Nullable length) -{ - M68K_ARG(unsigned int *_Nullable, length, a0) - - return objc_copyClassList(length); -} - -bool __saveds -glue_class_isMetaClass PPC_PARAMS(Class _Nullable class) -{ - M68K_ARG(Class _Nullable, class, a0) - - return class_isMetaClass(class); -} - -const char *_Nullable __saveds -glue_class_getName PPC_PARAMS(Class _Nullable class) -{ - M68K_ARG(Class _Nullable, class, a0) - - return class_getName(class); -} - -Class _Nullable __saveds -glue_class_getSuperclass PPC_PARAMS(Class _Nullable class) -{ - M68K_ARG(Class _Nullable, class, a0) - - return class_getSuperclass(class); -} - -unsigned long __saveds -glue_class_getInstanceSize PPC_PARAMS(Class _Nullable class) -{ - M68K_ARG(Class _Nullable, class, a0) - - return class_getInstanceSize(class); -} - -bool __saveds -glue_class_respondsToSelector PPC_PARAMS(Class _Nullable class, SEL _Nonnull selector) -{ - M68K_ARG(Class _Nullable, class, a0) - M68K_ARG(SEL _Nonnull, selector, a1) - - return class_respondsToSelector(class, selector); -} - -bool __saveds -glue_class_conformsToProtocol PPC_PARAMS(Class _Nullable class, Protocol *_Nonnull p) -{ - M68K_ARG(Class _Nullable, class, a0) - M68K_ARG(Protocol *_Nonnull, p, a1) - - return class_conformsToProtocol(class, p); -} - -IMP _Nullable __saveds -glue_class_getMethodImplementation PPC_PARAMS(Class _Nullable class, SEL _Nonnull selector) -{ - M68K_ARG(Class _Nullable, class, a0) - M68K_ARG(SEL _Nonnull, selector, a1) - - return class_getMethodImplementation(class, selector); -} - -IMP _Nullable __saveds -glue_class_getMethodImplementation_stret PPC_PARAMS(Class _Nullable class, SEL _Nonnull selector) -{ - M68K_ARG(Class _Nullable, class, a0) - M68K_ARG(SEL _Nonnull, selector, a1) - - return class_getMethodImplementation_stret(class, selector); -} - -Method _Nullable __saveds -glue_class_getInstanceMethod PPC_PARAMS(Class _Nullable class, SEL _Nonnull selector) -{ - M68K_ARG(Class _Nullable, class, a0) - M68K_ARG(SEL _Nonnull, selector, a1) - - return class_getInstanceMethod(class, selector); -} - -bool __saveds -glue_class_addMethod PPC_PARAMS(Class _Nonnull class, SEL _Nonnull selector, IMP _Nonnull implementation, const char *_Nullable typeEncoding) -{ - M68K_ARG(Class _Nonnull, class, a0) - M68K_ARG(SEL _Nonnull, selector, a1) - M68K_ARG(IMP _Nonnull, implementation, a2) - M68K_ARG(const char *_Nullable, typeEncoding, a3) - - return class_addMethod(class, selector, implementation, typeEncoding); -} - -IMP _Nullable __saveds -glue_class_replaceMethod PPC_PARAMS(Class _Nonnull class, SEL _Nonnull selector, IMP _Nonnull implementation, const char *_Nullable typeEncoding) -{ - M68K_ARG(Class _Nonnull, class, a0) - M68K_ARG(SEL _Nonnull, selector, a1) - M68K_ARG(IMP _Nonnull, implementation, a2) - M68K_ARG(const char *_Nullable, typeEncoding, a3) - - return class_replaceMethod(class, selector, implementation, typeEncoding); -} - -Class _Nullable __saveds -glue_object_getClass PPC_PARAMS(id _Nullable object) -{ - M68K_ARG(id _Nullable, object, a0) - - return object_getClass(object); -} - -Class _Nullable __saveds -glue_object_setClass PPC_PARAMS(id _Nullable object, Class _Nonnull class) -{ - M68K_ARG(id _Nullable, object, a0) - M68K_ARG(Class _Nonnull, class, a1) - - return object_setClass(object, class); -} - -const char *_Nullable __saveds -glue_object_getClassName PPC_PARAMS(id _Nullable object) -{ - M68K_ARG(id _Nullable, object, a0) - - return object_getClassName(object); -} - -const char *_Nonnull __saveds -glue_protocol_getName PPC_PARAMS(Protocol *_Nonnull protocol) -{ - M68K_ARG(Protocol *_Nonnull, protocol, a0) - - return protocol_getName(protocol); -} - -bool __saveds -glue_protocol_isEqual PPC_PARAMS(Protocol *_Nonnull protocol1, Protocol *_Nonnull protocol2) -{ - M68K_ARG(Protocol *_Nonnull, protocol1, a0) - M68K_ARG(Protocol *_Nonnull, protocol2, a1) - - return protocol_isEqual(protocol1, protocol2); -} - -bool __saveds -glue_protocol_conformsToProtocol PPC_PARAMS(Protocol *_Nonnull protocol1, Protocol *_Nonnull protocol2) -{ - M68K_ARG(Protocol *_Nonnull, protocol1, a0) - M68K_ARG(Protocol *_Nonnull, protocol2, a1) - - return protocol_conformsToProtocol(protocol1, protocol2); -} - -_Nullable objc_uncaught_exception_handler __saveds -glue_objc_setUncaughtExceptionHandler PPC_PARAMS(objc_uncaught_exception_handler _Nullable handler) -{ - M68K_ARG(objc_uncaught_exception_handler _Nullable, handler, a0) - - return objc_setUncaughtExceptionHandler(handler); -} - -void __saveds -glue_objc_setForwardHandler PPC_PARAMS(IMP _Nullable forward, IMP _Nullable stretForward) -{ - M68K_ARG(IMP _Nullable, forward, a0) - M68K_ARG(IMP _Nullable, stretForward, a1) - - objc_setForwardHandler(forward, stretForward); -} - -void __saveds -glue_objc_setEnumerationMutationHandler PPC_PARAMS(objc_enumeration_mutation_handler _Nullable hadler) -{ - M68K_ARG(objc_enumeration_mutation_handler _Nullable, hadler, a0) - - objc_setEnumerationMutationHandler(hadler); -} - -id _Nullable __saveds -glue_objc_constructInstance PPC_PARAMS(Class _Nullable class, void *_Nullable bytes) -{ - M68K_ARG(Class _Nullable, class, a0) - M68K_ARG(void *_Nullable, bytes, a1) - - return objc_constructInstance(class, bytes); -} - -void __saveds -glue_objc_deinit(void) -{ - objc_deinit(); -} - -Ivar _Nullable *_Nullable __saveds -glue_class_copyIvarList PPC_PARAMS(Class _Nullable class, unsigned int *_Nullable outCount) -{ - M68K_ARG(Class _Nullable, class, a0) - M68K_ARG(unsigned int *_Nullable, outCount, a1) - - return class_copyIvarList(class, outCount); -} - -const char *_Nonnull __saveds -glue_ivar_getName PPC_PARAMS(Ivar _Nonnull ivar) -{ - M68K_ARG(Ivar _Nonnull, ivar, a0) - - return ivar_getName(ivar); -} - -const char *_Nonnull __saveds -glue_ivar_getTypeEncoding PPC_PARAMS(Ivar _Nonnull ivar) -{ - M68K_ARG(Ivar _Nonnull, ivar, a0) - - return ivar_getTypeEncoding(ivar); -} - -ptrdiff_t __saveds -glue_ivar_getOffset PPC_PARAMS(Ivar _Nonnull ivar) -{ - M68K_ARG(Ivar _Nonnull, ivar, a0) - - return ivar_getOffset(ivar); -} - -Method _Nullable *_Nullable __saveds -glue_class_copyMethodList PPC_PARAMS(Class _Nullable class, unsigned int *_Nullable outCount) -{ - M68K_ARG(Class _Nullable, class, a0) - M68K_ARG(unsigned int *_Nullable, outCount, a1) - - return class_copyMethodList(class, outCount); -} - -SEL _Nonnull __saveds -glue_method_getName PPC_PARAMS(Method _Nonnull method) -{ - M68K_ARG(Method _Nonnull, method, a0) - - return method_getName(method); -} - -const char *_Nullable __saveds -glue_method_getTypeEncoding PPC_PARAMS(Method _Nonnull method) -{ - M68K_ARG(Method _Nonnull, method, a0) - - return method_getTypeEncoding(method); -} - -objc_property_t _Nullable *_Nullable __saveds -glue_class_copyPropertyList PPC_PARAMS(Class _Nullable class, unsigned int *_Nullable outCount) -{ - M68K_ARG(Class _Nullable, class, a0) - M68K_ARG(unsigned int *_Nullable, outCount, a1) - - return class_copyPropertyList(class, outCount); -} - -const char *_Nonnull __saveds -glue_property_getName PPC_PARAMS(objc_property_t _Nonnull property) -{ - M68K_ARG(objc_property_t _Nonnull, property, a0) - - return property_getName(property); -} - -char *_Nullable __saveds -glue_property_copyAttributeValue PPC_PARAMS(objc_property_t _Nonnull property, const char *_Nonnull name) -{ - M68K_ARG(objc_property_t _Nonnull, property, a0) - M68K_ARG(const char *_Nonnull, name, a1) - - return property_copyAttributeValue(property, name); -} - -void *_Nullable __saveds -glue_objc_destructInstance PPC_PARAMS(id _Nullable object) -{ - M68K_ARG(id _Nullable, object, a0) - - return objc_destructInstance(object); -} - -void *_Null_unspecified __saveds -glue_objc_autoreleasePoolPush(void) -{ - return objc_autoreleasePoolPush(); -} - -void __saveds -glue_objc_autoreleasePoolPop PPC_PARAMS(void *_Null_unspecified pool) -{ - M68K_ARG(void *_Null_unspecified, pool, a0) - - objc_autoreleasePoolPop(pool); -} - -id _Nullable __saveds -glue__objc_rootAutorelease PPC_PARAMS(id _Nullable object) -{ - M68K_ARG(id _Nullable, object, a0) - - return _objc_rootAutorelease(object); -} - -struct objc_hashtable *_Nonnull __saveds -glue_objc_hashtable_new PPC_PARAMS(objc_hashtable_hash_func hash, objc_hashtable_equal_func equal, uint32_t size) -{ - M68K_ARG(objc_hashtable_hash_func, hash, a0) - M68K_ARG(objc_hashtable_equal_func, equal, a1) - M68K_ARG(uint32_t, size, d0) - - return objc_hashtable_new(hash, equal, size); -} - -void __saveds -glue_objc_hashtable_set PPC_PARAMS(struct objc_hashtable *_Nonnull table, const void *_Nonnull key, const void *_Nonnull object) -{ - M68K_ARG(struct objc_hashtable *_Nonnull, table, a0) - M68K_ARG(const void *_Nonnull, key, a1) - M68K_ARG(const void *_Nonnull, object, a2) - - objc_hashtable_set(table, key, object); -} - -void *_Nullable __saveds -glue_objc_hashtable_get PPC_PARAMS(struct objc_hashtable *_Nonnull table, const void *_Nonnull key) -{ - M68K_ARG(struct objc_hashtable *_Nonnull, table, a0) - M68K_ARG(const void *_Nonnull, key, a1) - - return objc_hashtable_get(table, key); -} - -void __saveds -glue_objc_hashtable_delete PPC_PARAMS(struct objc_hashtable *_Nonnull table, const void *_Nonnull key) -{ - M68K_ARG(struct objc_hashtable *_Nonnull, table, a0) - M68K_ARG(const void *_Nonnull, key, a1) - - objc_hashtable_delete(table, key); -} - -void __saveds -glue_objc_hashtable_free PPC_PARAMS(struct objc_hashtable *_Nonnull table) -{ - M68K_ARG(struct objc_hashtable *_Nonnull, table, a0) - - objc_hashtable_free(table); -} - -void __saveds -glue_objc_setTaggedPointerSecret PPC_PARAMS(uintptr_t secret) -{ - M68K_ARG(uintptr_t, secret, d0) - - objc_setTaggedPointerSecret(secret); -} - -int __saveds -glue_objc_registerTaggedPointerClass PPC_PARAMS(Class _Nonnull class) -{ - M68K_ARG(Class _Nonnull, class, a0) - - return objc_registerTaggedPointerClass(class); -} - -bool __saveds -glue_object_isTaggedPointer PPC_PARAMS(id _Nullable object) -{ - M68K_ARG(id _Nullable, object, a0) - - return object_isTaggedPointer(object); -} - -uintptr_t __saveds -glue_object_getTaggedPointerValue PPC_PARAMS(id _Nonnull object) -{ - M68K_ARG(id _Nonnull, object, a0) - - return object_getTaggedPointerValue(object); -} - -id _Nullable __saveds -glue_objc_createTaggedPointer PPC_PARAMS(int class, uintptr_t value) -{ - M68K_ARG(int, class, d0) - M68K_ARG(uintptr_t, value, d1) - - return objc_createTaggedPointer(class, value); -} DELETED src/runtime/amiga-library.m Index: src/runtime/amiga-library.m ================================================================== --- src/runtime/amiga-library.m +++ src/runtime/amiga-library.m @@ -1,606 +0,0 @@ -/* - * Copyright (c) 2008-2023 Jonathan Schleifer - * - * All rights reserved. - * - * This file is part of ObjFW. It may be distributed under the terms of the - * Q Public License 1.0, which can be found in the file LICENSE.QPL included in - * the packaging of this file. - * - * Alternatively, it may be distributed under the terms of the GNU General - * Public License, either version 2 or 3, which can be found in the file - * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this - * file. - */ - -#include "config.h" - -#import "ObjFWRT.h" -#import "private.h" - -#import "amiga-glue.h" - -#define Class IntuitionClass -#include -#include -#include -#include -#undef Class - -#define CONCAT_VERSION2(major, minor) #major "." #minor -#define CONCAT_VERSION(major, minor) CONCAT_VERSION2(major, minor) -#define VERSION_STRING CONCAT_VERSION(OBJFWRT_LIB_MAJOR, OBJFWRT_LIB_MINOR) - -#if defined(OF_AMIGAOS_M68K) -# define DATA_OFFSET 0x7FFE -#elif defined(OF_MORPHOS) -# define DATA_OFFSET 0x8000 -#endif - -#ifdef OF_AMIGAOS_M68K -# define OBJC_M68K_REG(reg) __asm__(#reg) -#else -# define OBJC_M68K_REG(reg) -#endif - -/* This always needs to be the first thing in the file. */ -int -_start(void) -{ - return -1; -} - -#ifdef OF_AMIGAOS_M68K -void -__init_eh(void) -{ -} -#endif - -struct ObjFWRTBase { - struct Library library; - void *segList; - struct ObjFWRTBase *parent; - char *dataSeg; - bool initialized; -}; - -#ifdef OF_AMIGAOS_M68K -extern uintptr_t __CTOR_LIST__[]; -extern const void *_EH_FRAME_BEGINS__; -extern void *_EH_FRAME_OBJECTS__; -#endif - -#ifdef OF_MORPHOS -const ULONG __abox__ = 1; -#endif -struct ExecBase *SysBase; -struct objc_libc libc; - -#if defined(OF_AMIGAOS_M68K) -__asm__ ( - ".text\n" - ".globl ___restore_a4\n" - ".align 1\n" - "___restore_a4:\n" - " movea.l 42(a6), a4\n" - " rts" -); -#elif defined(OF_MORPHOS) -/* All __saveds functions in this file need to use the M68K ABI */ -__asm__ ( - ".section .text\n" - ".align 2\n" - "__restore_r13:\n" - " lwz %r13, 56(%r2)\n" - " lwz %r13, 44(%r13)\n" - " blr\n" -); -#endif - -static OF_INLINE char * -getDataSeg(void) -{ - char *dataSeg; - -#if defined(OF_AMIGAOS_M68K) - __asm__ ( - "move.l #___a4_init, %0" - : "=r"(dataSeg) - ); -#elif defined(OF_MORPHOS) - __asm__ ( - "lis %0, __r13_init@ha\n\t" - "la %0, __r13_init@l(%0)" - : "=r"(dataSeg) - ); -#endif - - return dataSeg; -} - -static OF_INLINE size_t -getDataSize(void) -{ - size_t dataSize; - -#if defined(OF_AMIGAOS_M68K) - __asm__ ( - "move.l #___data_size, %0\n\t" - "add.l #___bss_size, %0" - : "=r"(dataSize) - ); -#elif defined(OF_MORPHOS) - __asm__ ( - "lis %0, __sdata_size@ha\n\t" - "la %0, __sdata_size@l(%0)\n\t" - "lis %%r9, __sbss_size@ha\n\t" - "la %%r9, __sbss_size@l(%%r9)\n\t" - "add %0, %0, %%r9" - : "=r"(dataSize) - :: "r9" - ); -#endif - - return dataSize; -} - -static OF_INLINE size_t * -getDataDataRelocs(void) -{ - size_t *dataDataRelocs; - -#if defined(OF_AMIGAOS_M68K) - __asm__ ( - "move.l #___datadata_relocs, %0" - : "=r"(dataDataRelocs) - ); -#elif defined(OF_MORPHOS) - __asm__ ( - "lis %0, __datadata_relocs@ha\n\t" - "la %0, __datadata_relocs@l(%0)\n\t" - : "=r"(dataDataRelocs) - ); -#endif - - return dataDataRelocs; -} - -static struct Library * -lib_init(struct ObjFWRTBase *base OBJC_M68K_REG(d0), - void *segList OBJC_M68K_REG(a0), struct ExecBase *sysBase OBJC_M68K_REG(a6)) -{ -#if defined(OF_AMIGAOS_M68K) - __asm__ __volatile__ ( - "move.l a6, _SysBase" - :: "a"(sysBase) - ); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "lis %%r9, SysBase@ha\n\t" - "stw %0, SysBase@l(%%r9)" - :: "r"(sysBase) : "r9" - ); -#endif - - base->segList = segList; - base->parent = NULL; - base->dataSeg = getDataSeg(); - - return &base->library; -} - -struct Library *__saveds -lib_open(void) -{ - OBJC_M68K_ARG(struct ObjFWRTBase *, base, a6) - - struct ObjFWRTBase *child; - size_t dataSize, *dataDataRelocs; - ptrdiff_t displacement; - - if (base->parent != NULL) - return NULL; - - base->library.lib_OpenCnt++; - base->library.lib_Flags &= ~LIBF_DELEXP; - - /* - * We cannot use malloc here, as that depends on the libc passed from - * the application. - */ - if ((child = AllocMem(base->library.lib_NegSize + - base->library.lib_PosSize, MEMF_ANY)) == NULL) { - base->library.lib_OpenCnt--; - return NULL; - } - - memcpy(child, (char *)base - base->library.lib_NegSize, - base->library.lib_NegSize + base->library.lib_PosSize); - - child = (struct ObjFWRTBase *) - ((char *)child + base->library.lib_NegSize); - child->library.lib_OpenCnt = 1; - child->parent = base; - - dataSize = getDataSize(); - - if ((child->dataSeg = AllocMem(dataSize, MEMF_ANY)) == NULL) { - FreeMem((char *)child - child->library.lib_NegSize, - child->library.lib_NegSize + child->library.lib_PosSize); - base->library.lib_OpenCnt--; - return NULL; - } - - memcpy(child->dataSeg, base->dataSeg - DATA_OFFSET, dataSize); - - dataDataRelocs = getDataDataRelocs(); - displacement = child->dataSeg - (base->dataSeg - DATA_OFFSET); - - for (size_t i = 1; i <= dataDataRelocs[0]; i++) - *(long *)(child->dataSeg + dataDataRelocs[i]) += displacement; - - child->dataSeg += DATA_OFFSET; - - return &child->library; -} - -static void * -expunge(struct ObjFWRTBase *base, struct ExecBase *sysBase) -{ -#define SysBase sysBase - void *segList; - - if (base->parent != NULL) { - base->parent->library.lib_Flags |= LIBF_DELEXP; - return 0; - } - - if (base->library.lib_OpenCnt > 0) { - base->library.lib_Flags |= LIBF_DELEXP; - return 0; - } - - segList = base->segList; - - Remove(&base->library.lib_Node); - FreeMem((char *)base - base->library.lib_NegSize, - base->library.lib_NegSize + base->library.lib_PosSize); - - return segList; -#undef SysBase -} - -static void *__saveds -lib_expunge(void) -{ - OBJC_M68K_ARG(struct ObjFWRTBase *, base, a6) - - return expunge(base, SysBase); -} - -static void *__saveds -lib_close(void) -{ - /* - * SysBase becomes invalid during this function, so we store it in - * sysBase and add a define to make the inlines use the right one. - */ - struct ExecBase *sysBase = SysBase; -#define SysBase sysBase - - OBJC_M68K_ARG(struct ObjFWRTBase *, base, a6) - - if (base->parent != NULL) { - struct ObjFWRTBase *parent; - -#ifdef OF_AMIGAOS_M68K - if (base->initialized) - for (void *const *frame = _EH_FRAME_BEGINS__; - *frame != NULL;) - libc.__deregister_frame_info(*frame++); -#endif - - parent = base->parent; - - FreeMem(base->dataSeg - DATA_OFFSET, getDataSize()); - FreeMem((char *)base - base->library.lib_NegSize, - base->library.lib_NegSize + base->library.lib_PosSize); - - base = parent; - } - - if (--base->library.lib_OpenCnt == 0 && - (base->library.lib_Flags & LIBF_DELEXP)) - return expunge(base, sysBase); - - return NULL; -#undef SysBase -} - -static void * -lib_null(void) -{ - return NULL; -} - -bool -objc_init(unsigned int version, struct objc_libc *libc_) -{ -#ifdef OF_AMIGAOS_M68K - OBJC_M68K_ARG(struct ObjFWRTBase *, base, a6) -#else - register struct ObjFWRTBase *r12 __asm__("r12"); - struct ObjFWRTBase *base = r12; -#endif -#ifdef OF_MORPHOS - void *frame; -#endif - uintptr_t *iter, *iter0; - - if (version > 1) - return false; - - memcpy(&libc, libc_, sizeof(libc)); - -#ifdef OF_AMIGAOS_M68K - for (void *const *frame = _EH_FRAME_OBJECTS__, - **object = _EH_FRAME_OBJECTS__; *frame != NULL;) - libc.__register_frame_info(*frame++, *object++); - - iter0 = &__CTOR_LIST__[1]; -#elif defined(OF_MORPHOS) - __asm__ ( - "lis %0, __EH_FRAME_BEGIN__@ha\n\t" - "la %0, __EH_FRAME_BEGIN__@l(%0)\n\t" - "lis %1, __CTOR_LIST__@ha\n\t" - "la %1, __CTOR_LIST__@l(%1)\n\t" - : "=r"(frame), "=r"(iter0) - ); - - libc.__register_frame(frame); -#endif - - for (iter = iter0; *iter != 0; iter++); - - while (iter > iter0) { - void (*ctor)(void) = (void (*)(void))*--iter; - ctor(); - } - - base->initialized = true; - - return true; -} - -void * -malloc(size_t size) -{ - return libc.malloc(size); -} - -void * -calloc(size_t count, size_t size) -{ - return libc.calloc(count, size); -} - -void * -realloc(void *ptr, size_t size) -{ - return libc.realloc(ptr, size); -} - -void -free(void *ptr) -{ - libc.free(ptr); -} - -#ifdef HAVE_SJLJ_EXCEPTIONS -int -_Unwind_SjLj_RaiseException(void *ex) -{ - return libc._Unwind_SjLj_RaiseException(ex); -} -#else -int -_Unwind_RaiseException(void *ex) -{ - return libc._Unwind_RaiseException(ex); -} -#endif - -void -_Unwind_DeleteException(void *ex) -{ - libc._Unwind_DeleteException(ex); -} - -void * -_Unwind_GetLanguageSpecificData(void *ctx) -{ - return libc._Unwind_GetLanguageSpecificData(ctx); -} - -uintptr_t -_Unwind_GetRegionStart(void *ctx) -{ - return libc._Unwind_GetRegionStart(ctx); -} - -uintptr_t -_Unwind_GetDataRelBase(void *ctx) -{ - return libc._Unwind_GetDataRelBase(ctx); -} - -uintptr_t -_Unwind_GetTextRelBase(void *ctx) -{ - return libc._Unwind_GetTextRelBase(ctx); -} - -uintptr_t -_Unwind_GetIP(void *ctx) -{ - return libc._Unwind_GetIP(ctx); -} - -uintptr_t -_Unwind_GetGR(void *ctx, int gr) -{ - return libc._Unwind_GetGR(ctx, gr); -} - -void -_Unwind_SetIP(void *ctx, uintptr_t ip) -{ - libc._Unwind_SetIP(ctx, ip); -} - -void -_Unwind_SetGR(void *ctx, int gr, uintptr_t value) -{ - libc._Unwind_SetGR(ctx, gr, value); -} - -#ifdef HAVE_SJLJ_EXCEPTIONS -void -_Unwind_SjLj_Resume(void *ex) -{ - libc._Unwind_SjLj_Resume(ex); -} -#else -void -_Unwind_Resume(void *ex) -{ - libc._Unwind_Resume(ex); -} -#endif - -#ifdef OF_AMIGAOS_M68K -int -snprintf(char *restrict str, size_t size, const char *restrict fmt, ...) -{ - va_list args; - int ret; - - va_start(args, fmt); - ret = vsnprintf(str, size, fmt, args); - va_end(args); - - return ret; -} - -int -vsnprintf(char *restrict str, size_t size, const char *restrict fmt, - va_list args) -{ - return libc.vsnprintf(str, size, fmt, args); -} -#endif - -int -atexit(void (*function)(void)) -{ - return libc.atexit(function); -} - -void -exit(int status) -{ - libc.exit(status); - - OF_UNREACHABLE -} - -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wpedantic" -static CONST_APTR functionTable[] = { -#ifdef OF_MORPHOS - (CONST_APTR)FUNCARRAY_BEGIN, - (CONST_APTR)FUNCARRAY_32BIT_NATIVE, -#endif - (CONST_APTR)lib_open, - (CONST_APTR)lib_close, - (CONST_APTR)lib_expunge, - (CONST_APTR)lib_null, -#ifdef OF_MORPHOS - (CONST_APTR)-1, - (CONST_APTR)FUNCARRAY_32BIT_SYSTEMV, -#endif -#include "amiga-funcarray.inc" - (CONST_APTR)-1, -#ifdef OF_MORPHOS - (CONST_APTR)FUNCARRAY_END -#endif -}; -#pragma GCC diagnostic pop - -static struct { - ULONG dataSize; - CONST_APTR *functionTable; - ULONG *dataTable; - struct Library *(*initFunc)( - struct ObjFWRTBase *base OBJC_M68K_REG(d0), - void *segList OBJC_M68K_REG(a0), - struct ExecBase *execBase OBJC_M68K_REG(a6)); -} init_table = { - sizeof(struct ObjFWRTBase), - functionTable, - NULL, - lib_init -}; - -struct Resident resident = { - .rt_MatchWord = RTC_MATCHWORD, - .rt_MatchTag = &resident, - .rt_EndSkip = &resident + 1, - .rt_Flags = RTF_AUTOINIT -#ifdef OF_MORPHOS - | RTF_PPC | RTF_EXTENDED -#endif - , - .rt_Version = OBJFWRT_LIB_MAJOR, - .rt_Type = NT_LIBRARY, - .rt_Pri = 0, - .rt_Name = (char *)OBJFWRT_AMIGA_LIB, - .rt_IdString = (char *)"ObjFWRT " VERSION_STRING - " \xA9 2008-2023 Jonathan Schleifer", - .rt_Init = &init_table, -#ifdef OF_MORPHOS - .rt_Revision = OBJFWRT_LIB_MINOR, - .rt_Tags = NULL, -#endif -}; - -#if defined(OF_MORPHOS) -__asm__ ( - ".section .eh_frame, \"aw\"\n" - ".globl __EH_FRAME_BEGIN__\n" - ".type __EH_FRAME_BEGIN__, @object\n" - "__EH_FRAME_BEGIN__:\n" - ".section .ctors, \"aw\"\n" - ".globl __CTOR_LIST__\n" - ".type __CTOR_LIST__, @object\n" - "__CTOR_LIST__:\n" - ".section .text" -); -#elif defined(OF_AMIGAOS_M68K) -__asm__ ( - ".section .list___EH_FRAME_BEGINS__, \"aw\"\n" - ".globl __EH_FRAME_BEGIN__\n" - ".type __EH_FRAME_BEGIN__, @object\n" - "__EH_FRAME_BEGINS__:\n" - ".section .dlist___EH_FRAME_OBJECTS__, \"aw\"\n" - ".globl __EH_FRAME_OBJECTS__\n" - ".type __EH_FRAME_OBJECTS__, @object\n" - "__EH_FRAME_OBJECTS__:\n" - ".section .list___CTOR_LIST__, \"aw\"\n" - ".globl ___CTOR_LIST__\n" - ".type ___CTOR_LIST__, @object\n" - "___CTOR_LIST__:\n" - ".section .text" -); -#endif DELETED src/runtime/amiga-library.xml Index: src/runtime/amiga-library.xml ================================================================== --- src/runtime/amiga-library.xml +++ src/runtime/amiga-library.xml @@ -1,345 +0,0 @@ - - ObjFWRT.h - private.h - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - DELETED src/runtime/linklib/Makefile Index: src/runtime/linklib/Makefile ================================================================== --- src/runtime/linklib/Makefile +++ src/runtime/linklib/Makefile @@ -1,13 +0,0 @@ -include ../../../extra.mk - -STATIC_LIB = libobjfwrt.library.a -SRCS = init.m \ - linklib.m - -include ../../../buildsys.mk - -CPPFLAGS += -I.. -I../.. -I../../.. \ - -DOBJC_COMPILING_AMIGA_LINKLIB \ - -DOBJFWRT_AMIGA_LIB=\"${OBJFWRT_AMIGA_LIB}\" \ - -DOBJFWRT_LIB_MINOR=${OBJFWRT_LIB_MINOR} -LD = ${OBJC} DELETED src/runtime/linklib/init.m Index: src/runtime/linklib/init.m ================================================================== --- src/runtime/linklib/init.m +++ src/runtime/linklib/init.m @@ -1,190 +0,0 @@ -/* - * Copyright (c) 2008-2023 Jonathan Schleifer - * - * All rights reserved. - * - * This file is part of ObjFW. It may be distributed under the terms of the - * Q Public License 1.0, which can be found in the file LICENSE.QPL included in - * the packaging of this file. - * - * Alternatively, it may be distributed under the terms of the GNU General - * Public License, either version 2 or 3, which can be found in the file - * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this - * file. - */ - -#include "config.h" - -#import "ObjFWRT.h" -#import "private.h" -#import "macros.h" - -#define Class IntuitionClass -#include -#include -#undef Class - -struct ObjFWRTBase; - -#include -#include - -#if defined(OF_AMIGAOS_M68K) -# include -#elif defined(OF_MORPHOS) -# include -#endif - -#ifdef HAVE_SJLJ_EXCEPTIONS -extern int _Unwind_SjLj_RaiseException(void *); -#else -extern int _Unwind_RaiseException(void *); -#endif -extern void _Unwind_DeleteException(void *); -extern void *_Unwind_GetLanguageSpecificData(void *); -extern uintptr_t _Unwind_GetRegionStart(void *); -extern uintptr_t _Unwind_GetDataRelBase(void *); -extern uintptr_t _Unwind_GetTextRelBase(void *); -extern uintptr_t _Unwind_GetIP(void *); -extern uintptr_t _Unwind_GetGR(void *, int); -extern void _Unwind_SetIP(void *, uintptr_t); -extern void _Unwind_SetGR(void *, int, uintptr_t); -#ifdef HAVE_SJLJ_EXCEPTIONS -extern void _Unwind_SjLj_Resume(void *); -#else -extern void _Unwind_Resume(void *); -#endif -#ifdef OF_AMIGAOS_M68K -extern void __register_frame_info(const void *, void *); -extern void *__deregister_frame_info(const void *); -#endif -#ifdef OF_MORPHOS -extern void __register_frame(void *); -extern void __deregister_frame(void *); -#endif - -struct Library *ObjFWRTBase; -void *__objc_class_name_Protocol; - -extern bool objc_init(unsigned int version, struct objc_libc *libc); - -static void -error(const char *string, ULONG arg) -{ - struct Library *IntuitionBase = OpenLibrary("intuition.library", 0); - - if (IntuitionBase != NULL) { - struct EasyStruct easy = { - .es_StructSize = sizeof(easy), - .es_Flags = 0, - .es_Title = (void *)NULL, - .es_TextFormat = (void *)string, - (void *)"OK" - }; - - EasyRequest(NULL, &easy, NULL, arg); - - CloseLibrary(IntuitionBase); - } - - exit(EXIT_FAILURE); -} - -static void __attribute__((__used__)) -ctor(void) -{ - static bool initialized = false; - struct objc_libc libc = { - .malloc = malloc, - .calloc = calloc, - .realloc = realloc, - .free = free, -#ifdef HAVE_SJLJ_EXCEPTIONS - ._Unwind_SjLj_RaiseException = _Unwind_SjLj_RaiseException, -#else - ._Unwind_RaiseException = _Unwind_RaiseException, -#endif - ._Unwind_DeleteException = _Unwind_DeleteException, - ._Unwind_GetLanguageSpecificData = - _Unwind_GetLanguageSpecificData, - ._Unwind_GetRegionStart = _Unwind_GetRegionStart, - ._Unwind_GetDataRelBase = _Unwind_GetDataRelBase, - ._Unwind_GetTextRelBase = _Unwind_GetTextRelBase, - ._Unwind_GetIP = _Unwind_GetIP, - ._Unwind_GetGR = _Unwind_GetGR, - ._Unwind_SetIP = _Unwind_SetIP, - ._Unwind_SetGR = _Unwind_SetGR, -#ifdef HAVE_SJLJ_EXCEPTIONS - ._Unwind_SjLj_Resume = _Unwind_SjLj_Resume, -#else - ._Unwind_Resume = _Unwind_Resume, -#endif -#ifdef OF_AMIGAOS_M68K - .__register_frame_info = __register_frame_info, - .__deregister_frame_info = __deregister_frame_info, -#endif -#ifdef OF_MORPHOS - .__register_frame = __register_frame, - .__deregister_frame = __deregister_frame, -#endif -#ifdef OF_AMIGAOS_M68K - .vsnprintf = vsnprintf, -#endif - .atexit = atexit, - .exit = exit, - }; - - if (initialized) - return; - - if ((ObjFWRTBase = OpenLibrary(OBJFWRT_AMIGA_LIB, - OBJFWRT_LIB_MINOR)) == NULL) - error("Failed to open " OBJFWRT_AMIGA_LIB " version %lu!", - OBJFWRT_LIB_MINOR); - - if (!objc_init(1, &libc)) - error("Failed to initialize " OBJFWRT_AMIGA_LIB "!", 0); - - initialized = true; -} - -static void __attribute__((__used__)) -dtor(void) -{ - CloseLibrary(ObjFWRTBase); -} - -#if defined(OF_AMIGAOS_M68K) -ADD2INIT(ctor, -5) -ADD2EXIT(dtor, -5) -#elif defined(OF_MORPHOS) -CONSTRUCTOR_P(ObjFWRT, 4000) -{ - ctor(); - - return 0; -} - -DESTRUCTOR_P(ObjFWRT, 0) -{ - dtor(); -} -#endif - -extern int __gnu_objc_personality(int version, int actions, uint64_t *exClass, - void *ex, void *ctx); - -int -#ifdef HAVE_SJLJ_EXCEPTIONS -__gnu_objc_personality_sj0( -#else -__gnu_objc_personality_v0( -#endif - int version, int actions, uint64_t exClass, void *ex, void *ctx) -{ -#ifdef OF_AMIGAOS_M68K - return __gnu_objc_personality(version, actions, &exClass, ex, ctx); -#else - return __gnu_objc_personality(version, actions, &exClass, ex, ctx); -#endif -} DELETED src/runtime/linklib/linklib.m Index: src/runtime/linklib/linklib.m ================================================================== --- src/runtime/linklib/linklib.m +++ src/runtime/linklib/linklib.m @@ -1,1538 +0,0 @@ -/* - * Copyright (c) 2008-2023 Jonathan Schleifer - * - * All rights reserved. - * - * This file is part of ObjFW. It may be distributed under the terms of the - * Q Public License 1.0, which can be found in the file LICENSE.QPL included in - * the packaging of this file. - * - * Alternatively, it may be distributed under the terms of the GNU General - * Public License, either version 2 or 3, which can be found in the file - * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this - * file. - */ - -/* This file is automatically generated from amiga-library.xml */ - -#include "config.h" - -#import "ObjFWRT.h" -#import "private.h" - -extern struct Library *ObjFWRTBase; - -bool -objc_init(unsigned int version, struct objc_libc *libc) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((bool (*)(unsigned int __asm__("d0"), struct objc_libc *__asm__("a0")))(((uintptr_t)ObjFWRTBase) - 30))(version, libc); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((bool (*)(unsigned int, struct objc_libc *))*(void **)(((uintptr_t)ObjFWRTBase) - 28))(version, libc); -#endif -} - -void -__objc_exec_class(struct objc_module *_Nonnull module) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - ((void (*)(struct objc_module *_Nonnull __asm__("a0")))(((uintptr_t)ObjFWRTBase) - 36))(module); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - __extension__ ((void (*)(struct objc_module *_Nonnull))*(void **)(((uintptr_t)ObjFWRTBase) - 34))(module); -#endif -} - -IMP _Nonnull -objc_msg_lookup(id _Nullable object, SEL _Nonnull selector) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((IMP _Nonnull (*)(id _Nullable __asm__("a0"), SEL _Nonnull __asm__("a1")))(((uintptr_t)ObjFWRTBase) - 42))(object, selector); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((IMP _Nonnull (*)(id _Nullable, SEL _Nonnull))*(void **)(((uintptr_t)ObjFWRTBase) - 40))(object, selector); -#endif -} - -IMP _Nonnull -objc_msg_lookup_stret(id _Nullable object, SEL _Nonnull selector) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((IMP _Nonnull (*)(id _Nullable __asm__("a0"), SEL _Nonnull __asm__("a1")))(((uintptr_t)ObjFWRTBase) - 48))(object, selector); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((IMP _Nonnull (*)(id _Nullable, SEL _Nonnull))*(void **)(((uintptr_t)ObjFWRTBase) - 46))(object, selector); -#endif -} - -IMP _Nonnull -objc_msg_lookup_super(struct objc_super *_Nonnull super, SEL _Nonnull selector) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((IMP _Nonnull (*)(struct objc_super *_Nonnull __asm__("a0"), SEL _Nonnull __asm__("a1")))(((uintptr_t)ObjFWRTBase) - 54))(super, selector); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((IMP _Nonnull (*)(struct objc_super *_Nonnull, SEL _Nonnull))*(void **)(((uintptr_t)ObjFWRTBase) - 52))(super, selector); -#endif -} - -IMP _Nonnull -objc_msg_lookup_super_stret(struct objc_super *_Nonnull super, SEL _Nonnull selector) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((IMP _Nonnull (*)(struct objc_super *_Nonnull __asm__("a0"), SEL _Nonnull __asm__("a1")))(((uintptr_t)ObjFWRTBase) - 60))(super, selector); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((IMP _Nonnull (*)(struct objc_super *_Nonnull, SEL _Nonnull))*(void **)(((uintptr_t)ObjFWRTBase) - 58))(super, selector); -#endif -} - -Class _Nullable -objc_lookUpClass(const char *_Nonnull name) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((Class _Nullable (*)(const char *_Nonnull __asm__("a0")))(((uintptr_t)ObjFWRTBase) - 66))(name); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((Class _Nullable (*)(const char *_Nonnull))*(void **)(((uintptr_t)ObjFWRTBase) - 64))(name); -#endif -} - -Class _Nullable -objc_getClass(const char *_Nonnull name) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((Class _Nullable (*)(const char *_Nonnull __asm__("a0")))(((uintptr_t)ObjFWRTBase) - 72))(name); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((Class _Nullable (*)(const char *_Nonnull))*(void **)(((uintptr_t)ObjFWRTBase) - 70))(name); -#endif -} - -Class _Nonnull -objc_getRequiredClass(const char *_Nonnull name) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((Class _Nonnull (*)(const char *_Nonnull __asm__("a0")))(((uintptr_t)ObjFWRTBase) - 78))(name); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((Class _Nonnull (*)(const char *_Nonnull))*(void **)(((uintptr_t)ObjFWRTBase) - 76))(name); -#endif -} - -Class _Nullable -objc_lookup_class(const char *_Nonnull name) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((Class _Nullable (*)(const char *_Nonnull __asm__("a0")))(((uintptr_t)ObjFWRTBase) - 84))(name); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((Class _Nullable (*)(const char *_Nonnull))*(void **)(((uintptr_t)ObjFWRTBase) - 82))(name); -#endif -} - -Class _Nonnull -objc_get_class(const char *_Nonnull name) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((Class _Nonnull (*)(const char *_Nonnull __asm__("a0")))(((uintptr_t)ObjFWRTBase) - 90))(name); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((Class _Nonnull (*)(const char *_Nonnull))*(void **)(((uintptr_t)ObjFWRTBase) - 88))(name); -#endif -} - -void -objc_exception_throw(id _Nonnull object) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - ((void (*)(id _Nonnull __asm__("a0")))(((uintptr_t)ObjFWRTBase) - 96))(object); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - __extension__ ((void (*)(id _Nonnull))*(void **)(((uintptr_t)ObjFWRTBase) - 94))(object); -#endif - - OF_UNREACHABLE -} - -int -objc_sync_enter(id _Nullable object) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((int (*)(id _Nullable __asm__("a0")))(((uintptr_t)ObjFWRTBase) - 102))(object); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((int (*)(id _Nullable))*(void **)(((uintptr_t)ObjFWRTBase) - 100))(object); -#endif -} - -int -objc_sync_exit(id _Nullable object) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((int (*)(id _Nullable __asm__("a0")))(((uintptr_t)ObjFWRTBase) - 108))(object); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((int (*)(id _Nullable))*(void **)(((uintptr_t)ObjFWRTBase) - 106))(object); -#endif -} - -id _Nullable -objc_getProperty(id _Nonnull self, SEL _Nonnull _cmd, ptrdiff_t offset, bool atomic) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((id _Nullable (*)(id _Nonnull __asm__("a0"), SEL _Nonnull __asm__("a1"), ptrdiff_t __asm__("d0"), bool __asm__("d1")))(((uintptr_t)ObjFWRTBase) - 114))(self, _cmd, offset, atomic); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((id _Nullable (*)(id _Nonnull, SEL _Nonnull, ptrdiff_t, bool))*(void **)(((uintptr_t)ObjFWRTBase) - 112))(self, _cmd, offset, atomic); -#endif -} - -void -objc_setProperty(id _Nonnull self, SEL _Nonnull _cmd, ptrdiff_t offset, id _Nullable value, bool atomic, signed char copy) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - ((void (*)(id _Nonnull __asm__("a0"), SEL _Nonnull __asm__("a1"), ptrdiff_t __asm__("d0"), id _Nullable __asm__("a2"), bool __asm__("d1"), signed char __asm__("d2")))(((uintptr_t)ObjFWRTBase) - 120))(self, _cmd, offset, value, atomic, copy); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - __extension__ ((void (*)(id _Nonnull, SEL _Nonnull, ptrdiff_t, id _Nullable, bool, signed char))*(void **)(((uintptr_t)ObjFWRTBase) - 118))(self, _cmd, offset, value, atomic, copy); -#endif -} - -void -objc_getPropertyStruct(void *_Nonnull dest, const void *_Nonnull src, ptrdiff_t size, bool atomic, bool strong) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - ((void (*)(void *_Nonnull __asm__("a0"), const void *_Nonnull __asm__("a1"), ptrdiff_t __asm__("d0"), bool __asm__("d1"), bool __asm__("d2")))(((uintptr_t)ObjFWRTBase) - 126))(dest, src, size, atomic, strong); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - __extension__ ((void (*)(void *_Nonnull, const void *_Nonnull, ptrdiff_t, bool, bool))*(void **)(((uintptr_t)ObjFWRTBase) - 124))(dest, src, size, atomic, strong); -#endif -} - -void -objc_setPropertyStruct(void *_Nonnull dest, const void *_Nonnull src, ptrdiff_t size, bool atomic, bool strong) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - ((void (*)(void *_Nonnull __asm__("a0"), const void *_Nonnull __asm__("a1"), ptrdiff_t __asm__("d0"), bool __asm__("d1"), bool __asm__("d2")))(((uintptr_t)ObjFWRTBase) - 132))(dest, src, size, atomic, strong); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - __extension__ ((void (*)(void *_Nonnull, const void *_Nonnull, ptrdiff_t, bool, bool))*(void **)(((uintptr_t)ObjFWRTBase) - 130))(dest, src, size, atomic, strong); -#endif -} - -void -objc_enumerationMutation(id _Nonnull object) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - ((void (*)(id _Nonnull __asm__("a0")))(((uintptr_t)ObjFWRTBase) - 138))(object); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - __extension__ ((void (*)(id _Nonnull))*(void **)(((uintptr_t)ObjFWRTBase) - 136))(object); -#endif -} - -int -__gnu_objc_personality(int version, int actions, uint64_t *_Nonnull exClass, void *_Nonnull ex, void *_Nonnull ctx) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((int (*)(int __asm__("d0"), int __asm__("d1"), uint64_t *_Nonnull __asm__("d2"), void *_Nonnull __asm__("a0"), void *_Nonnull __asm__("a1")))(((uintptr_t)ObjFWRTBase) - 144))(version, actions, exClass, ex, ctx); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((int (*)(int, int, uint64_t *_Nonnull, void *_Nonnull, void *_Nonnull))*(void **)(((uintptr_t)ObjFWRTBase) - 142))(version, actions, exClass, ex, ctx); -#endif -} - -id _Nullable -objc_retain(id _Nullable object) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((id _Nullable (*)(id _Nullable __asm__("a0")))(((uintptr_t)ObjFWRTBase) - 150))(object); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((id _Nullable (*)(id _Nullable))*(void **)(((uintptr_t)ObjFWRTBase) - 148))(object); -#endif -} - -id _Nullable -objc_retainBlock(id _Nullable block) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((id _Nullable (*)(id _Nullable __asm__("a0")))(((uintptr_t)ObjFWRTBase) - 156))(block); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((id _Nullable (*)(id _Nullable))*(void **)(((uintptr_t)ObjFWRTBase) - 154))(block); -#endif -} - -id _Nullable -objc_retainAutorelease(id _Nullable object) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((id _Nullable (*)(id _Nullable __asm__("a0")))(((uintptr_t)ObjFWRTBase) - 162))(object); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((id _Nullable (*)(id _Nullable))*(void **)(((uintptr_t)ObjFWRTBase) - 160))(object); -#endif -} - -void -objc_release(id _Nullable object) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - ((void (*)(id _Nullable __asm__("a0")))(((uintptr_t)ObjFWRTBase) - 168))(object); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - __extension__ ((void (*)(id _Nullable))*(void **)(((uintptr_t)ObjFWRTBase) - 166))(object); -#endif -} - -id _Nullable -objc_autorelease(id _Nullable object) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((id _Nullable (*)(id _Nullable __asm__("a0")))(((uintptr_t)ObjFWRTBase) - 174))(object); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((id _Nullable (*)(id _Nullable))*(void **)(((uintptr_t)ObjFWRTBase) - 172))(object); -#endif -} - -id _Nullable -objc_autoreleaseReturnValue(id _Nullable object) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((id _Nullable (*)(id _Nullable __asm__("a0")))(((uintptr_t)ObjFWRTBase) - 180))(object); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((id _Nullable (*)(id _Nullable))*(void **)(((uintptr_t)ObjFWRTBase) - 178))(object); -#endif -} - -id _Nullable -objc_retainAutoreleaseReturnValue(id _Nullable object) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((id _Nullable (*)(id _Nullable __asm__("a0")))(((uintptr_t)ObjFWRTBase) - 186))(object); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((id _Nullable (*)(id _Nullable))*(void **)(((uintptr_t)ObjFWRTBase) - 184))(object); -#endif -} - -id _Nullable -objc_retainAutoreleasedReturnValue(id _Nullable object) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((id _Nullable (*)(id _Nullable __asm__("a0")))(((uintptr_t)ObjFWRTBase) - 192))(object); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((id _Nullable (*)(id _Nullable))*(void **)(((uintptr_t)ObjFWRTBase) - 190))(object); -#endif -} - -id _Nullable -objc_storeStrong(id _Nullable *_Nonnull object, id _Nullable value) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((id _Nullable (*)(id _Nullable *_Nonnull __asm__("a0"), id _Nullable __asm__("a1")))(((uintptr_t)ObjFWRTBase) - 198))(object, value); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((id _Nullable (*)(id _Nullable *_Nonnull, id _Nullable))*(void **)(((uintptr_t)ObjFWRTBase) - 196))(object, value); -#endif -} - -id _Nullable -objc_storeWeak(id _Nullable *_Nonnull object, id _Nullable value) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((id _Nullable (*)(id _Nullable *_Nonnull __asm__("a0"), id _Nullable __asm__("a1")))(((uintptr_t)ObjFWRTBase) - 204))(object, value); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((id _Nullable (*)(id _Nullable *_Nonnull, id _Nullable))*(void **)(((uintptr_t)ObjFWRTBase) - 202))(object, value); -#endif -} - -id _Nullable -objc_loadWeakRetained(id _Nullable *_Nonnull object) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((id _Nullable (*)(id _Nullable *_Nonnull __asm__("a0")))(((uintptr_t)ObjFWRTBase) - 210))(object); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((id _Nullable (*)(id _Nullable *_Nonnull))*(void **)(((uintptr_t)ObjFWRTBase) - 208))(object); -#endif -} - -id _Nullable -objc_initWeak(id _Nullable *_Nonnull object, id _Nullable value) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((id _Nullable (*)(id _Nullable *_Nonnull __asm__("a0"), id _Nullable __asm__("a1")))(((uintptr_t)ObjFWRTBase) - 216))(object, value); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((id _Nullable (*)(id _Nullable *_Nonnull, id _Nullable))*(void **)(((uintptr_t)ObjFWRTBase) - 214))(object, value); -#endif -} - -void -objc_destroyWeak(id _Nullable *_Nonnull object) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - ((void (*)(id _Nullable *_Nonnull __asm__("a0")))(((uintptr_t)ObjFWRTBase) - 222))(object); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - __extension__ ((void (*)(id _Nullable *_Nonnull))*(void **)(((uintptr_t)ObjFWRTBase) - 220))(object); -#endif -} - -id _Nullable -objc_loadWeak(id _Nullable *_Nonnull object) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((id _Nullable (*)(id _Nullable *_Nonnull __asm__("a0")))(((uintptr_t)ObjFWRTBase) - 228))(object); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((id _Nullable (*)(id _Nullable *_Nonnull))*(void **)(((uintptr_t)ObjFWRTBase) - 226))(object); -#endif -} - -void -objc_copyWeak(id _Nullable *_Nonnull dest, id _Nullable *_Nonnull src) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - ((void (*)(id _Nullable *_Nonnull __asm__("a0"), id _Nullable *_Nonnull __asm__("a1")))(((uintptr_t)ObjFWRTBase) - 234))(dest, src); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - __extension__ ((void (*)(id _Nullable *_Nonnull, id _Nullable *_Nonnull))*(void **)(((uintptr_t)ObjFWRTBase) - 232))(dest, src); -#endif -} - -void -objc_moveWeak(id _Nullable *_Nonnull dest, id _Nullable *_Nonnull src) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - ((void (*)(id _Nullable *_Nonnull __asm__("a0"), id _Nullable *_Nonnull __asm__("a1")))(((uintptr_t)ObjFWRTBase) - 240))(dest, src); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - __extension__ ((void (*)(id _Nullable *_Nonnull, id _Nullable *_Nonnull))*(void **)(((uintptr_t)ObjFWRTBase) - 238))(dest, src); -#endif -} - -SEL _Nonnull -sel_registerName(const char *_Nonnull name) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((SEL _Nonnull (*)(const char *_Nonnull __asm__("a0")))(((uintptr_t)ObjFWRTBase) - 246))(name); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((SEL _Nonnull (*)(const char *_Nonnull))*(void **)(((uintptr_t)ObjFWRTBase) - 244))(name); -#endif -} - -const char *_Nonnull -sel_getName(SEL _Nonnull selector) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((const char *_Nonnull (*)(SEL _Nonnull __asm__("a0")))(((uintptr_t)ObjFWRTBase) - 252))(selector); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((const char *_Nonnull (*)(SEL _Nonnull))*(void **)(((uintptr_t)ObjFWRTBase) - 250))(selector); -#endif -} - -bool -sel_isEqual(SEL _Nonnull selector1, SEL _Nonnull selector2) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((bool (*)(SEL _Nonnull __asm__("a0"), SEL _Nonnull __asm__("a1")))(((uintptr_t)ObjFWRTBase) - 258))(selector1, selector2); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((bool (*)(SEL _Nonnull, SEL _Nonnull))*(void **)(((uintptr_t)ObjFWRTBase) - 256))(selector1, selector2); -#endif -} - -Class _Nonnull -objc_allocateClassPair(Class _Nullable superclass, const char *_Nonnull name, size_t extraBytes) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((Class _Nonnull (*)(Class _Nullable __asm__("a0"), const char *_Nonnull __asm__("a1"), size_t __asm__("d0")))(((uintptr_t)ObjFWRTBase) - 264))(superclass, name, extraBytes); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((Class _Nonnull (*)(Class _Nullable, const char *_Nonnull, size_t))*(void **)(((uintptr_t)ObjFWRTBase) - 262))(superclass, name, extraBytes); -#endif -} - -void -objc_registerClassPair(Class _Nonnull class) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - ((void (*)(Class _Nonnull __asm__("a0")))(((uintptr_t)ObjFWRTBase) - 270))(class); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - __extension__ ((void (*)(Class _Nonnull))*(void **)(((uintptr_t)ObjFWRTBase) - 268))(class); -#endif -} - -unsigned int -objc_getClassList(Class _Nonnull *_Nullable buffer, unsigned int count) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((unsigned int (*)(Class _Nonnull *_Nullable __asm__("a0"), unsigned int __asm__("d0")))(((uintptr_t)ObjFWRTBase) - 276))(buffer, count); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((unsigned int (*)(Class _Nonnull *_Nullable, unsigned int))*(void **)(((uintptr_t)ObjFWRTBase) - 274))(buffer, count); -#endif -} - -Class _Nonnull *_Nonnull -objc_copyClassList(unsigned int *_Nullable length) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((Class _Nonnull *_Nonnull (*)(unsigned int *_Nullable __asm__("a0")))(((uintptr_t)ObjFWRTBase) - 282))(length); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((Class _Nonnull *_Nonnull (*)(unsigned int *_Nullable))*(void **)(((uintptr_t)ObjFWRTBase) - 280))(length); -#endif -} - -bool -class_isMetaClass(Class _Nullable class) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((bool (*)(Class _Nullable __asm__("a0")))(((uintptr_t)ObjFWRTBase) - 288))(class); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((bool (*)(Class _Nullable))*(void **)(((uintptr_t)ObjFWRTBase) - 286))(class); -#endif -} - -const char *_Nullable -class_getName(Class _Nullable class) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((const char *_Nullable (*)(Class _Nullable __asm__("a0")))(((uintptr_t)ObjFWRTBase) - 294))(class); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((const char *_Nullable (*)(Class _Nullable))*(void **)(((uintptr_t)ObjFWRTBase) - 292))(class); -#endif -} - -Class _Nullable -class_getSuperclass(Class _Nullable class) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((Class _Nullable (*)(Class _Nullable __asm__("a0")))(((uintptr_t)ObjFWRTBase) - 300))(class); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((Class _Nullable (*)(Class _Nullable))*(void **)(((uintptr_t)ObjFWRTBase) - 298))(class); -#endif -} - -unsigned long -class_getInstanceSize(Class _Nullable class) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((unsigned long (*)(Class _Nullable __asm__("a0")))(((uintptr_t)ObjFWRTBase) - 306))(class); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((unsigned long (*)(Class _Nullable))*(void **)(((uintptr_t)ObjFWRTBase) - 304))(class); -#endif -} - -bool -class_respondsToSelector(Class _Nullable class, SEL _Nonnull selector) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((bool (*)(Class _Nullable __asm__("a0"), SEL _Nonnull __asm__("a1")))(((uintptr_t)ObjFWRTBase) - 312))(class, selector); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((bool (*)(Class _Nullable, SEL _Nonnull))*(void **)(((uintptr_t)ObjFWRTBase) - 310))(class, selector); -#endif -} - -bool -class_conformsToProtocol(Class _Nullable class, Protocol *_Nonnull p) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((bool (*)(Class _Nullable __asm__("a0"), Protocol *_Nonnull __asm__("a1")))(((uintptr_t)ObjFWRTBase) - 318))(class, p); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((bool (*)(Class _Nullable, Protocol *_Nonnull))*(void **)(((uintptr_t)ObjFWRTBase) - 316))(class, p); -#endif -} - -IMP _Nullable -class_getMethodImplementation(Class _Nullable class, SEL _Nonnull selector) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((IMP _Nullable (*)(Class _Nullable __asm__("a0"), SEL _Nonnull __asm__("a1")))(((uintptr_t)ObjFWRTBase) - 324))(class, selector); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((IMP _Nullable (*)(Class _Nullable, SEL _Nonnull))*(void **)(((uintptr_t)ObjFWRTBase) - 322))(class, selector); -#endif -} - -IMP _Nullable -class_getMethodImplementation_stret(Class _Nullable class, SEL _Nonnull selector) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((IMP _Nullable (*)(Class _Nullable __asm__("a0"), SEL _Nonnull __asm__("a1")))(((uintptr_t)ObjFWRTBase) - 330))(class, selector); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((IMP _Nullable (*)(Class _Nullable, SEL _Nonnull))*(void **)(((uintptr_t)ObjFWRTBase) - 328))(class, selector); -#endif -} - -Method _Nullable -class_getInstanceMethod(Class _Nullable class, SEL _Nonnull selector) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((Method _Nullable (*)(Class _Nullable __asm__("a0"), SEL _Nonnull __asm__("a1")))(((uintptr_t)ObjFWRTBase) - 336))(class, selector); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((Method _Nullable (*)(Class _Nullable, SEL _Nonnull))*(void **)(((uintptr_t)ObjFWRTBase) - 334))(class, selector); -#endif -} - -bool -class_addMethod(Class _Nonnull class, SEL _Nonnull selector, IMP _Nonnull implementation, const char *_Nullable typeEncoding) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((bool (*)(Class _Nonnull __asm__("a0"), SEL _Nonnull __asm__("a1"), IMP _Nonnull __asm__("a2"), const char *_Nullable __asm__("a3")))(((uintptr_t)ObjFWRTBase) - 342))(class, selector, implementation, typeEncoding); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((bool (*)(Class _Nonnull, SEL _Nonnull, IMP _Nonnull, const char *_Nullable))*(void **)(((uintptr_t)ObjFWRTBase) - 340))(class, selector, implementation, typeEncoding); -#endif -} - -IMP _Nullable -class_replaceMethod(Class _Nonnull class, SEL _Nonnull selector, IMP _Nonnull implementation, const char *_Nullable typeEncoding) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((IMP _Nullable (*)(Class _Nonnull __asm__("a0"), SEL _Nonnull __asm__("a1"), IMP _Nonnull __asm__("a2"), const char *_Nullable __asm__("a3")))(((uintptr_t)ObjFWRTBase) - 348))(class, selector, implementation, typeEncoding); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((IMP _Nullable (*)(Class _Nonnull, SEL _Nonnull, IMP _Nonnull, const char *_Nullable))*(void **)(((uintptr_t)ObjFWRTBase) - 346))(class, selector, implementation, typeEncoding); -#endif -} - -Class _Nullable -object_getClass(id _Nullable object) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((Class _Nullable (*)(id _Nullable __asm__("a0")))(((uintptr_t)ObjFWRTBase) - 354))(object); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((Class _Nullable (*)(id _Nullable))*(void **)(((uintptr_t)ObjFWRTBase) - 352))(object); -#endif -} - -Class _Nullable -object_setClass(id _Nullable object, Class _Nonnull class) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((Class _Nullable (*)(id _Nullable __asm__("a0"), Class _Nonnull __asm__("a1")))(((uintptr_t)ObjFWRTBase) - 360))(object, class); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((Class _Nullable (*)(id _Nullable, Class _Nonnull))*(void **)(((uintptr_t)ObjFWRTBase) - 358))(object, class); -#endif -} - -const char *_Nullable -object_getClassName(id _Nullable object) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((const char *_Nullable (*)(id _Nullable __asm__("a0")))(((uintptr_t)ObjFWRTBase) - 366))(object); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((const char *_Nullable (*)(id _Nullable))*(void **)(((uintptr_t)ObjFWRTBase) - 364))(object); -#endif -} - -const char *_Nonnull -protocol_getName(Protocol *_Nonnull protocol) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((const char *_Nonnull (*)(Protocol *_Nonnull __asm__("a0")))(((uintptr_t)ObjFWRTBase) - 372))(protocol); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((const char *_Nonnull (*)(Protocol *_Nonnull))*(void **)(((uintptr_t)ObjFWRTBase) - 370))(protocol); -#endif -} - -bool -protocol_isEqual(Protocol *_Nonnull protocol1, Protocol *_Nonnull protocol2) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((bool (*)(Protocol *_Nonnull __asm__("a0"), Protocol *_Nonnull __asm__("a1")))(((uintptr_t)ObjFWRTBase) - 378))(protocol1, protocol2); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((bool (*)(Protocol *_Nonnull, Protocol *_Nonnull))*(void **)(((uintptr_t)ObjFWRTBase) - 376))(protocol1, protocol2); -#endif -} - -bool -protocol_conformsToProtocol(Protocol *_Nonnull protocol1, Protocol *_Nonnull protocol2) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((bool (*)(Protocol *_Nonnull __asm__("a0"), Protocol *_Nonnull __asm__("a1")))(((uintptr_t)ObjFWRTBase) - 384))(protocol1, protocol2); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((bool (*)(Protocol *_Nonnull, Protocol *_Nonnull))*(void **)(((uintptr_t)ObjFWRTBase) - 382))(protocol1, protocol2); -#endif -} - -_Nullable objc_uncaught_exception_handler -objc_setUncaughtExceptionHandler(objc_uncaught_exception_handler _Nullable handler) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((_Nullable objc_uncaught_exception_handler (*)(objc_uncaught_exception_handler _Nullable __asm__("a0")))(((uintptr_t)ObjFWRTBase) - 390))(handler); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((_Nullable objc_uncaught_exception_handler (*)(objc_uncaught_exception_handler _Nullable))*(void **)(((uintptr_t)ObjFWRTBase) - 388))(handler); -#endif -} - -void -objc_setForwardHandler(IMP _Nullable forward, IMP _Nullable stretForward) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - ((void (*)(IMP _Nullable __asm__("a0"), IMP _Nullable __asm__("a1")))(((uintptr_t)ObjFWRTBase) - 396))(forward, stretForward); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - __extension__ ((void (*)(IMP _Nullable, IMP _Nullable))*(void **)(((uintptr_t)ObjFWRTBase) - 394))(forward, stretForward); -#endif -} - -void -objc_setEnumerationMutationHandler(objc_enumeration_mutation_handler _Nullable hadler) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - ((void (*)(objc_enumeration_mutation_handler _Nullable __asm__("a0")))(((uintptr_t)ObjFWRTBase) - 402))(hadler); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - __extension__ ((void (*)(objc_enumeration_mutation_handler _Nullable))*(void **)(((uintptr_t)ObjFWRTBase) - 400))(hadler); -#endif -} - -id _Nullable -objc_constructInstance(Class _Nullable class, void *_Nullable bytes) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((id _Nullable (*)(Class _Nullable __asm__("a0"), void *_Nullable __asm__("a1")))(((uintptr_t)ObjFWRTBase) - 408))(class, bytes); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((id _Nullable (*)(Class _Nullable, void *_Nullable))*(void **)(((uintptr_t)ObjFWRTBase) - 406))(class, bytes); -#endif -} - -void -objc_deinit() -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - ((void (*)())(((uintptr_t)ObjFWRTBase) - 414))(); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - __extension__ ((void (*)())*(void **)(((uintptr_t)ObjFWRTBase) - 412))(); -#endif -} - -Ivar _Nullable *_Nullable -class_copyIvarList(Class _Nullable class, unsigned int *_Nullable outCount) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((Ivar _Nullable *_Nullable (*)(Class _Nullable __asm__("a0"), unsigned int *_Nullable __asm__("a1")))(((uintptr_t)ObjFWRTBase) - 420))(class, outCount); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((Ivar _Nullable *_Nullable (*)(Class _Nullable, unsigned int *_Nullable))*(void **)(((uintptr_t)ObjFWRTBase) - 418))(class, outCount); -#endif -} - -const char *_Nonnull -ivar_getName(Ivar _Nonnull ivar) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((const char *_Nonnull (*)(Ivar _Nonnull __asm__("a0")))(((uintptr_t)ObjFWRTBase) - 426))(ivar); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((const char *_Nonnull (*)(Ivar _Nonnull))*(void **)(((uintptr_t)ObjFWRTBase) - 424))(ivar); -#endif -} - -const char *_Nonnull -ivar_getTypeEncoding(Ivar _Nonnull ivar) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((const char *_Nonnull (*)(Ivar _Nonnull __asm__("a0")))(((uintptr_t)ObjFWRTBase) - 432))(ivar); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((const char *_Nonnull (*)(Ivar _Nonnull))*(void **)(((uintptr_t)ObjFWRTBase) - 430))(ivar); -#endif -} - -ptrdiff_t -ivar_getOffset(Ivar _Nonnull ivar) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((ptrdiff_t (*)(Ivar _Nonnull __asm__("a0")))(((uintptr_t)ObjFWRTBase) - 438))(ivar); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((ptrdiff_t (*)(Ivar _Nonnull))*(void **)(((uintptr_t)ObjFWRTBase) - 436))(ivar); -#endif -} - -Method _Nullable *_Nullable -class_copyMethodList(Class _Nullable class, unsigned int *_Nullable outCount) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((Method _Nullable *_Nullable (*)(Class _Nullable __asm__("a0"), unsigned int *_Nullable __asm__("a1")))(((uintptr_t)ObjFWRTBase) - 444))(class, outCount); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((Method _Nullable *_Nullable (*)(Class _Nullable, unsigned int *_Nullable))*(void **)(((uintptr_t)ObjFWRTBase) - 442))(class, outCount); -#endif -} - -SEL _Nonnull -method_getName(Method _Nonnull method) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((SEL _Nonnull (*)(Method _Nonnull __asm__("a0")))(((uintptr_t)ObjFWRTBase) - 450))(method); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((SEL _Nonnull (*)(Method _Nonnull))*(void **)(((uintptr_t)ObjFWRTBase) - 448))(method); -#endif -} - -const char *_Nullable -method_getTypeEncoding(Method _Nonnull method) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((const char *_Nullable (*)(Method _Nonnull __asm__("a0")))(((uintptr_t)ObjFWRTBase) - 456))(method); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((const char *_Nullable (*)(Method _Nonnull))*(void **)(((uintptr_t)ObjFWRTBase) - 454))(method); -#endif -} - -objc_property_t _Nullable *_Nullable -class_copyPropertyList(Class _Nullable class, unsigned int *_Nullable outCount) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((objc_property_t _Nullable *_Nullable (*)(Class _Nullable __asm__("a0"), unsigned int *_Nullable __asm__("a1")))(((uintptr_t)ObjFWRTBase) - 462))(class, outCount); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((objc_property_t _Nullable *_Nullable (*)(Class _Nullable, unsigned int *_Nullable))*(void **)(((uintptr_t)ObjFWRTBase) - 460))(class, outCount); -#endif -} - -const char *_Nonnull -property_getName(objc_property_t _Nonnull property) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((const char *_Nonnull (*)(objc_property_t _Nonnull __asm__("a0")))(((uintptr_t)ObjFWRTBase) - 468))(property); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((const char *_Nonnull (*)(objc_property_t _Nonnull))*(void **)(((uintptr_t)ObjFWRTBase) - 466))(property); -#endif -} - -char *_Nullable -property_copyAttributeValue(objc_property_t _Nonnull property, const char *_Nonnull name) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((char *_Nullable (*)(objc_property_t _Nonnull __asm__("a0"), const char *_Nonnull __asm__("a1")))(((uintptr_t)ObjFWRTBase) - 474))(property, name); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((char *_Nullable (*)(objc_property_t _Nonnull, const char *_Nonnull))*(void **)(((uintptr_t)ObjFWRTBase) - 472))(property, name); -#endif -} - -void *_Nullable -objc_destructInstance(id _Nullable object) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((void *_Nullable (*)(id _Nullable __asm__("a0")))(((uintptr_t)ObjFWRTBase) - 480))(object); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((void *_Nullable (*)(id _Nullable))*(void **)(((uintptr_t)ObjFWRTBase) - 478))(object); -#endif -} - -void *_Null_unspecified -objc_autoreleasePoolPush() -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((void *_Null_unspecified (*)())(((uintptr_t)ObjFWRTBase) - 486))(); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((void *_Null_unspecified (*)())*(void **)(((uintptr_t)ObjFWRTBase) - 484))(); -#endif -} - -void -objc_autoreleasePoolPop(void *_Null_unspecified pool) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - ((void (*)(void *_Null_unspecified __asm__("a0")))(((uintptr_t)ObjFWRTBase) - 492))(pool); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - __extension__ ((void (*)(void *_Null_unspecified))*(void **)(((uintptr_t)ObjFWRTBase) - 490))(pool); -#endif -} - -id _Nullable -_objc_rootAutorelease(id _Nullable object) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((id _Nullable (*)(id _Nullable __asm__("a0")))(((uintptr_t)ObjFWRTBase) - 498))(object); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((id _Nullable (*)(id _Nullable))*(void **)(((uintptr_t)ObjFWRTBase) - 496))(object); -#endif -} - -struct objc_hashtable *_Nonnull -objc_hashtable_new(objc_hashtable_hash_func hash, objc_hashtable_equal_func equal, uint32_t size) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((struct objc_hashtable *_Nonnull (*)(objc_hashtable_hash_func __asm__("a0"), objc_hashtable_equal_func __asm__("a1"), uint32_t __asm__("d0")))(((uintptr_t)ObjFWRTBase) - 504))(hash, equal, size); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((struct objc_hashtable *_Nonnull (*)(objc_hashtable_hash_func, objc_hashtable_equal_func, uint32_t))*(void **)(((uintptr_t)ObjFWRTBase) - 502))(hash, equal, size); -#endif -} - -void -objc_hashtable_set(struct objc_hashtable *_Nonnull table, const void *_Nonnull key, const void *_Nonnull object) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - ((void (*)(struct objc_hashtable *_Nonnull __asm__("a0"), const void *_Nonnull __asm__("a1"), const void *_Nonnull __asm__("a2")))(((uintptr_t)ObjFWRTBase) - 510))(table, key, object); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - __extension__ ((void (*)(struct objc_hashtable *_Nonnull, const void *_Nonnull, const void *_Nonnull))*(void **)(((uintptr_t)ObjFWRTBase) - 508))(table, key, object); -#endif -} - -void *_Nullable -objc_hashtable_get(struct objc_hashtable *_Nonnull table, const void *_Nonnull key) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((void *_Nullable (*)(struct objc_hashtable *_Nonnull __asm__("a0"), const void *_Nonnull __asm__("a1")))(((uintptr_t)ObjFWRTBase) - 516))(table, key); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((void *_Nullable (*)(struct objc_hashtable *_Nonnull, const void *_Nonnull))*(void **)(((uintptr_t)ObjFWRTBase) - 514))(table, key); -#endif -} - -void -objc_hashtable_delete(struct objc_hashtable *_Nonnull table, const void *_Nonnull key) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - ((void (*)(struct objc_hashtable *_Nonnull __asm__("a0"), const void *_Nonnull __asm__("a1")))(((uintptr_t)ObjFWRTBase) - 522))(table, key); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - __extension__ ((void (*)(struct objc_hashtable *_Nonnull, const void *_Nonnull))*(void **)(((uintptr_t)ObjFWRTBase) - 520))(table, key); -#endif -} - -void -objc_hashtable_free(struct objc_hashtable *_Nonnull table) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - ((void (*)(struct objc_hashtable *_Nonnull __asm__("a0")))(((uintptr_t)ObjFWRTBase) - 528))(table); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - __extension__ ((void (*)(struct objc_hashtable *_Nonnull))*(void **)(((uintptr_t)ObjFWRTBase) - 526))(table); -#endif -} - -void -objc_setTaggedPointerSecret(uintptr_t secret) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - ((void (*)(uintptr_t __asm__("d0")))(((uintptr_t)ObjFWRTBase) - 534))(secret); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - __extension__ ((void (*)(uintptr_t))*(void **)(((uintptr_t)ObjFWRTBase) - 532))(secret); -#endif -} - -int -objc_registerTaggedPointerClass(Class _Nonnull class) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((int (*)(Class _Nonnull __asm__("a0")))(((uintptr_t)ObjFWRTBase) - 540))(class); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((int (*)(Class _Nonnull))*(void **)(((uintptr_t)ObjFWRTBase) - 538))(class); -#endif -} - -bool -object_isTaggedPointer(id _Nullable object) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((bool (*)(id _Nullable __asm__("a0")))(((uintptr_t)ObjFWRTBase) - 546))(object); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((bool (*)(id _Nullable))*(void **)(((uintptr_t)ObjFWRTBase) - 544))(object); -#endif -} - -uintptr_t -object_getTaggedPointerValue(id _Nonnull object) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((uintptr_t (*)(id _Nonnull __asm__("a0")))(((uintptr_t)ObjFWRTBase) - 552))(object); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((uintptr_t (*)(id _Nonnull))*(void **)(((uintptr_t)ObjFWRTBase) - 550))(object); -#endif -} - -id _Nullable -objc_createTaggedPointer(int class, uintptr_t value) -{ -#if defined(OF_AMIGAOS_M68K) - register struct Library *a6 __asm__("a6") = ObjFWRTBase; - (void)a6; - return ((id _Nullable (*)(int __asm__("d0"), uintptr_t __asm__("d1")))(((uintptr_t)ObjFWRTBase) - 558))(class, value); -#elif defined(OF_MORPHOS) - __asm__ __volatile__ ( - "mr %%r12, %0" - :: "r"(ObjFWRTBase) : "r12" - ); - - return __extension__ ((id _Nullable (*)(int, uintptr_t))*(void **)(((uintptr_t)ObjFWRTBase) - 556))(class, value); -#endif -} Index: src/runtime/lookup-asm/Makefile ================================================================== --- src/runtime/lookup-asm/Makefile +++ src/runtime/lookup-asm/Makefile @@ -1,12 +1,10 @@ include ../../../extra.mk STATIC_PIC_LIB_NOINST = ${LOOKUP_ASM_LIB_A} -STATIC_AMIGA_LIB_NOINST = ${LOOKUP_ASM_AMIGALIB_A} STATIC_LIB_NOINST = ${LOOKUP_ASM_A} SRCS = lookup-asm.S include ../../../buildsys.mk ASFLAGS += -I../../.. -I../.. -ASFLAGS_lookup-asm.amigalib.o += -DOF_BASEREL Index: src/runtime/private.h ================================================================== --- src/runtime/private.h +++ src/runtime/private.h @@ -213,75 +213,10 @@ IMP _Nullable buckets[256]; #endif } *_Nonnull buckets[256]; }; -#if defined(OBJC_COMPILING_AMIGA_LIBRARY) || \ - defined(OBJC_COMPILING_AMIGA_LINKLIB) -struct objc_libc { - void *_Nullable (*_Nonnull malloc)(size_t); - void *_Nullable (*_Nonnull calloc)(size_t, size_t); - void *_Nullable (*_Nonnull realloc)(void *_Nullable, size_t); - void (*_Nonnull free)(void *_Nullable); -# ifdef HAVE_SJLJ_EXCEPTIONS - int (*_Nonnull _Unwind_SjLj_RaiseException)(void *_Nonnull); -# else - int (*_Nonnull _Unwind_RaiseException)(void *_Nonnull); -# endif - void (*_Nonnull _Unwind_DeleteException)(void *_Nonnull); - void *_Nullable (*_Nonnull _Unwind_GetLanguageSpecificData)( - void *_Nonnull); - uintptr_t (*_Nonnull _Unwind_GetRegionStart)(void *_Nonnull); - uintptr_t (*_Nonnull _Unwind_GetDataRelBase)(void *_Nonnull); - uintptr_t (*_Nonnull _Unwind_GetTextRelBase)(void *_Nonnull); - uintptr_t (*_Nonnull _Unwind_GetIP)(void *_Nonnull); - uintptr_t (*_Nonnull _Unwind_GetGR)(void *_Nonnull, int); - void (*_Nonnull _Unwind_SetIP)(void *_Nonnull, uintptr_t); - void (*_Nonnull _Unwind_SetGR)(void *_Nonnull, int, uintptr_t); -# ifdef HAVE_SJLJ_EXCEPTIONS - void (*_Nonnull _Unwind_SjLj_Resume)(void *_Nonnull); -# else - void (*_Nonnull _Unwind_Resume)(void *_Nonnull); -# endif -# ifdef OF_AMIGAOS_M68K - void (*_Nonnull __register_frame_info)(const void *_Nonnull, - void *_Nonnull); - void *(*_Nonnull __deregister_frame_info)(const void *_Nonnull); -# endif -# ifdef OF_MORPHOS - void (*_Nonnull __register_frame)(void *_Nonnull); - void (*_Nonnull __deregister_frame)(void *_Nonnull); -# endif -# ifdef OF_AMIGAOS_M68K - int (*_Nonnull vsnprintf)(char *restrict _Nonnull str, size_t size, - const char *_Nonnull restrict fmt, va_list args); -# endif - int (*_Nonnull atexit)(void (*_Nonnull)(void)); - void (*_Nonnull exit)(int); -}; -#endif - -#ifdef OBJC_COMPILING_AMIGA_LIBRARY -# if defined(__MORPHOS__) -# include -# define OBJC_M68K_ARG(type, name, reg) type name = (type)REG_##reg; -# else -# define OBJC_M68K_ARG(type, name, reg) \ - register type reg_##name __asm__(#reg); \ - type name = reg_##name; -# endif - -extern bool objc_init(unsigned int, struct objc_libc *); -# ifdef HAVE_SJLJ_EXCEPTIONS -# define __gnu_objc_personality(version, actions, exClass, ex, ctx) \ - __gnu_objc_personality_sj0(version, actions, *exClass, ex, ctx) -# else -# define __gnu_objc_personality(version, actions, exClass, ex, ctx) \ - __gnu_objc_personality_v0(version, actions, *exClass, ex, ctx) -# endif -#endif - extern void objc_registerAllCategories(struct objc_symtab *_Nonnull); extern struct objc_category *_Nullable *_Nullable objc_categoriesForClass(Class _Nonnull); extern void objc_unregisterAllCategories(void); extern void objc_initializeClass(Class _Nonnull); Index: tests/Makefile ================================================================== --- tests/Makefile +++ tests/Makefile @@ -103,11 +103,10 @@ rm -f objfw${OBJFW_LIB_MAJOR}.dll libobjfw.${OBJFW_LIB_MAJOR}.dylib rm -f libobjfwrt.so.${OBJFWRT_LIB_MAJOR} rm -f libobjfwrt.so.${OBJFWRT_LIB_MAJOR_MINOR} rm -f objfwrt${OBJFWRT_LIB_MAJOR}.dll rm -f libobjfwrt.${OBJFWRT_LIB_MAJOR}.dylib - rm -f ${OBJFWRT_AMIGA_LIB} if test -f ../src/libobjfw.so; then \ ${LN_S} ../src/libobjfw.so libobjfw.so.${OBJFW_LIB_MAJOR}; \ ${LN_S} ../src/libobjfw.so \ libobjfw.so.${OBJFW_LIB_MAJOR_MINOR}; \ elif test -f ../src/libobjfw.so.${OBJFW_LIB_MAJOR_MINOR}; then \ @@ -136,14 +135,10 @@ fi if test -f ../src/runtime/libobjfwrt.dylib; then \ ${LN_S} ../src/runtime/libobjfwrt.dylib \ libobjfwrt.${OBJFWRT_LIB_MAJOR}.dylib; \ fi - if test -f ../src/runtime/${OBJFWRT_AMIGA_LIB}; then \ - ${LN_S} ../src/runtime/${OBJFWRT_AMIGA_LIB} \ - ${OBJFWRT_AMIGA_LIB}; \ - fi LD_LIBRARY_PATH=.$${LD_LIBRARY_PATH+:}$$LD_LIBRARY_PATH \ DYLD_FRAMEWORK_PATH=../src:../src/runtime$${DYLD_FRAMEWORK_PATH+:}$$DYLD_FRAMEWORK_PATH \ DYLD_LIBRARY_PATH=.$${DYLD_LIBRARY_PATH+:}$$DYLD_LIBRARY_PATH \ LIBRARY_PATH=.$${LIBRARY_PATH+:}$$LIBRARY_PATH \ ASAN_OPTIONS=allocator_may_return_null=1 \ Index: tests/objc_sync/Makefile ================================================================== --- tests/objc_sync/Makefile +++ tests/objc_sync/Makefile @@ -12,11 +12,10 @@ rm -f objfw${OBJFW_LIB_MAJOR}.dll libobjfw.${OBJFW_LIB_MAJOR}.dylib rm -f libobjfwrt.so.${OBJFWRT_LIB_MAJOR} rm -f libobjfwrt.so.${OBJFWRT_LIB_MAJOR_MINOR} rm -f objfwrt${OBJFWRT_LIB_MAJOR}.dll rm -f libobjfwrt.${OBJFWRT_LIB_MAJOR}.dylib - rm -f ${OBJFWRT_AMIGA_LIB} if test -f ../../src/libobjfw.so; then \ ${LN_S} ../../src/libobjfw.so libobjfw.so.${OBJFW_LIB_MAJOR}; \ ${LN_S} ../../src/libobjfw.so \ libobjfw.so.${OBJFW_LIB_MAJOR_MINOR}; \ elif test -f ../../src/libobjfw.so.${OBJFW_LIB_MAJOR_MINOR}; then \ @@ -45,14 +44,10 @@ fi if test -f ../../src/runtime/libobjfwrt.dylib; then \ ${LN_S} ../../src/runtime/libobjfwrt.dylib \ libobjfwrt.${OBJFWRT_LIB_MAJOR}.dylib; \ fi - if test -f ../../src/runtime/${OBJFWRT_AMIGA_LIB}; then \ - ${LN_S} ../../src/runtime/${OBJFWRT_AMIGA_LIB} \ - ${OBJFWRT_AMIGA_LIB}; \ - fi LD_LIBRARY_PATH=.$${LD_LIBRARY_PATH+:}$$LD_LIBRARY_PATH \ DYLD_LIBRARY_PATH=.$${DYLD_LIBRARY_PATH+:}$$DYLD_LIBRARY_PATH \ LIBRARY_PATH=.$${LIBRARY_PATH+:}$$LIBRARY_PATH \ ${WRAPPER} ./${PROG_NOINST}; EXIT=$$?; \ rm -f libobjfw.so.${OBJFW_LIB_MAJOR}; \ Index: tests/terminal/Makefile ================================================================== --- tests/terminal/Makefile +++ tests/terminal/Makefile @@ -12,11 +12,10 @@ rm -f objfw${OBJFW_LIB_MAJOR}.dll libobjfw.${OBJFW_LIB_MAJOR}.dylib rm -f libobjfwrt.so.${OBJFWRT_LIB_MAJOR} rm -f libobjfwrt.so.${OBJFWRT_LIB_MAJOR_MINOR} rm -f objfwrt${OBJFWRT_LIB_MAJOR}.dll rm -f libobjfwrt.${OBJFWRT_LIB_MAJOR}.dylib - rm -f ${OBJFWRT_AMIGA_LIB} if test -f ../../src/libobjfw.so; then \ ${LN_S} ../../src/libobjfw.so libobjfw.so.${OBJFW_LIB_MAJOR}; \ ${LN_S} ../../src/libobjfw.so \ libobjfw.so.${OBJFW_LIB_MAJOR_MINOR}; \ elif test -f ../../src/libobjfw.so.${OBJFW_LIB_MAJOR_MINOR}; then \ @@ -45,14 +44,10 @@ fi if test -f ../../src/runtime/libobjfwrt.dylib; then \ ${LN_S} ../../src/runtime/libobjfwrt.dylib \ libobjfwrt.${OBJFWRT_LIB_MAJOR}.dylib; \ fi - if test -f ../../src/runtime/${OBJFWRT_AMIGA_LIB}; then \ - ${LN_S} ../../src/runtime/${OBJFWRT_AMIGA_LIB} \ - ${OBJFWRT_AMIGA_LIB}; \ - fi LD_LIBRARY_PATH=.$${LD_LIBRARY_PATH+:}$$LD_LIBRARY_PATH \ DYLD_LIBRARY_PATH=.$${DYLD_LIBRARY_PATH+:}$$DYLD_LIBRARY_PATH \ LIBRARY_PATH=.$${LIBRARY_PATH+:}$$LIBRARY_PATH \ ${WRAPPER} ./${PROG_NOINST}; EXIT=$$?; \ rm -f libobjfw.so.${OBJFW_LIB_MAJOR}; \