/********************************************************
* File: defs.h
* Created at Sun Jan 28 22:10:26 MSK 2001 by raorn // raorn@binec.ru
* OS dependent stuff
* $Id: defs.h,v 1.5 2001/11/10 19:22:56 raorn Exp $
*******************************************************/
#ifndef MACHINE_DEFS_H
#define MACHINE_DEFS_H
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <stddef.h>
#include <sys/types.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
typedef unsigned short UINT16; /* Unsigned 16-bit integer */
#define EXIT_ERROR 10
#define EXIT_OK 0
#if defined(linux)
# define PLATFORM_NAME "Linux"
# define PATH_CHARS "/"
#elif defined(__FreeBSD__)
# define PLATFORM_NAME "FreeBSD"
# define PATH_CHARS "/"
#elif defined(__MINGW32__)
# define PLATFORM_NAME "Win32"
# define PATH_CHARS "\\"
#else
# define PLATFORM_NAME "UNIX"
# define PATH_CHARS "/"
#endif
/*
* PATH_CHARS is used by MakeFullPath. If path doesn't end with one of
* these characters, the first character will be appended to it.
*
* Example:
*
* PATH_CHARS = "/:"
*
* "inbound" + "file" --> "inbound/file"
* "inbound/" + "file" --> "inbound/file"
* "inbound:" + "file" --> "inbound/file"
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#define FALSE 0
#define TRUE 1
#ifdef MSGBASE_JAM
# include <jamlib/jam.h>
# undef HAVE_UCHAR
# undef HAVE_USHORT
# undef HAVE_ULONG
# define HAVE_UCHAR 1
# define HAVE_USHORT 1
# define HAVE_ULONG 1
#endif
#ifndef HAVE_UCHAR
typedef unsigned char uchar;
#endif
#ifndef HAVE_USHORT
typedef unsigned short ushort;
#endif
#ifndef HAVE_ULONG
typedef unsigned long ulong;
#endif
#ifndef HAVE_BOOL
typedef int bool;
#endif
#ifndef HAVE_STRICMP
# ifdef HAVE_STRCASECMP
# define stricmp strcasecmp
# else
# define stricmp strcmp
# endif
#endif
#ifndef HAVE_STRNICMP
# ifdef HAVE_STRNCASECMP
# define strnicmp strncasecmp
# else
# define strnicmp strncmp
# endif
#endif
#ifndef HAVE_STRERROR
char *strerror(int errnum);
#endif
#ifdef __MINGW32__
# define snprintf _snprintf
# define vsnprintf _vsnprintf
# define kill(pid,signal) 0
/*# define chown(file,owner,group) access((file),F_OK)*/
# define mkdir(name,mode) mkdir((name))
#endif
#endif
syntax highlighted by Code2HTML, v. 0.9.1