/*****************************************************************************/ /* _ti_config.h */ /* */ /* Copyright (c) 2017 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ #ifndef __TI_CONFIG_H #define __TI_CONFIG_H /*Unsupported pragmas are omitted */ #ifdef __TI_COMPILER_VERSION__ # pragma diag_push # pragma CHECK_MISRA("-19.7") # pragma CHECK_MISRA("-19.4") # pragma CHECK_MISRA("-19.1") # pragma CHECK_MISRA("-19.15") # define _TI_PROPRIETARY_PRAGMA(arg) _Pragma(arg) # pragma diag_pop #else # define _TI_PROPRIETARY_PRAGMA(arg) #endif _TI_PROPRIETARY_PRAGMA("diag_push") _TI_PROPRIETARY_PRAGMA("CHECK_MISRA(\"-19.4\")") _TI_PROPRIETARY_PRAGMA("CHECK_MISRA(\"-19.1\")") _TI_PROPRIETARY_PRAGMA("CHECK_MISRA(\"-19.6\")") /* Hide uses of the TI proprietary macros behind other macros. Implementations that don't implement these features should leave these macros undefined. */ #ifdef __TI_COMPILER_VERSION__ # ifdef __TI_STRICT_ANSI_MODE__ # define __TI_PROPRIETARY_STRICT_ANSI_MACRO __TI_STRICT_ANSI_MODE__ # else # undef __TI_PROPRIETARY_STRICT_ANSI_MACRO # endif # ifdef __TI_STRICT_FP_MODE__ # define __TI_PROPRIETARY_STRICT_FP_MACRO __TI_STRICT_FP_MODE__ # else # undef __TI_PROPRIETARY_STRICT_FP_MACRO # endif # ifdef __unsigned_chars__ # define __TI_PROPRIETARY_UNSIGNED_CHARS__ __unsigned_chars__ # else # undef __TI_PROPRIETARY_UNSIGNED_CHARS__ # endif #else # undef __TI_PROPRIETARY_UNSIGNED_CHARS__ # undef __TI_PROPRIETARY_STRICT_ANSI_MACRO # undef __TI_PROPRIETARY_STRICT_FP_MACRO #endif /* Common definitions */ #if defined(__cplusplus) /* C++ */ # if (__cplusplus >= 201103L) /* C++11 */ # define _TI_NORETURN [[noreturn]] # define _TI_NOEXCEPT noexcept # else /* C++98/03 */ # define _TI_NORETURN __attribute__((noreturn)) # define _TI_NOEXCEPT throw() # endif #else /* C */ # if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) /* C11 */ # define _TI_NORETURN _Noreturn # else /* C89/C99 */ # define _TI_NORETURN __attribute__((noreturn)) # endif # define _TI_NOEXCEPT #endif #if defined(__cplusplus) && (__cplusplus >= 201103L) # define _TI_CPP11LIB 1 #endif #if defined(__cplusplus) && (__cplusplus >= 201402L) # define _TI_CPP14LIB 1 #endif #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) || \ defined(_TI_CPP11LIB) # define _TI_C99LIB 1 #endif #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) || \ defined(_TI_CPP14LIB) # define _TI_C11LIB 1 #endif /* _TI_NOEXCEPT_CPP14 is defined to noexcept only when compiling for C++14. It is intended to be used for functions like abort and atexit that are supposed to be declared noexcept only in C++14 mode. */ #ifdef _TI_CPP14LIB # define _TI_NOEXCEPT_CPP14 noexcept #else # define _TI_NOEXCEPT_CPP14 #endif /* Target-specific definitions */ #include _TI_PROPRIETARY_PRAGMA("diag_pop") #endif /* ifndef __TI_CONFIG_H */