test

Committer:
elijahsj
Date:
Mon Nov 09 00:33:19 2020 -0500
Revision:
2:4364577b5ad8
Parent:
1:8a094db1347f
copied mbed library

Who changed what in which revision?

UserRevisionLine numberNew contents of line
elijahsj 1:8a094db1347f 1
elijahsj 1:8a094db1347f 2 /** \addtogroup platform */
elijahsj 1:8a094db1347f 3 /** @{*/
elijahsj 1:8a094db1347f 4 /* mbed Microcontroller Library
elijahsj 1:8a094db1347f 5 * Copyright (c) 2006-2013 ARM Limited
elijahsj 1:8a094db1347f 6 *
elijahsj 1:8a094db1347f 7 * Licensed under the Apache License, Version 2.0 (the "License");
elijahsj 1:8a094db1347f 8 * you may not use this file except in compliance with the License.
elijahsj 1:8a094db1347f 9 * You may obtain a copy of the License at
elijahsj 1:8a094db1347f 10 *
elijahsj 1:8a094db1347f 11 * http://www.apache.org/licenses/LICENSE-2.0
elijahsj 1:8a094db1347f 12 *
elijahsj 1:8a094db1347f 13 * Unless required by applicable law or agreed to in writing, software
elijahsj 1:8a094db1347f 14 * distributed under the License is distributed on an "AS IS" BASIS,
elijahsj 1:8a094db1347f 15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
elijahsj 1:8a094db1347f 16 * See the License for the specific language governing permissions and
elijahsj 1:8a094db1347f 17 * limitations under the License.
elijahsj 1:8a094db1347f 18 */
elijahsj 1:8a094db1347f 19 #ifndef MBED_TOOLCHAIN_H
elijahsj 1:8a094db1347f 20 #define MBED_TOOLCHAIN_H
elijahsj 1:8a094db1347f 21
elijahsj 1:8a094db1347f 22 #include "mbed_preprocessor.h"
elijahsj 1:8a094db1347f 23
elijahsj 1:8a094db1347f 24
elijahsj 1:8a094db1347f 25 // Warning for unsupported compilers
elijahsj 1:8a094db1347f 26 #if !defined(__GNUC__) /* GCC */ \
elijahsj 1:8a094db1347f 27 && !defined(__CC_ARM) /* ARMCC */ \
elijahsj 1:8a094db1347f 28 && !defined(__clang__) /* LLVM/Clang */ \
elijahsj 1:8a094db1347f 29 && !defined(__ICCARM__) /* IAR */
elijahsj 1:8a094db1347f 30 #warning "This compiler is not yet supported."
elijahsj 1:8a094db1347f 31 #endif
elijahsj 1:8a094db1347f 32
elijahsj 1:8a094db1347f 33
elijahsj 1:8a094db1347f 34 // Attributes
elijahsj 1:8a094db1347f 35
elijahsj 1:8a094db1347f 36 /** MBED_PACKED
elijahsj 1:8a094db1347f 37 * Pack a structure, preventing any padding from being added between fields.
elijahsj 1:8a094db1347f 38 *
elijahsj 1:8a094db1347f 39 * @code
elijahsj 1:8a094db1347f 40 * #include "mbed_toolchain.h"
elijahsj 1:8a094db1347f 41 *
elijahsj 1:8a094db1347f 42 * MBED_PACKED(struct) foo {
elijahsj 1:8a094db1347f 43 * char x;
elijahsj 1:8a094db1347f 44 * int y;
elijahsj 1:8a094db1347f 45 * };
elijahsj 1:8a094db1347f 46 * @endcode
elijahsj 1:8a094db1347f 47 */
elijahsj 1:8a094db1347f 48 #ifndef MBED_PACKED
elijahsj 1:8a094db1347f 49 #if defined(__ICCARM__)
elijahsj 1:8a094db1347f 50 #define MBED_PACKED(struct) __packed struct
elijahsj 1:8a094db1347f 51 #else
elijahsj 1:8a094db1347f 52 #define MBED_PACKED(struct) struct __attribute__((packed))
elijahsj 1:8a094db1347f 53 #endif
elijahsj 1:8a094db1347f 54 #endif
elijahsj 1:8a094db1347f 55
elijahsj 1:8a094db1347f 56 /** MBED_ALIGN(N)
elijahsj 1:8a094db1347f 57 * Declare a variable to be aligned on an N-byte boundary.
elijahsj 1:8a094db1347f 58 *
elijahsj 1:8a094db1347f 59 * @note
elijahsj 1:8a094db1347f 60 * IAR does not support alignment greater than word size on the stack
elijahsj 1:8a094db1347f 61 *
elijahsj 1:8a094db1347f 62 * @code
elijahsj 1:8a094db1347f 63 * #include "mbed_toolchain.h"
elijahsj 1:8a094db1347f 64 *
elijahsj 1:8a094db1347f 65 * MBED_ALIGN(16) char a;
elijahsj 1:8a094db1347f 66 * @endcode
elijahsj 1:8a094db1347f 67 */
elijahsj 1:8a094db1347f 68 #ifndef MBED_ALIGN
elijahsj 1:8a094db1347f 69 #if defined(__ICCARM__)
elijahsj 1:8a094db1347f 70 #define MBED_ALIGN(N) _Pragma(MBED_STRINGIFY(data_alignment=N))
elijahsj 1:8a094db1347f 71 #else
elijahsj 1:8a094db1347f 72 #define MBED_ALIGN(N) __attribute__((aligned(N)))
elijahsj 1:8a094db1347f 73 #endif
elijahsj 1:8a094db1347f 74 #endif
elijahsj 1:8a094db1347f 75
elijahsj 1:8a094db1347f 76 /** MBED_UNUSED
elijahsj 1:8a094db1347f 77 * Declare a function argument to be unused, suppressing compiler warnings
elijahsj 1:8a094db1347f 78 *
elijahsj 1:8a094db1347f 79 * @code
elijahsj 1:8a094db1347f 80 * #include "mbed_toolchain.h"
elijahsj 1:8a094db1347f 81 *
elijahsj 1:8a094db1347f 82 * void foo(MBED_UNUSED int arg) {
elijahsj 1:8a094db1347f 83 *
elijahsj 1:8a094db1347f 84 * }
elijahsj 1:8a094db1347f 85 * @endcode
elijahsj 1:8a094db1347f 86 */
elijahsj 1:8a094db1347f 87 #ifndef MBED_UNUSED
elijahsj 1:8a094db1347f 88 #if defined(__GNUC__) || defined(__clang__) || defined(__CC_ARM)
elijahsj 1:8a094db1347f 89 #define MBED_UNUSED __attribute__((__unused__))
elijahsj 1:8a094db1347f 90 #else
elijahsj 1:8a094db1347f 91 #define MBED_UNUSED
elijahsj 1:8a094db1347f 92 #endif
elijahsj 1:8a094db1347f 93 #endif
elijahsj 1:8a094db1347f 94
elijahsj 1:8a094db1347f 95 /** MBED_WEAK
elijahsj 1:8a094db1347f 96 * Mark a function as being weak.
elijahsj 1:8a094db1347f 97 *
elijahsj 1:8a094db1347f 98 * @note
elijahsj 1:8a094db1347f 99 * Functions should only be marked as weak in the source file. The header file
elijahsj 1:8a094db1347f 100 * should contain a regular function declaration to insure the function is emitted.
elijahsj 1:8a094db1347f 101 * A function marked weak will not be emitted if an alternative non-weak
elijahsj 1:8a094db1347f 102 * implementation is defined.
elijahsj 1:8a094db1347f 103 *
elijahsj 1:8a094db1347f 104 * @note
elijahsj 1:8a094db1347f 105 * Weak functions are not friendly to making code re-usable, as they can only
elijahsj 1:8a094db1347f 106 * be overridden once (and if they are multiply overridden the linker will emit
elijahsj 1:8a094db1347f 107 * no warning). You should not normally use weak symbols as part of the API to
elijahsj 1:8a094db1347f 108 * re-usable modules.
elijahsj 1:8a094db1347f 109 *
elijahsj 1:8a094db1347f 110 * @code
elijahsj 1:8a094db1347f 111 * #include "mbed_toolchain.h"
elijahsj 1:8a094db1347f 112 *
elijahsj 1:8a094db1347f 113 * MBED_WEAK void foo() {
elijahsj 1:8a094db1347f 114 * // a weak implementation of foo that can be overriden by a definition
elijahsj 1:8a094db1347f 115 * // without __weak
elijahsj 1:8a094db1347f 116 * }
elijahsj 1:8a094db1347f 117 * @endcode
elijahsj 1:8a094db1347f 118 */
elijahsj 1:8a094db1347f 119 #ifndef MBED_WEAK
elijahsj 1:8a094db1347f 120 #if defined(__ICCARM__)
elijahsj 1:8a094db1347f 121 #define MBED_WEAK __weak
elijahsj 1:8a094db1347f 122 #else
elijahsj 1:8a094db1347f 123 #define MBED_WEAK __attribute__((weak))
elijahsj 1:8a094db1347f 124 #endif
elijahsj 1:8a094db1347f 125 #endif
elijahsj 1:8a094db1347f 126
elijahsj 1:8a094db1347f 127 /** MBED_PURE
elijahsj 1:8a094db1347f 128 * Hint to the compiler that a function depends only on parameters
elijahsj 1:8a094db1347f 129 *
elijahsj 1:8a094db1347f 130 * @code
elijahsj 1:8a094db1347f 131 * #include "mbed_toolchain.h"
elijahsj 1:8a094db1347f 132 *
elijahsj 1:8a094db1347f 133 * MBED_PURE int foo(int arg){
elijahsj 1:8a094db1347f 134 * // no access to global variables
elijahsj 1:8a094db1347f 135 * }
elijahsj 1:8a094db1347f 136 * @endcode
elijahsj 1:8a094db1347f 137 */
elijahsj 1:8a094db1347f 138 #ifndef MBED_PURE
elijahsj 1:8a094db1347f 139 #if defined(__GNUC__) || defined(__clang__) || defined(__CC_ARM)
elijahsj 1:8a094db1347f 140 #define MBED_PURE __attribute__((const))
elijahsj 1:8a094db1347f 141 #else
elijahsj 1:8a094db1347f 142 #define MBED_PURE
elijahsj 1:8a094db1347f 143 #endif
elijahsj 1:8a094db1347f 144 #endif
elijahsj 1:8a094db1347f 145
elijahsj 1:8a094db1347f 146 /** MBED_NOINLINE
elijahsj 1:8a094db1347f 147 * Declare a function that must not be inlined.
elijahsj 1:8a094db1347f 148 *
elijahsj 1:8a094db1347f 149 * @code
elijahsj 1:8a094db1347f 150 * #include "mbed_toolchain.h"
elijahsj 1:8a094db1347f 151 *
elijahsj 1:8a094db1347f 152 * MBED_NOINLINE void foo() {
elijahsj 1:8a094db1347f 153 *
elijahsj 1:8a094db1347f 154 * }
elijahsj 1:8a094db1347f 155 * @endcode
elijahsj 1:8a094db1347f 156 */
elijahsj 1:8a094db1347f 157 #ifndef MBED_NOINLINE
elijahsj 1:8a094db1347f 158 #if defined(__GNUC__) || defined(__clang__) || defined(__CC_ARM)
elijahsj 1:8a094db1347f 159 #define MBED_NOINLINE __attribute__((noinline))
elijahsj 1:8a094db1347f 160 #elif defined(__ICCARM__)
elijahsj 1:8a094db1347f 161 #define MBED_NOINLINE _Pragma("inline=never")
elijahsj 1:8a094db1347f 162 #else
elijahsj 1:8a094db1347f 163 #define MBED_NOINLINE
elijahsj 1:8a094db1347f 164 #endif
elijahsj 1:8a094db1347f 165 #endif
elijahsj 1:8a094db1347f 166
elijahsj 1:8a094db1347f 167 /** MBED_FORCEINLINE
elijahsj 1:8a094db1347f 168 * Declare a function that must always be inlined. Failure to inline
elijahsj 1:8a094db1347f 169 * such a function will result in an error.
elijahsj 1:8a094db1347f 170 *
elijahsj 1:8a094db1347f 171 * @code
elijahsj 1:8a094db1347f 172 * #include "mbed_toolchain.h"
elijahsj 1:8a094db1347f 173 *
elijahsj 1:8a094db1347f 174 * MBED_FORCEINLINE void foo() {
elijahsj 1:8a094db1347f 175 *
elijahsj 1:8a094db1347f 176 * }
elijahsj 1:8a094db1347f 177 * @endcode
elijahsj 1:8a094db1347f 178 */
elijahsj 1:8a094db1347f 179 #ifndef MBED_FORCEINLINE
elijahsj 1:8a094db1347f 180 #if defined(__GNUC__) || defined(__clang__) || defined(__CC_ARM)
elijahsj 1:8a094db1347f 181 #define MBED_FORCEINLINE static inline __attribute__((always_inline))
elijahsj 1:8a094db1347f 182 #elif defined(__ICCARM__)
elijahsj 1:8a094db1347f 183 #define MBED_FORCEINLINE _Pragma("inline=forced") static
elijahsj 1:8a094db1347f 184 #else
elijahsj 1:8a094db1347f 185 #define MBED_FORCEINLINE static inline
elijahsj 1:8a094db1347f 186 #endif
elijahsj 1:8a094db1347f 187 #endif
elijahsj 1:8a094db1347f 188
elijahsj 1:8a094db1347f 189 /** MBED_NORETURN
elijahsj 1:8a094db1347f 190 * Declare a function that will never return.
elijahsj 1:8a094db1347f 191 *
elijahsj 1:8a094db1347f 192 * @code
elijahsj 1:8a094db1347f 193 * #include "mbed_toolchain.h"
elijahsj 1:8a094db1347f 194 *
elijahsj 1:8a094db1347f 195 * MBED_NORETURN void foo() {
elijahsj 1:8a094db1347f 196 * // must never return
elijahsj 1:8a094db1347f 197 * while (1) {}
elijahsj 1:8a094db1347f 198 * }
elijahsj 1:8a094db1347f 199 * @endcode
elijahsj 1:8a094db1347f 200 */
elijahsj 1:8a094db1347f 201 #ifndef MBED_NORETURN
elijahsj 1:8a094db1347f 202 #if defined(__GNUC__) || defined(__clang__) || defined(__CC_ARM)
elijahsj 1:8a094db1347f 203 #define MBED_NORETURN __attribute__((noreturn))
elijahsj 1:8a094db1347f 204 #elif defined(__ICCARM__)
elijahsj 1:8a094db1347f 205 #define MBED_NORETURN __noreturn
elijahsj 1:8a094db1347f 206 #else
elijahsj 1:8a094db1347f 207 #define MBED_NORETURN
elijahsj 1:8a094db1347f 208 #endif
elijahsj 1:8a094db1347f 209 #endif
elijahsj 1:8a094db1347f 210
elijahsj 1:8a094db1347f 211 /** MBED_UNREACHABLE
elijahsj 1:8a094db1347f 212 * An unreachable statement. If the statement is reached,
elijahsj 1:8a094db1347f 213 * behaviour is undefined. Useful in situations where the compiler
elijahsj 1:8a094db1347f 214 * cannot deduce the unreachability of code.
elijahsj 1:8a094db1347f 215 *
elijahsj 1:8a094db1347f 216 * @code
elijahsj 1:8a094db1347f 217 * #include "mbed_toolchain.h"
elijahsj 1:8a094db1347f 218 *
elijahsj 1:8a094db1347f 219 * void foo(int arg) {
elijahsj 1:8a094db1347f 220 * switch (arg) {
elijahsj 1:8a094db1347f 221 * case 1: return 1;
elijahsj 1:8a094db1347f 222 * case 2: return 2;
elijahsj 1:8a094db1347f 223 * ...
elijahsj 1:8a094db1347f 224 * }
elijahsj 1:8a094db1347f 225 * MBED_UNREACHABLE;
elijahsj 1:8a094db1347f 226 * }
elijahsj 1:8a094db1347f 227 * @endcode
elijahsj 1:8a094db1347f 228 */
elijahsj 1:8a094db1347f 229 #ifndef MBED_UNREACHABLE
elijahsj 1:8a094db1347f 230 #if (defined(__GNUC__) || defined(__clang__)) && !defined(__CC_ARM)
elijahsj 1:8a094db1347f 231 #define MBED_UNREACHABLE __builtin_unreachable()
elijahsj 1:8a094db1347f 232 #else
elijahsj 1:8a094db1347f 233 #define MBED_UNREACHABLE while (1)
elijahsj 1:8a094db1347f 234 #endif
elijahsj 1:8a094db1347f 235 #endif
elijahsj 1:8a094db1347f 236
elijahsj 1:8a094db1347f 237 /** MBED_DEPRECATED("message string")
elijahsj 1:8a094db1347f 238 * Mark a function declaration as deprecated, if it used then a warning will be
elijahsj 1:8a094db1347f 239 * issued by the compiler possibly including the provided message. Note that not
elijahsj 1:8a094db1347f 240 * all compilers are able to display the message.
elijahsj 1:8a094db1347f 241 *
elijahsj 1:8a094db1347f 242 * @code
elijahsj 1:8a094db1347f 243 * #include "mbed_toolchain.h"
elijahsj 1:8a094db1347f 244 *
elijahsj 1:8a094db1347f 245 * MBED_DEPRECATED("don't foo any more, bar instead")
elijahsj 1:8a094db1347f 246 * void foo(int arg);
elijahsj 1:8a094db1347f 247 * @endcode
elijahsj 1:8a094db1347f 248 */
elijahsj 1:8a094db1347f 249 #ifndef MBED_DEPRECATED
elijahsj 1:8a094db1347f 250 #if defined(__CC_ARM)
elijahsj 1:8a094db1347f 251 #define MBED_DEPRECATED(M) __attribute__((deprecated))
elijahsj 1:8a094db1347f 252 #elif defined(__GNUC__) || defined(__clang__)
elijahsj 1:8a094db1347f 253 #define MBED_DEPRECATED(M) __attribute__((deprecated(M)))
elijahsj 1:8a094db1347f 254 #else
elijahsj 1:8a094db1347f 255 #define MBED_DEPRECATED(M)
elijahsj 1:8a094db1347f 256 #endif
elijahsj 1:8a094db1347f 257 #endif
elijahsj 1:8a094db1347f 258
elijahsj 1:8a094db1347f 259 /** MBED_DEPRECATED_SINCE("version", "message string")
elijahsj 1:8a094db1347f 260 * Mark a function declaration as deprecated, noting that the declaration was
elijahsj 1:8a094db1347f 261 * deprecated on the specified version. If the function is used then a warning
elijahsj 1:8a094db1347f 262 * will be issued by the compiler possibly including the provided message.
elijahsj 1:8a094db1347f 263 * Note that not all compilers are able to display this message.
elijahsj 1:8a094db1347f 264 *
elijahsj 1:8a094db1347f 265 * @code
elijahsj 1:8a094db1347f 266 * #include "mbed_toolchain.h"
elijahsj 1:8a094db1347f 267 *
elijahsj 1:8a094db1347f 268 * MBED_DEPRECATED_SINCE("mbed-os-5.1", "don't foo any more, bar instead")
elijahsj 1:8a094db1347f 269 * void foo(int arg);
elijahsj 1:8a094db1347f 270 * @endcode
elijahsj 1:8a094db1347f 271 */
elijahsj 1:8a094db1347f 272 #define MBED_DEPRECATED_SINCE(D, M) MBED_DEPRECATED(M " [since " D "]")
elijahsj 1:8a094db1347f 273
elijahsj 1:8a094db1347f 274 /** MBED_CALLER_ADDR()
elijahsj 1:8a094db1347f 275 * Returns the caller of the current function.
elijahsj 1:8a094db1347f 276 *
elijahsj 1:8a094db1347f 277 * @note
elijahsj 1:8a094db1347f 278 * This macro is only implemented for GCC and ARMCC.
elijahsj 1:8a094db1347f 279 *
elijahsj 1:8a094db1347f 280 * @code
elijahsj 1:8a094db1347f 281 * #include "mbed_toolchain.h"
elijahsj 1:8a094db1347f 282 *
elijahsj 1:8a094db1347f 283 * printf("This function was called from %p", MBED_CALLER_ADDR());
elijahsj 1:8a094db1347f 284 * @endcode
elijahsj 1:8a094db1347f 285 *
elijahsj 1:8a094db1347f 286 * @return Address of the calling function
elijahsj 1:8a094db1347f 287 */
elijahsj 1:8a094db1347f 288 #ifndef MBED_CALLER_ADDR
elijahsj 1:8a094db1347f 289 #if (defined(__GNUC__) || defined(__clang__)) && !defined(__CC_ARM)
elijahsj 1:8a094db1347f 290 #define MBED_CALLER_ADDR() __builtin_extract_return_addr(__builtin_return_address(0))
elijahsj 1:8a094db1347f 291 #elif defined(__CC_ARM)
elijahsj 1:8a094db1347f 292 #define MBED_CALLER_ADDR() __builtin_return_address(0)
elijahsj 1:8a094db1347f 293 #else
elijahsj 1:8a094db1347f 294 #define MBED_CALLER_ADDR() (NULL)
elijahsj 1:8a094db1347f 295 #endif
elijahsj 1:8a094db1347f 296 #endif
elijahsj 1:8a094db1347f 297
elijahsj 1:8a094db1347f 298 #ifndef MBED_SECTION
elijahsj 1:8a094db1347f 299 #if (defined(__GNUC__) || defined(__clang__)) || defined(__CC_ARM)
elijahsj 1:8a094db1347f 300 #define MBED_SECTION(name) __attribute__ ((section (name)))
elijahsj 1:8a094db1347f 301 #elif defined(__ICCARM__)
elijahsj 1:8a094db1347f 302 #define MBED_SECTION(name) _Pragma(MBED_STRINGIFY(location=name))
elijahsj 1:8a094db1347f 303 #else
elijahsj 1:8a094db1347f 304 #error "Missing MBED_SECTION directive"
elijahsj 1:8a094db1347f 305 #endif
elijahsj 1:8a094db1347f 306 #endif
elijahsj 1:8a094db1347f 307
elijahsj 1:8a094db1347f 308 #ifndef MBED_PRINTF
elijahsj 1:8a094db1347f 309 #if defined(__GNUC__) || defined(__CC_ARM)
elijahsj 1:8a094db1347f 310 #define MBED_PRINTF(format_idx, first_param_idx) __attribute__ ((__format__(__printf__, format_idx, first_param_idx)))
elijahsj 1:8a094db1347f 311 #else
elijahsj 1:8a094db1347f 312 #define MBED_PRINTF(format_idx, first_param_idx)
elijahsj 1:8a094db1347f 313 #endif
elijahsj 1:8a094db1347f 314 #endif
elijahsj 1:8a094db1347f 315
elijahsj 1:8a094db1347f 316 #ifndef MBED_PRINTF_METHOD
elijahsj 1:8a094db1347f 317 #if defined(__GNUC__) || defined(__CC_ARM)
elijahsj 1:8a094db1347f 318 #define MBED_PRINTF_METHOD(format_idx, first_param_idx) __attribute__ ((__format__(__printf__, format_idx+1, first_param_idx+1)))
elijahsj 1:8a094db1347f 319 #else
elijahsj 1:8a094db1347f 320 #define MBED_PRINTF_METHOD(format_idx, first_param_idx)
elijahsj 1:8a094db1347f 321 #endif
elijahsj 1:8a094db1347f 322 #endif
elijahsj 1:8a094db1347f 323
elijahsj 1:8a094db1347f 324 #ifndef MBED_SCANF
elijahsj 1:8a094db1347f 325 #if defined(__GNUC__) || defined(__CC_ARM)
elijahsj 1:8a094db1347f 326 #define MBED_SCANF(format_idx, first_param_idx) __attribute__ ((__format__(__scanf__, format_idx, first_param_idx)))
elijahsj 1:8a094db1347f 327 #else
elijahsj 1:8a094db1347f 328 #define MBED_SCANF(format_idx, first_param_idx)
elijahsj 1:8a094db1347f 329 #endif
elijahsj 1:8a094db1347f 330 #endif
elijahsj 1:8a094db1347f 331
elijahsj 1:8a094db1347f 332 #ifndef MBED_SCANF_METHOD
elijahsj 1:8a094db1347f 333 #if defined(__GNUC__) || defined(__CC_ARM)
elijahsj 1:8a094db1347f 334 #define MBED_SCANF_METHOD(format_idx, first_param_idx) __attribute__ ((__format__(__scanf__, format_idx+1, first_param_idx+1)))
elijahsj 1:8a094db1347f 335 #else
elijahsj 1:8a094db1347f 336 #define MBED_SCANF_METHOD(format_idx, first_param_idx)
elijahsj 1:8a094db1347f 337 #endif
elijahsj 1:8a094db1347f 338 #endif
elijahsj 1:8a094db1347f 339
elijahsj 1:8a094db1347f 340 // FILEHANDLE declaration
elijahsj 1:8a094db1347f 341 #if defined(TOOLCHAIN_ARM)
elijahsj 1:8a094db1347f 342 #include <rt_sys.h>
elijahsj 1:8a094db1347f 343 #endif
elijahsj 1:8a094db1347f 344
elijahsj 1:8a094db1347f 345 #ifndef FILEHANDLE
elijahsj 1:8a094db1347f 346 typedef int FILEHANDLE;
elijahsj 1:8a094db1347f 347 #endif
elijahsj 1:8a094db1347f 348
elijahsj 1:8a094db1347f 349 // Backwards compatibility
elijahsj 1:8a094db1347f 350 #ifndef WEAK
elijahsj 1:8a094db1347f 351 #define WEAK MBED_WEAK
elijahsj 1:8a094db1347f 352 #endif
elijahsj 1:8a094db1347f 353
elijahsj 1:8a094db1347f 354 #ifndef PACKED
elijahsj 1:8a094db1347f 355 #define PACKED MBED_PACKED()
elijahsj 1:8a094db1347f 356 #endif
elijahsj 1:8a094db1347f 357
elijahsj 1:8a094db1347f 358 #ifndef EXTERN
elijahsj 1:8a094db1347f 359 #define EXTERN extern
elijahsj 1:8a094db1347f 360 #endif
elijahsj 1:8a094db1347f 361
elijahsj 1:8a094db1347f 362 #endif
elijahsj 1:8a094db1347f 363
elijahsj 1:8a094db1347f 364 /** @}*/