//
// Compiler.h
//
// Created by Kevin Lea - 05/10/2001 15:30:52
// 
// Copyright (C) 2001 Rebellion, All Rights Reserved.
//

#ifdef ASURA_USE_PRAGMA_ONCE
    #pragma once
#endif

#ifndef __COMPILER_H__
#define __COMPILER_H__

// (MP - 01.10.2002) Don't bother with this when Linting. We specify the +ffb
// option to use the correct (modern) scoping anyway and this macro gives
// Lint problems when deducing things about the loop.
// JAT 02/01/07 - don't scope for like this because max header files won't compile otherwise
#if !defined( _lint ) && !defined( ASURAIMPORT_EXPORTS )
#define for if( false ) { } else for
#endif

// (MP - 12.04.2002) For use with debugging variables that are only used in
// a single file; the compiler should be able to optimise them out in release
// builds.
#ifdef NDEBUG
    #define DEBUGVAR static const
#else
    #define DEBUGVAR static
#endif

#ifdef ASURA_DEBUG_VARIABLE_SYSTEM
#define DVSVAR static
#else
#define DVSVAR static const
#endif

#define ASURA_USE_PLATFORM_VECTORS (1)	

#define ASURA_CODE_SECTION(name)

// TP - 21/07/08 - Added these typedefs
typedef unsigned __int64 uint64;
typedef __int64 int64;

#ifdef _MSC_VER

/* nonstandard extension 'single line comment' was used */
#pragma warning(disable: 4001 )

//formal parameter 'number' has different type when promoted
//#pragma warning(disable: 4032 )

// 'type' differs in indirection to slightly different base 
// types from 'other type'
#pragma warning(disable: 4057)

// unreferenced formal parameter
#pragma warning(disable: 4100)

// named type definition in parentheses
#pragma warning(disable: 4115)

// conditional expression is constant : used to differentiate between internal and external versions
#pragma warning(disable: 4127)

// nonstandard extension used : nameless struct/union
#pragma warning(disable: 4201)

// nonstandard extension used : bit field types other than int
#pragma warning(disable: 4214)

// nonstandard extension used : benign typedef redefinition
#pragma warning(disable: 4209)

// copy constructor could not be generated.
#pragma warning(disable: 4511)

// assignment operator could not be generated, disable as often the operator isn't used.
#pragma warning(disable: 4512) 

// unreferenced inline function has been removed
#pragma warning(disable: 4514)

// C++ language change.
#pragma warning(disable: 4663)

// Note: Creating precompiled header 
#pragma warning(disable: 4699)

// warning C4701: local variable may be used without having been initialized
#pragma warning(disable: 4701)

// unreachable code?
//#pragma warning(disable: 4702)

// comma operator in array index, disabled due to assertions in array indicies
#pragma warning(disable: 4709)

// 'function' not expanded.
#pragma warning(disable: 4710)

// 'function' selected for automatic inline expansion - when a function not declared inline was inlined: well done compiler, aren't you clever!
#pragma warning(disable: 4711) 

// trunction to 255 chars.
#pragma warning(disable: 4786)

// function wasn't inlined warning
#pragma warning(disable: 4714)

// typedef-name 'PARENT_ASURA' used as synonym for class-name 'A2::A1'
#pragma warning(disable: 4097)

// class1 : inherits class2::methodname via dominance
#pragma warning(disable: 4250)

// switch statement contains 'default' but no 'case'
#pragma warning(disable: 4065)

// C++ exception handler used, but unwind semantics are not enabled.
#pragma warning(disable: 4530)

// JAT - 07 December 2005 09:59:05 - 
// compiler limit : terminating debug information emission
#pragma warning(disable: 4292)

#if (_MSC_VER >= 1400)
// ART - 03/10/06 - Needed for VS .NET 2005 to prevent compilation errors and
// warnings related to ISO C++ compliance and Microsoft's "secure" implmentations
// of standard library functions...
#define _CRT_NONSTDC_NO_DEPRECATE
#define _CRT_SECURE_NO_DEPRECATE
#define _SCL_SECURE_NO_DEPRECATE

// ART - 15/12/06 - Removed annoying warning which appears in ASURA_CHUNK_VERIFY macro when passing
// in 'short' types. Appears to be recognising that we're attempting to access them as an 'int'
// even though they should be compiled out due to all sizes being constants.
// reference to variable exceeds its storage space
#pragma warning(disable: 4739)

// JAT 01/03/07 - disabled this warning because of it not liking the asm in Asura_Platform_Callstack.cpp
// warning C4740: flow in or out of inline asm code suppresses global optimization
#pragma warning(disable: 4740)

#endif	// (_MSC_VER >= 1400)

#endif//#ifdef _MSC_VER

#endif//__COMPILER_H__