revert between 56095 -> 55830 in arch
[AROS.git] / compiler / stdc / __optionallibs.c
blobb81392c30c4361595c33c852aef8b1b597824fca
1 /*
2 Copyright © 2013-2018, The AROS Development Team. All rights reserved.
3 */
5 #include <proto/exec.h>
7 #define __NOBLIBBASE__
9 #include <proto/locale.h>
10 #include <proto/intuition.h>
12 #include "__stdc_intbase.h"
13 #include "__optionallibs.h"
15 /* Internal function __libfindandopen will only open a library when it is
16 already in the list of open libraries
18 static struct Library *__libfindandopen(const char *libname, int version)
20 struct Node *found;
22 Forbid();
23 found = FindName(&SysBase->LibList, libname);
24 Permit();
26 return (found != NULL) ? OpenLibrary(libname, version) : NULL;
29 int __locale_available(struct StdCIntBase *StdCBase)
31 if (StdCBase->StdCLocaleBase == NULL)
32 StdCBase->StdCLocaleBase = (struct LocaleBase *)__libfindandopen("locale.library", 0);
34 return StdCBase->StdCLocaleBase != NULL;
37 int __intuition_available(struct StdCIntBase *StdCBase)
39 if (StdCBase->StdCIntuitionBase == NULL)
40 StdCBase->StdCIntuitionBase = (struct IntuitionBase *)__libfindandopen("intuition.library", 0);
42 return StdCBase->StdCIntuitionBase != NULL;