/*---------------------------------------------------------------------------* Project: NintendoWare File: compiler.h Copyright (C)2009-2010 Nintendo Co., Ltd./HAL Laboratory, Inc. 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. $Revision: 25242 $ *---------------------------------------------------------------------------*/ #ifndef NW_CONFIG_COMPILER_H_ #define NW_CONFIG_COMPILER_H_ #if defined( __CC_ARM ) || defined( __ARMCC_VERSION ) // ARM RealView Compiler. #define NW_COMPILER_RVCT #include #define NW_DEPRECATED_FUNCTION_MSG(MFunc, msg) MFunc __attribute__ ((deprecated)) #define NW_CHECKED_ARRAY_ITERATOR(MIte, MNum) MIte #define NW_CHAR_TRAITS_COPY(MType, MDest, MDestSize, MFrom, MCount) std::char_traits::copy(MDest, MFrom, MCount) #elif defined( __CWCC__ ) || defined( __MWERKS__ ) // Freescale CodeWarrior #define NW_COMPILER_CWCC #define NW_COMPILER_MWERKS // 互換性のため(非推奨) #include #define NW_DEPRECATED_FUNCTION_MSG(MFunc, msg) MFunc #define NW_CHECKED_ARRAY_ITERATOR(MIte, MNum) MIte #define NW_CHAR_TRAITS_COPY(MType, MDest, MDestSize, MFrom, MCount) std::char_traits::copy(MDest, MFrom, MCount) #elif defined( __GNUC__ ) // GNU C++ #define NW_COMPILER_GCC #include #define NW_DEPRECATED_FUNCTION_MSG(MFunc, msg) MFunc __attribute__ ((deprecated)) #define NW_CHECKED_ARRAY_ITERATOR(MIte, MNum) MIte #define NW_CHAR_TRAITS_COPY(MType, MDest, MDestSize, MFrom, MCount) std::char_traits::copy(MDest, MFrom, MCount) #elif defined( _MSC_VER ) // Miscrosoft Visual C++ #define NW_COMPILER_MSVC #include #define NW_DEPRECATED_FUNCTION_MSG(MFunc, msg) __declspec(deprecated(msg)) MFunc #define NW_CHECKED_ARRAY_ITERATOR(MIte, MNum) stdext::make_checked_array_iterator(MIte, MNum) #define NW_CHAR_TRAITS_COPY(MType, MDest, MDestSize, MFrom, MCount) std::char_traits::_Copy_s(MDest, MDestSize, MFrom, MCount) #else #error "Unknown compiler" #endif #if !defined(NW_DEPRECATED_FUNCTION) #if defined(NW_IGNORE_DEPRECATED) #define NW_DEPRECATED_FUNCTION(MFunc) MFunc #else #define NW_DEPRECATED_FUNCTION(MFunc) NW_DEPRECATED_FUNCTION_MSG(MFunc, "## Deprecated function ##") #endif #endif #ifndef NW_NO_THROW #define NW_NO_THROW #endif /* NW_CONFIG_COMPILER_H_ */ #endif