2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
6 #include <aros/debug.h>
7 #include <aros/libcall.h>
8 #include <aros/symbolsets.h>
9 #include <proto/exec.h>
10 #include <proto/hostlib.h>
14 #include "battclock_intern.h"
17 #ifndef HOST_OS_android
18 #define LIBC_NAME "libc.so.6"
23 #define LIBC_NAME "libSystem.dylib"
27 #define LIBC_NAME "libc.so"
30 static const char *Symbols
[] = {
37 static int BattClock_Init(struct BattClockBase
*BattClockBase
)
42 HostLibBase
= OpenResource("hostlib.resource");
43 D(bug("[battclock] HostLibBase = 0x%08lX\n", HostLibBase
));
47 BattClockBase
->Lib
= HostLib_Open(LIBC_NAME
, NULL
);
48 if (BattClockBase
->Lib
)
50 BattClockBase
->SysIFace
= (struct BattclockInterface
*)HostLib_GetInterface(BattClockBase
->Lib
, Symbols
, &r
);
51 D(bug("[battclock] SysIFace = 0x%08lX, unresolved: %u\n", BattClockBase
->SysIFace
, r
));
53 if (BattClockBase
->SysIFace
)
57 HostLib_DropInterface((APTR
)BattClockBase
->SysIFace
);
59 HostLib_Close(BattClockBase
->Lib
, NULL
);
65 ADD2INITLIB(BattClock_Init
, 0)