revert between 56095 -> 55830 in arch
[AROS.git] / rom / exec / exec_autoinit.c
blob03cf1d26133fdc351c976c8305554fcf700cd342
1 /*
2 * Copyright (C) 2015, The AROS Development Team
3 * All right reserved.
4 * Author: Jason S. McMullan <jason.mcmullan@gmail.com>
6 * Licensed under the AROS PUBLIC LICENSE (APL) Version 1.1
7 */
9 #include <aros/symbolsets.h>
10 #include <aros/asmcall.h>
11 #include <aros/autoinit.h>
13 #include <exec/libraries.h>
15 #include <proto/exec.h>
16 #include <proto/dos.h>
18 /* Linklib to provide a 'SysBase' symbol. Also verifies that
19 * the symbol is set appropriately.
21 struct ExecBase *SysBase;
22 extern const LONG __aros_libreq_SysBase __attribute__((weak));
24 static int SysBase_autoinit(struct ExecBase *sysBase)
26 if (sysBase == NULL)
27 return FALSE;
29 SysBase = sysBase;
31 if (__aros_libreq_SysBase > SysBase->LibNode.lib_Version) {
32 IPTR arr[] = {
33 (IPTR)(FindTask(NULL)->tc_Node.ln_Name),
34 __aros_libreq_SysBase,
35 SysBase->LibNode.lib_Version
37 __showerror("%s: Requires exec.library v%ld, found v%ld\n",arr);
38 return FALSE;
41 return TRUE;
44 ADD2INIT(SysBase_autoinit,-128)