diff options
author | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2015-01-18 21:11:00 +0000 |
---|---|---|
committer | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2015-01-18 21:11:00 +0000 |
commit | 2eb41ed77b2deb3a1c54c7b6b94a7c31fb603714 (patch) | |
tree | 1c93c241db79a2646e701a932a592a2f1b8b5fa4 /amiga/libs.c | |
parent | d6052d3955ffa1aca81c3363b7c53aec51cb6208 (diff) | |
download | netsurf-2eb41ed77b2deb3a1c54c7b6b94a7c31fb603714.tar.gz netsurf-2eb41ed77b2deb3a1c54c7b6b94a7c31fb603714.tar.bz2 |
More OS3 fixes
Diffstat (limited to 'amiga/libs.c')
-rw-r--r-- | amiga/libs.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/amiga/libs.c b/amiga/libs.c index ec41ee22e..7810fad6e 100644 --- a/amiga/libs.c +++ b/amiga/libs.c @@ -16,6 +16,8 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include "amiga/os3support.h" + #include "amiga/libs.h" #include "amiga/misc.h" #include "utils/utils.h" @@ -24,6 +26,7 @@ #include <proto/exec.h> #include <proto/utility.h> +#ifdef __amigaos4__ #define AMINS_LIB_OPEN(LIB, LIBVER, PREFIX, INTERFACE, INTVER, FAIL) \ LOG(("Opening %s v%d", LIB, LIBVER)); \ if((PREFIX##Base = OpenLibrary(LIB, LIBVER))) { \ @@ -48,6 +51,26 @@ #define AMINS_LIB_STRUCT(PREFIX) \ struct Library *PREFIX##Base; \ struct PREFIX##IFace *I##PREFIX; +#else +#define AMINS_LIB_OPEN(LIB, LIBVER, PREFIX, INTERFACE, INTVER, FAIL) \ + LOG(("Opening %s v%d", LIB, LIBVER)); \ + if((PREFIX##Base = OpenLibrary(LIB, LIBVER))) { \ + } else { \ + LOG(("Failed to open %s v%d", LIB, LIBVER)); \ + if(FAIL == true) { \ + STRPTR error = ASPrintf("Unable to open %s v%d", LIB, LIBVER); \ + ami_misc_fatal_error(error); \ + FreeVec(error); \ + return false; \ + } \ + } + +#define AMINS_LIB_CLOSE(PREFIX) \ + if(PREFIX##Base) CloseLibrary(PREFIX##Base); + +#define AMINS_LIB_STRUCT(PREFIX) \ + struct Library *PREFIX##Base; +#endif #define GraphicsBase GfxBase /* graphics.library is a bit weird */ |