// =============================================================================
//	StdAfx.h
// =============================================================================
//	Copyright (c) WildPackets, Inc. 2000. All rights reserved.
//	Copyright (c) AG Group, Inc. 1997-2000. All rights reserved.

#ifndef STDAFX_H
#define STDAFX_H

// -----------------------------------------------------------------------------
//	Project Defines
// -----------------------------------------------------------------------------

#if defined(macintosh)
	// Targets are defined in ConditionalMacros.h.
	#include <ConditionalMacros.h>
#elif defined(_WIN32)
	// Targets for Win32 defined here.
	#define TARGET_OS_MAC	0
	#define TARGET_OS_WIN32	1
#endif

#define COUNTOF(array)			(sizeof(array)/sizeof(array[0]))

// -----------------------------------------------------------------------------
//		Project Pragmas
// -----------------------------------------------------------------------------

#if TARGET_OS_WIN32
#pragma warning(disable:4201)	// Warning: nameless struct/union (in many windows headers).
#if !defined(_DEBUG)
#pragma warning(disable:4100)	// Informational: Unused parameters.
#pragma warning(disable:4710)	// Warning: function not inlined.
#pragma warning(disable:4711)	// Informational: function selected for inlining.
#endif
#endif

// -----------------------------------------------------------------------------
//	Project Headers
// -----------------------------------------------------------------------------

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#if TARGET_OS_WIN32
	#include <windows.h>
	//#include <atlbase.h>
	#include <windowsx.h>
	#include <tchar.h>
	#include <malloc.h>
	#include <wtypes.h>
	#include <atlbase.h>
	#include <atlconv.h>
	#include <crtdbg.h>
	#include <atlstr.h>
	#define ASSERT _ASSERTE
#elif TARGET_OS_MAC
	#include "MacPrefix.h"
#endif
#include "AGTypes.h"

#define PRAGMA_MESSAGE_STR(x)	#x
#define PRAGMA_MESSAGE_STRX(x)	PRAGMA_MESSAGE_STR(x)
#define PRAGMA_MESSAGE(x)		message(__FILE__ "(" PRAGMA_MESSAGE_STRX(__LINE__) "):" #x)
#define TODO(x)					message(__FILE__ "(" PRAGMA_MESSAGE_STRX(__LINE__) "): >>>TBD>>> " #x)

// afx.h things that I like
#define TRACE	ATLTRACE
#ifdef _DEBUG
#define UNUSED(x)
#else
#define UNUSED(x) x
#endif
#define UNUSED_ALWAYS(x) x

#define VERIFY(f) ((void)(f))

// macro for getting just the protospec ID or instance ID for protospecsV2
#define GET_PSID(x)		( x & 0xffff )
#define GET_INSTANCE(x)	( ( x >> 16 ) & 0xffff )

#endif
