rename error.c to mbed_error.c. add toolchain.h to mbed.h exposing to all. add extern filler to toolchain.h

sg- 2016-04-07 10:22:59 -05:00
parent 1fab13ea09
commit 47ee2ed90f
3 changed files with 5 additions and 33 deletions

View File

@ -18,6 +18,7 @@
#define MBED_LIBRARY_VERSION 117
#include "toolchain.h"
#include "platform.h"
// Useful C libraries

View File

@ -24,6 +24,10 @@
typedef int FILEHANDLE;
#endif
#ifndef EXTERN
#define EXTERN extern
#endif
#if defined (__ICCARM__)
# define WEAK __weak
# define PACKED __packed

View File

@ -1,33 +0,0 @@
/* mbed Microcontroller Library
* Copyright (c) 2006-2013 ARM Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <stdlib.h>
#include <stdarg.h>
#include "device.h"
#include "toolchain.h"
#include "mbed_error.h"
#if DEVICE_STDIO_MESSAGES
#include <stdio.h>
#endif
WEAK void error(const char* format, ...) {
#if DEVICE_STDIO_MESSAGES
va_list arg;
va_start(arg, format);
vfprintf(stderr, format, arg);
va_end(arg);
#endif
exit(1);
}