Not too shy to talk
Joined: 2011/6/3 13:49 Last Login
: Yesterday 7:44
Group:
Registered Users
|
Just add this at the beginning #ifdef __amigaos4__ #define OS4 #else #define OS3 #endif
#ifdef OS4 #define __USE_INLINE__ #define __USE_BASETYPE__ #define __USE_OLD_TIMEVAL__ #pragma pack(2) #endif
and open the .library this way
/*==================================================================================*/ BOOL OpenAmigaLibraries() { /* Initialize the needed libraries */ #define LIBOPEN(libbase,name,version) libbase =(void*)OpenLibrary(#name,(ULONG)version); if(libbase==NULL) return(FALSE); #define LIBOPEN4(interface,libbase) interface=(void*)GetInterface((struct Library *)libbase, "main", 1, NULL); if(interface==NULL) return(FALSE);
LIBOPEN(DOSBase,dos.library,36) LIBOPEN(GfxBase,graphics.library,0) LIBOPEN(IntuitionBase,intuition.library,0) LIBOPEN(CyberGfxBase,cybergraphics.library,0) if (OpenDevice(TIMERNAME, UNIT_MICROHZ, (struct IORequest *)&tr, 0L) != 0) return(FALSE); TimerBase = (struct Device *) tr.tr_node.io_Device;
#ifdef OS4 LIBOPEN4(IExec,SysBase)
LIBOPEN(NewlibBase,newlib.library, 52) LIBOPEN4(INewlib,NewlibBase)
LIBOPEN4(IDOS,DOSBase) LIBOPEN4(IGraphics,GfxBase) LIBOPEN4(IIntuition,IntuitionBase) LIBOPEN4(ICyberGfx,CyberGfxBase)
LIBOPEN4(ITimer,TimerBase); #endif
return(TRUE); } /*======================================================================================*/ void CloseAmigaLibraries() { #define LIBCLOSE(libbase) if(libbase !=NULL) { CloseLibrary((struct Library *)libbase ); libbase=NULL; } #define LIBCLOSE4(interface) if(interface!=NULL) { DropInterface((struct Interface*)interface ); interface=NULL; }
#ifdef OS4 LIBCLOSE4(INewlib) LIBCLOSE(NewlibBase)
LIBCLOSE4(IDOS) LIBCLOSE4(IGraphics) LIBCLOSE4(IIntuition) LIBCLOSE4(ICyberGfx)
LIBCLOSE4(ITimer) #endif
LIBCLOSE(DOSBase) LIBCLOSE(GfxBase) LIBCLOSE(IntuitionBase) LIBCLOSE(CyberGfxBase)
CloseDevice((struct IORequest *)&tr); } /*==================================================================================*/
|