From 392fa2ea4cfc5df5a86b6cde0e05c909da26f1e5 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sun, 18 Jan 2015 23:29:49 +0000 Subject: Fix some easy OS3 linker errors --- amiga/Makefile.defaults | 6 +++++- amiga/Makefile.target | 2 +- amiga/help.c | 2 ++ amiga/libs.c | 17 ++++++++++++++++- amiga/os3support.h | 3 ++- 5 files changed, 26 insertions(+), 4 deletions(-) diff --git a/amiga/Makefile.defaults b/amiga/Makefile.defaults index 2134e8373..243e44b38 100644 --- a/amiga/Makefile.defaults +++ b/amiga/Makefile.defaults @@ -4,7 +4,11 @@ # Force using glibc internal iconv implementation instead of external libiconv # Valid options: YES, NO -NETSURF_USE_LIBICONV_PLUG := YES +ifneq ($(SUBTARGET),os3) + NETSURF_USE_LIBICONV_PLUG := YES +else + NETSURF_USE_LIBICONV_PLUG := NO +endif # Enable NetSurf's use of librosprite for displaying RISC OS Sprites # Valid options: YES, NO, AUTO diff --git a/amiga/Makefile.target b/amiga/Makefile.target index d29e7aa17..ec478260d 100644 --- a/amiga/Makefile.target +++ b/amiga/Makefile.target @@ -53,7 +53,7 @@ else LDFLAGS += -L$(GCCSDK_INSTALL_ENV)/lib ifeq ($(SUBTARGET),os3) - LDFLAGS += -lpbl -liconv + LDFLAGS += -lpbl -liconv -lamiga else LDFLAGS += -lpbl -liconv endif diff --git a/amiga/help.c b/amiga/help.c index 76dd1bd86..64b338426 100755 --- a/amiga/help.c +++ b/amiga/help.c @@ -16,6 +16,8 @@ * along with this program. If not, see . */ +#include "amiga/os3support.h" + #include "amiga/help.h" /* AmigaGuide class */ diff --git a/amiga/libs.c b/amiga/libs.c index 7810fad6e..0f5131df8 100644 --- a/amiga/libs.c +++ b/amiga/libs.c @@ -74,7 +74,11 @@ #define GraphicsBase GfxBase /* graphics.library is a bit weird */ +#ifdef __amigaos4__ AMINS_LIB_STRUCT(Application); +#else +struct UtilityBase *UtilityBase; /* AMINS_LIB_STRUCT(Utility) */ +#endif AMINS_LIB_STRUCT(Asl); AMINS_LIB_STRUCT(DataTypes); AMINS_LIB_STRUCT(Diskfont); @@ -113,7 +117,14 @@ AMINS_LIB_STRUCT(Window); bool ami_libs_open(void) { +#ifdef __amigaos4__ + /* Libraries only needed on OS4 */ AMINS_LIB_OPEN("application.library", 53, Application, "application", 2, false) +#else + /* Libraries we get automatically on OS4 but not OS3 */ + AMINS_LIB_OPEN("utility.library", 37, Utility, "main", 1, true) +#endif + /* Standard libraries for both versions */ AMINS_LIB_OPEN("asl.library", 37, Asl, "main", 1, true) AMINS_LIB_OPEN("datatypes.library", 37, DataTypes, "main", 1, true) AMINS_LIB_OPEN("diskfont.library", 40, Diskfont, "main", 1, true) @@ -191,7 +202,6 @@ void ami_libs_close(void) AMINS_LIB_CLOSE(String) AMINS_LIB_CLOSE(Window) - AMINS_LIB_CLOSE(Application) AMINS_LIB_CLOSE(Asl) AMINS_LIB_CLOSE(DataTypes) AMINS_LIB_CLOSE(Diskfont) @@ -205,5 +215,10 @@ void ami_libs_close(void) AMINS_LIB_CLOSE(Locale) AMINS_LIB_CLOSE(P96) AMINS_LIB_CLOSE(Workbench) +#ifdef __amigaos4__ + AMINS_LIB_CLOSE(Application) +#else + AMINS_LIB_CLOSE(Utility) +#endif } diff --git a/amiga/os3support.h b/amiga/os3support.h index e28985eaf..4b5deb251 100644 --- a/amiga/os3support.h +++ b/amiga/os3support.h @@ -47,9 +47,9 @@ /* Macros */ #define IsMinListEmpty(L) (L)->mlh_Head->mln_Succ == 0 - #define LIB_IS_AT_LEAST(B,V,R) ((B)->lib_Version>(V)) || \ ((B)->lib_Version==(V) && (B)->lib_Revision>=(R)) +#define EAD_IS_FILE(E) ((E)->ed_Type<0) /* Define extra memory type flags */ #define MEMF_PRIVATE MEMF_ANY @@ -136,6 +136,7 @@ #define SetRPAttrs(...) (void)0 /*\todo Probably need to emulate this */ /* Intuition */ +#define ICoerceMethod CoerceMethod #define IDoMethod DoMethod #define IDoMethodA DoMethodA #define IDoSuperMethodA DoSuperMethodA -- cgit v1.2.3