X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=blobdiff_plain;f=amiga.h;h=a1277767bf24134d5bc1362cae0479471869ed12;hp=4d13690b48803273195bf03ed2b82c877af2f223;hb=46efa6f8fea119c9671cd61aa2e29b2a3f2ad75c;hpb=72081f829de368392d04076728f8c991178c0080 diff --git a/amiga.h b/amiga.h index 4d13690b..a1277767 100644 --- a/amiga.h +++ b/amiga.h @@ -1,10 +1,10 @@ #ifdef AMIGA #ifndef AMIGA_H_INCLUDED #define AMIGA_H_INCLUDED -#define AMIGA_H_VERSION "$Id: amiga.h,v 1.9 2002/03/26 22:29:54 swa Exp $" +#define AMIGA_H_VERSION "$Id: amiga.h,v 1.11 2006/07/18 14:48:45 david__schmidt Exp $" /********************************************************************* * - * File : $Source: /cvsroot/ijbswa/current/Attic/amiga.h,v $ + * File : $Source: /cvsroot/ijbswa/current/amiga.h,v $ * * Purpose : Amiga-specific declarations. * @@ -31,6 +31,10 @@ * * Revisions : * $Log: amiga.h,v $ + * Revision 1.11 2006/07/18 14:48:45 david__schmidt + * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) + * with what was really the latest development (the v_3_0_branch branch) + * * Revision 1.9 2002/03/26 22:29:54 swa * we have a new homepage! * @@ -69,11 +73,12 @@ #undef _KERNEL #define __NOLIBBASE__ +#define __NOGLOBALIFACE__ #include #undef __NOLIBBASE__ +#undef __NOGLOBALIFACE__ #define __CONSTLIBBASEDECL__ const -#define DEVICES_TIMER_H #include #include #include @@ -81,11 +86,20 @@ struct UserData { +#ifdef __amigaos4__ + struct SocketIFace *si; +#else struct Library *sb; +#endif int eno; }; +#ifdef __amigaos4__ +#define ISocket (((struct UserData *)(FindTask(NULL)->tc_UserData))->si) +#undef errno +#else #define SocketBase ((struct Library *)(((struct UserData *)(FindTask(NULL)->tc_UserData))->sb)) +#endif #define errno (((struct UserData *)(FindTask(NULL)->tc_UserData))->eno) #define select(a,b,c,d,e) WaitSelect(a,b,c,d,e,NULL) #define inet_ntoa(x) Inet_NtoA(x.s_addr) @@ -96,8 +110,35 @@ extern struct Task *main_task; void InitAmiga(void); void amiga_exit(void); void __memCleanUp(void); -__saveds ULONG server_thread(void); +SAVEDS ULONG server_thread(void); +#ifdef __amigaos4__ +#define exit(x) \ +{ \ + if(main_task) \ + { \ + if(main_task == FindTask(NULL)) \ + { \ + while(childs) Delay(10*TICKS_PER_SECOND); exit(x); \ + } \ + else \ + { \ + if (ISocket) \ + { \ + struct Library *sb = ISocket->Data.LibBase; \ + DropInterface((struct Interface *)ISocket); \ + CloseLibrary(sb); \ + } \ + childs--; \ + RemTask(NULL); \ + } \ + } \ + else \ + { \ + exit(x); \ + } \ +} +#else #define exit(x) \ { \ if(main_task) \ @@ -119,6 +160,12 @@ __saveds ULONG server_thread(void); } \ } +#undef HAVE_RANDOM +#define h_errno 0 +#define HAVE_TIMEGM +#define timegm(tm) mktime(tm) +#endif /* __amigaos4__ */ + #undef EINTR #define EINTR 0