/*	XConfig.h
 *
 *		This header does nothing but set different preprocessor
 *	symbols to specify the compiler target for this code.
 *
 *		This uses the Metrowerks Codewarrior predefined symbols
 *	for the Macintosh and for Windows, and depends on the ability
 *	to specify command-line predefined symbols for the GNU Unix tools.
 *
 *
 *		Note: to compile with X Windows support, compile with the
 *	symbol 'OPT_XWIN' set to 1. For Windows support, predefine the
 *	symbol 'WIN32' (done by default by Microsoft Visual C++).
 *
 *		On Unix, if this was installed with my installation scripts,
 *	information is pulled out of a generated header file called
 *	<XConfig_macdep.h>
 */

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

  YAAF is Copyright 1997-1999 by William Woody.

  Redistribution and use in source and binary forms, with or without 
  modification, are permitted provided that the following conditions 
  are met:

  Redistributions of source code must retain the above copyright notice, 
  this list of conditions and the following disclaimer.

  Neither the name of the copyright holder or other contributors may
  be used to promote products derived from this software without
  specific written prior permission.

  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 
  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 
  OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 
  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 
  BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 
  ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 
  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 
  SOFTWARE.
  
  Contact:   woody@alumni.caltech.edu
  Web page:  http://www.pandawave.com/yaaf/

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


#ifndef PandaWave_XCONFIG
#define PandaWave_XCONFIG


/************************************************************************/
/*																		*/
/*	Define the version of YAAF this is									*/
/*																		*/
/************************************************************************/

/*$	YAAF_VERSION
 *
 *		Gives the version of YAAF that you are compiling against. The
 *	YAAF library version number is specified as:
 *
 *		XX YY ZZ WW
 *
 *		XX = major version (1)
 *		YY = minor version (0)
 *		ZZ = alpha, beta, release (01 == alpha, 02 == beta, 04 == release)
 *		WW = revision (6)
 */

#define YAAF_VERSION			0x01000107		/* 1.0a7 */

/************************************************************************/
/*																		*/
/*	Define the appropriate symbols										*/
/*																		*/
/************************************************************************/

#if defined(__MWERKS__)	|| defined(__MRC__)					// using Metrowerks?

	#if defined(macintosh)
		#define OPT_MACOS		1
		#define OPT_WINOS		0
		#define OPT_XWIN		0
	#endif // defined(macintosh)
	
	#if defined(__INTEL__)
		#define OPT_MACOS		0
		#define OPT_WINOS		1
		#define OPT_XWIN		0
	#endif // defined(__INTEL__)

#else // !defined(__MWERKS__)

	#if OPT_XWIN == 1
		#define OPT_MACOS		0
		#define OPT_WINOS		0
	#elif defined(WIN32)
		#define OPT_MACOS		0
		#define OPT_WINOS		1
		#define OPT_XWIN		0
	#else
		// if we get here in the precompiler, assume this is on Unix
		// and the user didn't set the 'OPT_XWIN' flag. In this case,
		// we assume the symbols are stored in a header file generated
		// by my Unix installer
		#include <XConfig_macdep.h>
	#endif

#endif // define(__MWERKS__)

/************************************************************************/
/*																		*/
/*	Verify symbols defined correctly									*/
/*																		*/
/************************************************************************/

#if !defined(OPT_MACOS) || !defined(OPT_WINOS) || !defined(OPT_XWIN)
	#error  Target platform not specified
#endif


/************************************************************************/
/*																		*/
/*	Define certain constants											*/
/*																		*/
/************************************************************************/

#if OPT_MACOS == 1
	#define	OPT_NATIVEORDER		1			// integer is native (net) order
#endif

#if OPT_WINOS == 1
	#define OPT_NATIVEORDER		0			// integer is _not_ native net order
#endif

#if OPT_MACOS || OPT_WINOS
	#define OPT_THREADED			1
#endif

/*
 *	See if this is set
 */

#if !defined(OPT_NATIVEORDER)
	#error OPT_NATIVEORDER has not been set properly
#endif

/************************************************************************/
/*																		*/
/*	And load various headers											*/
/*																		*/
/************************************************************************/

#if OPT_WINOS && !defined(__MWERKS__)
#include <Windows.h>						// The MS Windows headers

    #ifdef _WINDOWS
    #pragma warning (disable: 4244)			// disable for VC++
	#pragma warning (disable: 4800)
    #endif

#endif


#if OPT_XWIN && defined(__cplusplus) && (OPT_NATIVEORDER == 1)
	// Kludge to make this work with MkLinux's compiler under DR2.1r6.
	// You may wish to comment the following out with DR3
	#include <g++/std/typeinfo.h>			// 'cause I hate including this
#endif

#endif /* PandaWave_XCONFIG */
