ctr_firmware/trunk/bootrom/include/brom/c_extension.h
nakasima f8c5b37b14 SVNファイル属性設定。
git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-09-30%20-%20paladin.7z/paladin/ctr_firmware@53 b871894f-2f95-9b40-918c-086798483c85
2008-12-01 10:32:04 +00:00

144 lines
3.7 KiB
C

/*---------------------------------------------------------------------------*
Project: CtrBrom - - types definition
File: c_extension.h
Copyright 2008 Nintendo. All rights reserved.
These coded instructions, statements, and computer programs contain
proprietary information of Nintendo of America Inc. and/or Nintendo
Company Ltd., and are protected by Federal copyright law. They may
not be disclosed to third parties or copied or duplicated in any form,
in whole or in part, without the prior written consent of Nintendo.
$Date:: $
$Rev$
$Author$
*---------------------------------------------------------------------------*/
#ifndef BROM_C_EXTENSION_H_
#define BROM_C_EXTENSION_H_
#ifdef __cplusplus
extern "C" {
#endif
// INLINE
#if defined( __CC_ARM )
#define inline __inline
#define INLINE __inline
#elif defined( __MWERKS__ )
#define INLINE inline
#elif defined( __GNUC__ )
#define INLINE inline
#endif // __GNUC__
// ASM
#if defined( __CC_ARM )
#define ASM __asm
#define asm __asm
#elif defined( __MWERKS__ )
#define ASM asm
#elif defined( __GNUC__ )
#define ASM asm
#endif // __GNUC__
// INASM_ALIGN
#if defined( __CC_ARM )
#define INASM_ALIGN(align) ALIGN align
#elif defined( __MWERKS__ )
#elif defined( __GNUC__ )
#endif // __GNUC__
// INASM_SECTION
#if defined( __CC_ARM )
#define INASM_SECTION(secname, attr0, attr1) AREA secname,attr0,attr1
#elif defined( __MWERKS__ )
#elif defined( __GNUC__ )
#endif // __GNUC__
// INASM_EXTERN
#if defined( __CC_ARM )
#define INASM_EXTERN(sym) EXTERN sym
#elif defined( __MWERKS__ )
#define INASM_EXTERN(sym)
#elif defined( __GNUC__ )
#define INASM_EXTERN(sym) .extern sym
#endif // __GNUC__
// INASM_SPACE
#if defined( __CC_ARM )
#define INASM_SPACE(size) SPACE (size)
#elif defined( __MWERKS__ )
#define INASM_SPACE(size) .space (size)
#elif defined( __GNUC__ )
#define INASM_SPACE(size) .space (size)
#endif // __GNUC__
// LSYM
#if defined( __CC_ARM )
#define LSYM( no ) no
#define BSYM( no ) %b##no
#define FSYM( no ) %f##no
#elif defined( __MWERKS__ )
#define LSYM( no ) @##no
#define BSYM( no ) @##no
#define FSYM( no ) @##no
#elif defined( __GNUC__ )
#define LSYM( no ) no // add ':' later
#define BSYM( no ) no##b
#define FSYM( no ) no##f
#endif // __GNUC__
// SDK_OP_ADR
#if defined( __CC_ARM )
#define SDK_OP_ADR adr
#elif defined( __MWERKS__ )
#define SDK_OP_ADR lda
#elif defined( __GNUC__ )
#define SDK_OP_ADR adr
#endif // __GNUC__
// ATTRIBUTE_ALIGN
#if defined( __CC_ARM )
#define ATTRIBUTE_ALIGN(n) __attribute__ ((aligned(n)))
#elif defined(__MWERKS__)
#define ATTRIBUTE_ALIGN(n) __attribute__ ((aligned(n)))
#elif defined( __GNUC__ )
#define ATTRIBUTE_ALIGN(n) __attribute__ ((aligned(n)))
#endif
// ATTRIBUTE_SECTION
#if defined( __CC_ARM )
#define ATTRIBUTE_SECTION(s) __attribute__ ((section(#s)))
#elif defined(__MWERKS__)
#define ATTRIBUTE_SECTION(s) __attribute__ ((section(#s)))
#elif defined( __GNUC__ )
#define ATTRIBUTE_SECTION(s) __attribute__ ((section(#s)))
#endif
// ATTRIBUTE_WEAK
#if defined( __CC_ARM )
#define ATTRIBUTE_WEAK(n) __attribute__ ((weak))
#elif defined(__MWERKS__)
#define ATTRIBUTE_WEAK(n) __attribute__ ((weak))
#elif defined( __GNUC__ )
#define ATTRIBUTE_WEAK(n) __attribute__ ((weak))
#endif
// SDK_WEAK_SYMBOL
#if defined( __CC_ARM )
#define SDK_WEAK_SYMBOL __weak
#elif defined(__MWERKS__)
#define SDK_WEAK_SYMBOL __declspec(weak)
#elif defined( __GNUC__ )
#define SDK_WEAK_SYMBOL __attribute__ ((weak))
#endif
#ifdef __cplusplus
} // extern "C"
#endif
#endif // BROM_C_EXTENSION_H_