//=========================================================================
// Summary  : */
// Filename : ourTypes.h
// Author   : */
// Project  : */
// Revision : 4
// Created  : 2000/08/19
// Modified : 2000/09/01
//=========================================================================
// Description :
//=========================================================================
#ifndef _ALTEXTYPES_H
#define _ALTEXTYPES_H

/// Microsoft portability section
#ifdef _MSC_VER
# define __far

typedef int   pid_t;            /* Used for process IDs & group IDs */
typedef signed ssize_t;
typedef int uid_t;             /* Used for user IDs            */
typedef int gid_t;             /* Used for group IDs           */
typedef short unsigned  mode_t; /* Used for some file attributes    */
typedef long        off_t;      /* Used for file sizes, offsets     */
typedef long        nid_t;      /* Used for network IDs         */

// Need to have this namespace present so that STL makes sense to Windows.
// Otherwise, all STL classes must be prefaced with "STL::"
// This would be fine, but QNX doesn't know about namespaces.
namespace std
{
  typedef int SILLY_PORT_ISSUE;
}
using namespace std;

// Get rid of the long symbol warning
# pragma warning( disable : 4786 )
#endif
/////  END Microsoft section

// This is _such_ a mess...
#ifdef WIN32
#include "C:\Program Files\Microsoft Visual Studio .NET\Vc7\include\math.h"
#else
#include <math.h>
#endif

#include <sys/types.h>
#include "MyAssert.h"

//#include <string.h>

#if (! defined(_AUV_PORTABLE))
#include </usr/include/syslog.h>  // QNX/Watcom bug; include full path
#include <stl/_config.h>
#endif

#define AUV_GID 100

#if defined(_AUV_PORTABLE) && (! defined(__CYGWIN__))
// dprintf is actually defined in Linux stdio.h unless
// __STRICT_ANSI__ is defined, preemptively.
// Who knows what other problems we're making? -MZ
#define __STRICT_ANSI__
#endif


//
//  And finally, OS independent declarations!
//

//== Various debugging constructs (new school...) ==========
#define debug_t short
#define DEBUG_T_MIN 0
#define DEBUG_T_MAX 5
#define DEBUG_T_NONMASKABLE -1

#if (! defined(_AUV_PORTABLE))
#define dwrite(a) if( debug >= a ) Syslog::write

#define dprintf if ( debug >= 1 ) Syslog::write
#endif

#if defined(_AUV_PORTABLE)
#define dwrite(a) if (debug >= a) printf
#define dprintf if (debug >= 1 ) printf
#endif


#ifndef _EMULATOR
#define NoPid ((pid_t )-1)
#define AnyPid ((pid_t )0)
#endif

#define True 1
#define False 0
#define On True
#define Off False
#define true 1
#define false 0

#define OK 0
#ifndef _MSC_VER
# define ERROR -1
#endif

#define MaxSharedObjNameLen 256

#define DeviceIFNameLength 32

typedef unsigned char Boolean;

#define MaxLong 2147483648

#define callMemberFunction(objPtr, memberPtr) ((objPtr)->*(memberPtr))

//had to change previous definitions as they conflicted with stl
//just included string.h here, and the definitions will 
//be taken from algobase.  But Windows doesn't like this.

/*
#if (! defined(_AUV_PORTABLE))
inline unsigned long min (unsigned long __a, unsigned long __b)
{
 return __b < __a ? __b : __a;
}

inline unsigned long max (unsigned long __a, unsigned long __b)
{
  return  __a < __b ? __b : __a;
}
*/

typedef short StateT;
#endif

//#if defined(_AUV_PORTABLE)
#define max(a,b)  (((a) > (b)) ? (a) : (b))
#define min(a,b)  (((a) < (b)) ? (a) : (b))
//#endif

#define clean( a ) { if(a){ delete a; a=0; } }




//#endif
