mirror of
https://github.com/obarthel/amiga-smbfs.git
synced 2025-12-08 14:58:35 +00:00
Updated to work with GCC, too.
This commit is contained in:
+37
-16
@@ -20,23 +20,24 @@
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
#define __USE_INLINE__
|
||||
#define __NOGLOBALIFACE__
|
||||
#define __NOLIBBASE__
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#include <dos/dos.h>
|
||||
|
||||
#include <clib/exec_protos.h>
|
||||
#include <clib/dos_protos.h>
|
||||
|
||||
#ifdef __SASC
|
||||
#include <pragmas/exec_pragmas.h>
|
||||
#include <pragmas/dos_pragmas.h>
|
||||
#else
|
||||
#include <inline/exec.h>
|
||||
#include <inline/dos.h>
|
||||
#endif /* __SASC */
|
||||
#include <proto/exec.h>
|
||||
#include <proto/dos.h>
|
||||
|
||||
#include <string.h>
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#if defined(__SASC)
|
||||
extern struct Library * AbsExecBase;
|
||||
extern struct Library * DOSBase;
|
||||
|
||||
@@ -45,6 +46,20 @@ extern struct Library * DOSBase;
|
||||
extern void kprintf(const char *,...);
|
||||
extern void __stdargs kputc(char c);
|
||||
|
||||
#elif defined (__GNUC__) && defined(__amigaos4__)
|
||||
|
||||
extern struct Library * SysBase;
|
||||
extern struct Library * DOSBase;
|
||||
|
||||
extern struct ExecIFace * IExec;
|
||||
extern struct DOSIFace * IDOS;
|
||||
extern struct SocketIFace * ISocket;
|
||||
|
||||
extern void kprintf(const char *,...);
|
||||
extern void kputc(char c);
|
||||
|
||||
#endif /* __GNUC__ */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#include <stdarg.h>
|
||||
@@ -311,19 +326,25 @@ _DPRINTF_HEADER(
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __SASC
|
||||
#if defined(__SASC)
|
||||
|
||||
static void __asm
|
||||
putch(register __d0 UBYTE c)
|
||||
static void __asm putch(register __d0 UBYTE c)
|
||||
{
|
||||
if(c != '\0')
|
||||
kputc(c);
|
||||
}
|
||||
|
||||
#else
|
||||
#elif defined(__GNUC__) && defined(__amigaos4__)
|
||||
|
||||
static void
|
||||
putch(UBYTE c __asm("d0"))
|
||||
static void putch(UBYTE c)
|
||||
{
|
||||
if(c != '\0')
|
||||
kputc(c);
|
||||
}
|
||||
|
||||
#elif defined(__GNUC__)
|
||||
|
||||
static void putch(UBYTE c __asm("d0"))
|
||||
{
|
||||
if(c != '\0')
|
||||
kputc(c);
|
||||
|
||||
+45
-1
@@ -51,7 +51,7 @@
|
||||
#define PUSH_ALL() PUSHDEBUGLEVEL(2)
|
||||
#define POP() POPDEBUGLEVEL()
|
||||
|
||||
#if defined(DEBUG) /*&& defined(__SASC)*/
|
||||
#if defined(DEBUG) && defined(__SASC)
|
||||
void _ASSERT(int x,const char *xs,const char *file,int line,const char *function);
|
||||
void _SHOWVALUE(unsigned long value,int size,const char *name,const char *file,int line);
|
||||
void _SHOWPOINTER(void *p,const char *name,const char *file,int line);
|
||||
@@ -93,6 +93,50 @@
|
||||
|
||||
extern int __debug_level;
|
||||
|
||||
#undef DEBUG
|
||||
#define DEBUG 1
|
||||
#elif defined(DEBUG) && defined(__GNUC__)
|
||||
void _ASSERT(int x,const char *xs,const char *file,int line,const char *function);
|
||||
void _SHOWVALUE(unsigned long value,int size,const char *name,const char *file,int line);
|
||||
void _SHOWPOINTER(void *p,const char *name,const char *file,int line);
|
||||
void _SHOWSTRING(const char *string,const char *name,const char *file,int line);
|
||||
void _SHOWMSG(const char *msg,const char *file,int line);
|
||||
void _ENTER(const char *file,int line,const char *function);
|
||||
void _LEAVE(const char *file,int line,const char *function);
|
||||
void _RETURN(const char *file,int line,const char *function,unsigned long result);
|
||||
void _DPRINTF_HEADER(const char *file,int line);
|
||||
void _DPRINTF(const char *format,...);
|
||||
void _DLOG(const char *format,...);
|
||||
void _SETDEBUGFILE(BPTR file);
|
||||
int _SETDEBUGLEVEL(int level);
|
||||
void _PUSHDEBUGLEVEL(int level);
|
||||
void _POPDEBUGLEVEL(void);
|
||||
int _GETDEBUGLEVEL(void);
|
||||
void _SETPROGRAMNAME(char *name);
|
||||
void _INDENT(void);
|
||||
|
||||
#define ASSERT(x) _ASSERT((int)(x),#x,__FILE__,__LINE__,__FUNCTION__)
|
||||
#define ENTER() _ENTER(__FILE__,__LINE__,__FUNCTION__)
|
||||
#define LEAVE() _LEAVE(__FILE__,__LINE__,__FUNCTION__)
|
||||
#define RETURN(r) _RETURN(__FILE__,__LINE__,__FUNCTION__,(unsigned long)r)
|
||||
#define SHOWVALUE(v) _SHOWVALUE((ULONG)v,sizeof(v),#v,__FILE__,__LINE__)
|
||||
#define SHOWPOINTER(p) _SHOWPOINTER(p,#p,__FILE__,__LINE__)
|
||||
#define SHOWSTRING(s) _SHOWSTRING(s,#s,__FILE__,__LINE__)
|
||||
#define SHOWMSG(s) _SHOWMSG(s,__FILE__,__LINE__)
|
||||
#define D(s) do { _DPRINTF_HEADER(__FILE__,__LINE__); _DPRINTF s; } while(0)
|
||||
#define PRINTHEADER() _DPRINTF_HEADER(__FILE__,__LINE__)
|
||||
#define PRINTF(s) _DLOG s
|
||||
#define LOG(s) do { _DPRINTF_HEADER(__FILE__,__LINE__); _DLOG("<%s()>:",__FUNCTION__); _DLOG s; } while(0)
|
||||
#define SETDEBUGLEVEL(l) _SETDEBUGLEVEL(l)
|
||||
#define PUSHDEBUGLEVEL(l) _PUSHDEBUGLEVEL(l)
|
||||
#define POPDEBUGLEVEL() _POPDEBUGLEVEL()
|
||||
#define SETDEBUGFILE(f) _SETDEBUGFILE(f)
|
||||
#define SETPROGRAMNAME(n) _SETPROGRAMNAME(n)
|
||||
#define GETDEBUGLEVEL() _GETDEBUGLEVEL()
|
||||
#define INDENT() _INDENT()
|
||||
|
||||
extern int __debug_level;
|
||||
|
||||
#undef DEBUG
|
||||
#define DEBUG 1
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user