/****************************************************************************************


		MCOSConfig.h


		Copyright: (c) 2001 Eovia Corp. All rights reserved.


		Author:	Ian
		Date:	12/11/97

		Revision History

		when		who			what & why
		==========	==========	======================================================
		7/5/98		Ian			We now only define a symbol for the platform we are on.
		6/2/98		Ian			Had to muck with the ARCH defines to get it to compile
								under x86 for metrowerks on Mac.
		06/02/98	nba			added FASTCALL macro
		06/02/98	nba			added ARCH* defines for architecture specific code
		05/14/98	nba			Added WIN32 for WIN definition (console compile)
 		4/6/98		pbk			Added some PB compatibility

*****************************************************************************************/

#ifndef __MCOSConfig__
#define __MCOSConfig__

#if CP_PRAGMA_ONCE
#pragma once
#endif

#undef MacOS_		
#undef Windows_
#undef MAC		
#undef WIN		

//	Figure out the target platform...

#ifdef macintosh

	//	Mac OS Compatible Computer
	#define MAC		1

#elif ((__MWERKS__ && __INTEL__) || _WINDOWS)

	//	Microsoft Windows Compatible Computer
	#define WIN		1

#else

	#if _WIN32
		//	Microsoft Windows Compatible Computer
		#define WIN		1
	#else
		#error unsupported architecture
	#endif

#endif


#if MAC

//	#if defined(powerc) || defined (__powerc) || defined(_ARCH_PPC)
//		#define	MAC_POWERPC		1		//	Mac OS PowerPC Processor Family
//	#endif

	#define FASTCALL
#elif WIN
	// try to use registers when calling functions
	#define FASTCALL __fastcall
#endif


// Processor types
#if defined(powerc) || defined (__powerc) || defined (_M_MPPC)
	// Power PC family
	#if WIN
		#define MC_BIG_ENDIAN			0
		#define MC_LITTLE_ENDIAN		1
	#elif MAC
		#define MC_BIG_ENDIAN			1
		#define MC_LITTLE_ENDIAN		0
	#else
		#error "Please update the architecture specific defines"
	#endif
	#define ARCH_POWER_PC
#elif defined(_M_ALPHA)
	// DEC ALPHA Processor
	#define ARCH_ALPHA
	#error "Please update the architecture specific defines"
#elif defined(_M_IX86)
	// x86
	#define MC_BIG_ENDIAN				0
	#define MC_LITTLE_ENDIAN			1
	#define ARCH_X86
#elif defined(_M_MRX000)
	// MIPS
	#define ARCH_MIPS
	#error "Please update the architecture specific defines"
#elif __GNUC__
	#if MAC
		#if __LITTLE_ENDIAN__
			#define MC_BIG_ENDIAN			0
			#define MC_LITTLE_ENDIAN		1
		#else
			#define MC_BIG_ENDIAN			1
			#define MC_LITTLE_ENDIAN		0
		#endif
		
		#if defined (__i386__)
			#define ARCH_X86
		#elif defined (__ppc__)
			#define ARCH_POWER_PC
		#else
			#error unknown architecture
		#endif
	#else
		#error "Please update the architecture specific defines"
	#endif
	
#else
	#error "Unknown architecture"
#endif


//---------------PB compatibility-----------

//I'd like to get rid of these as soon as possible.
#define Windows_		WIN
#define MacOS_			MAC
#define LittleEndian_	MC_LITTLE_ENDIAN
#define BigEndian_		MC_BIG_ENDIAN


#endif