
#ifndef h_oscompat_h
#define h_oscompat_h

void *MemGluePtrNewL ( UInt32 foo );

extern int errno;

char *strdup(const char *s);

#if 0//def _TG16_
#define malloc(a) MemPtrNew(a)
#define free(a) MemPtrFree(a)
#define realloc(p,s) MemPtrResize(p,s)
#define memset(s,c,n) MemSet(s,n,c)
#define memcpy(t,f,s) MemMove(t,f,s)
#else
#define alloca(a) MemPtrNew(a)
//#define malloc(a) MemPtrNew(a)
void *malloc ( unsigned int s );
void *calloc ( unsigned int s, unsigned int n );
//#define free(a) MemPtrFree(a)
void free ( void *p );
//#define realloc(p,s) MemPtrResize(p,s)
void *realloc ( unsigned char *p, UInt32 s );
void *MyRealloc ( void *p, UInt32 s );
void *memcpy ( void *d, const void *s, unsigned int size );
//#define memset(s,c,n) MemSet(s,n,c)
void *memset ( void *b, int c, unsigned int len );
//#define memcpy(t,f,s) MemMove(t,f,s)
#endif
#define memcmp(a,b,s) MemCmp(a,b,s)
#define assert(a)
#define htonl(a) a
#define ntohl(a) a
#define puts(a) DEBUGS(a)

#define strcpy StrCopy
#define strlen StrLen
#define strcat StrCat
#define strcmp StrCompare
#define strchr StrChr
#define strncpy StrNCopy
#define strlwr(a) StrToLower(a,a)
#define strstr StrStr
#define sprintf StrPrintF

#define realloc	MyRealloc

void abort ( void );
int abs ( int x );

void debuglog ( char *poo );

#ifndef int8
typedef  signed char    int8;
#endif
#ifndef int16
typedef  signed short   int16;
#endif
#ifndef int32
typedef  signed long     int32;
#endif
#ifndef uint8
typedef  unsigned char  uint8;
#endif
#ifndef uint16
typedef  unsigned short uint16;
#endif
#ifndef uint32
typedef  unsigned long   uint32;
#endif

#endif
