//
// Compiler.h
//
// Created by KJFL - Wednesday, February 04, 2004
//
// Copyright (C) 2004 Rebellion, All Rights Reserved.
//
// PSP specific compiler settings

#ifdef ASURA_USE_PRAGMA_ONCE
#pragma once
#endif

#ifndef __COMPILER_H__
#define __COMPILER_H__


// (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)

// disable warnings in SNC
//#pragma diag_suppress=148 // declaration is incompatible with entity-kind "entity" (declared at line xxxx)
#pragma diag_suppress=1302	// switch statement is missing case labels
#pragma diag_suppress=1303	// switch statement is missing case labels (supposed to be "case and default labels" but seems to fire even with a default) 
#pragma diag_suppress=817	// type qualifier on return type is meaningless
#pragma diag_suppress=192	// type qualifier is meaningless on cast type
#pragma diag_suppress=112	// statement is unreachable
#pragma diag_suppress=813	// const variable requires an initializer -- class has no explicitly declared default constructor
#pragma diag_suppress=178	// variable was declared but never referenced
#pragma diag_suppress=68	// integer conversion resulted in a change of sign
#pragma diag_suppress=496	// declaring a void parameter list with a typedef is nonstandard (it's in Sony's code)

#ifndef ASURA_ASSERT
#pragma diag_suppress=552	// variable was set but never used. Often happens when asserts are disabled.
#endif //#ifndef ASURA_ASSERT

#if defined __SNC__
/*
	Hoping that the check for 'ASM_USE_SN_SYNTAX' is before
	that for 'USE_VFPU_ASSEMBLER' in the code.
*/
#define ASURA_PSP_ASM_USE_SN_SYNTAX				1
#define ASURA_PSP_USE_VFPU_ASSEMBLER			1
#endif

#if defined __GNUC__ && !defined __SNC__
#define ASURA_PSP_USE_VFPU_ASSEMBLER			1
#define ASURA_PSP_USE_VFPU_ASSEMBLER_FOR_M3xV3	1
#define ASURA_PSP_GCC_BUILTINS					1
#endif

#if defined __GNUC__
#define ASURA_PSP_ASM_NRBEGIN "\t.set push\t# Inline asm begin\n" \
                              "\t.set noreorder\n"
#define ASURA_PSP_ASM_NREND   "\t.set pop\t# Inline asm end\n"
#endif

#if !defined ASURA_PSP_ASM_NRBEGIN
#define ASURA_PSP_ASM_NRBEGIN "\t\t# Inline asm begin\n"
#define ASURA_PSP_ASM_NREND   "\t\t# Inline asm end\n"
#endif

#endif//__COMPILER_H__
