00001 /*---------------------------------------------------------------------------- 00002 * Copyright (c) <2013-2015>, <Huawei Technologies Co., Ltd> 00003 * All rights reserved. 00004 * Redistribution and use in source and binary forms, with or without modification, 00005 * are permitted provided that the following conditions are met: 00006 * 1. Redistributions of source code must retain the above copyright notice, this list of 00007 * conditions and the following disclaimer. 00008 * 2. Redistributions in binary form must reproduce the above copyright notice, this list 00009 * of conditions and the following disclaimer in the documentation and/or other materials 00010 * provided with the distribution. 00011 * 3. Neither the name of the copyright holder nor the names of its contributors may be used 00012 * to endorse or promote products derived from this software without specific prior written 00013 * permission. 00014 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00015 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 00016 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 00017 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 00018 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 00019 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 00020 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 00021 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 00022 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 00023 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 00024 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00025 *---------------------------------------------------------------------------*/ 00026 /*---------------------------------------------------------------------------- 00027 * Notice of Export Control Law 00028 * =============================================== 00029 * Huawei LiteOS may be subject to applicable export control laws and regulations, which might 00030 * include those applicable to Huawei LiteOS of U.S. and the country in which you are located. 00031 * Import, export and usage of Huawei LiteOS in any manner by you shall be in compliance with such 00032 * applicable export control laws and regulations. 00033 *---------------------------------------------------------------------------*/ 00034 00035 #ifndef __LOS_COMPILER_H 00036 #define __LOS_COMPILER_H 00037 00038 #ifdef __cplusplus 00039 #if __cplusplus 00040 extern "C" { 00041 #endif /* __cplusplus */ 00042 #endif /* __cplusplus */ 00043 00044 00045 #ifdef __ICCARM__ 00046 00047 #ifndef ASM 00048 #define ASM __asm 00049 #endif 00050 00051 #ifndef INLINE 00052 #define INLINE inline 00053 #endif 00054 00055 #ifndef STATIC_INLINE 00056 #define STATIC_INLINE static inline 00057 #endif 00058 00059 #ifndef USED 00060 #define USED __root 00061 #endif 00062 00063 #ifndef WEAK 00064 #define WEAK __weak 00065 #endif 00066 00067 #ifndef CLZ 00068 #define CLZ __CLZ 00069 #endif 00070 00071 #elif defined (__CC_ARM) 00072 00073 #ifndef ASM 00074 #define ASM __asm 00075 #endif 00076 00077 #ifndef INLINE 00078 #define INLINE __inline 00079 #endif 00080 00081 #ifndef STATIC_INLINE 00082 #define STATIC_INLINE static __inline 00083 #endif 00084 00085 #ifndef USED 00086 #define USED __attribute__((used)) 00087 #endif 00088 00089 #ifndef WEAK 00090 #define WEAK __attribute__((weak)) 00091 #endif 00092 00093 #ifndef CLZ 00094 #define CLZ __clz 00095 #endif 00096 00097 #pragma anon_unions 00098 00099 #elif defined (__GNUC__) 00100 00101 #ifndef ASM 00102 #define ASM __asm 00103 #endif 00104 00105 #ifndef INLINE 00106 #define INLINE inline 00107 #endif 00108 00109 #ifndef STATIC_INLINE 00110 #define STATIC_INLINE static inline 00111 #endif 00112 00113 #ifndef USED 00114 #define USED __attribute__((used)) 00115 #endif 00116 00117 #ifndef WEAK 00118 #define WEAK __attribute__((weak)) 00119 #endif 00120 00121 #ifndef CLZ 00122 #define CLZ __builtin_clz 00123 #endif 00124 00125 #else 00126 #error Unknown compiler. 00127 #endif 00128 00129 00130 #ifdef __cplusplus 00131 #if __cplusplus 00132 } 00133 #endif /* __cplusplus */ 00134 #endif /* __cplusplus */ 00135 00136 #endif /* __LOS_COMPILER_H */