@@ -21,10 +21,13 @@ #import "OFInitializationFailedException.h" #import "macros.h" +#ifdef OF_COMPILING_AMIGA_LIBRARY +struct Library *DOSBase; +#endif #ifdef OF_AMIGAOS4 extern struct Library *DOSBase; extern struct DOSIFace *IDOS; #endif struct Library *LocaleBase; @@ -32,14 +35,16 @@ struct LocaleIFace *ILocale; #endif OF_CONSTRUCTOR() { -#ifdef OF_AMIGAOS4 +#if defined(OF_COMPILING_AMIGA_LIBRARY) || defined(OF_AMIGAOS4) if ((DOSBase = OpenLibrary("dos.library", 36)) == NULL) @throw [OFInitializationFailedException exception]; +#endif +#ifdef OF_AMIGAOS4 if ((IDOS = (struct DOSIFace *) GetInterface(DOSBase, "main", 1, NULL)) == NULL) @throw [OFInitializationFailedException exception]; #endif @@ -62,12 +67,14 @@ if (LocaleBase != NULL) CloseLibrary(LocaleBase); #ifdef OF_AMIGAOS4 - if (DOSBase != NULL) - CloseLibrary(DOSBase); - if (IDOS != NULL) DropInterface((struct Interface *)IDOS); #endif + +#if defined(OF_COMPILING_AMIGA_LIBRARY) || defined(OF_AMIGAOS4) + if (DOSBase != NULL) + CloseLibrary(DOSBase); +#endif }