// RHP Defines for Mac Seems to me they may as well all be in one place to save repetition
// Make sure we only do it once
#ifndef Mac

#define Mac

#include "utilities.h"
//#define DNEWS_VERSION CGetVers()


//define macwindow if you want dnews to have a window etc rather than background only
#define MacWindow


#undef WIN32x
#undef WIN32
#undef xVMS
#undef VMS
#define unix
#define NO_FCNTL
#define NOTUNIX TRUE
#define GOT_SOCKADDR TRUE
#define NEED_DTABLE TRUE
#define NODIRENT
#define USEGMTOFF
#define NEED_STRDUP
#define GMTVARS
#define DOCAST
#define CAST_SOCKET

#define BADMALLOC

#define ALLOWFOREGROUND

#include <Files.h>
#include <string.h>
#include <stdio.h>
#include <unix.h>
#include <errno.h>
#include "myunixlib.h"
#include <memory.h>  //RHP2
#include "Profiler.h"
#include <Folders.h>

#include "str.h"
#include "myraw.h"

#define DWORD int
#define LONG int
#define BYTE char

typedef unsigned long       DWORD;
typedef long       LONG;
typedef unsigned short      WORD;

#define MAKEWORD(a, b)      ((WORD)(((BYTE)(a)) | ((WORD)((BYTE)(b))) << 8))
#define MAKELONG(a, b)      ((LONG)(((WORD)(a)) | ((DWORD)((WORD)(b))) << 16))
#define LOWORD(l)           ((WORD)(l))
#define HIWORD(l)           ((WORD)(((DWORD)(l) >> 16) & 0xFFFF))
#define LOBYTE(w)           ((BYTE)(w))
#define HIBYTE(w)           ((BYTE)(((WORD)(w) >> 8) & 0xFF))

/* prototypes */
String *SFreeMem(void);
void CheckEvents(void);//RHP9
FILE * mac_fopen(char *fname, char *mode);

#define NEW_MACIO 1

#ifndef NEW_MACIO
#define remove(x) mac_remove(x)
#define fopen(x,y) mac_fopen(x,y)
#else
#include "macbf.h" 
#endif 

#endif