File tree Expand file tree Collapse file tree 9 files changed +49
-7
lines changed Expand file tree Collapse file tree 9 files changed +49
-7
lines changed Original file line number Diff line number Diff line change 53
53
* #endcode
54
54
*/
55
55
56
- #include <stdlib.h>
57
- #include "device.h"
56
+ #include "toolchain.h"
58
57
59
- #if DEVICE_STDIO_MESSAGES
60
- #include <stdio.h>
61
- #define error (...) (fprintf(stderr, __VA_ARGS__), exit(1))
62
- #else
63
- #define error (...) (exit(1))
58
+ #ifdef __cplusplus
59
+ extern "C" {
60
+ #endif
61
+
62
+ void error (const char * format , ...);
63
+
64
+ #ifdef __cplusplus
65
+ }
64
66
#endif
65
67
66
68
#endif
Original file line number Diff line number Diff line change
1
+ /* mbed Microcontroller Library
2
+ * Copyright (c) 2006-2013 ARM Limited
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ #include <stdlib.h>
17
+ #include <stdarg.h>
18
+ #include "device.h"
19
+ #include "toolchain.h"
20
+ #if DEVICE_STDIO_MESSAGES
21
+ #include <stdio.h>
22
+ #endif
23
+
24
+ WEAK void error (const char * format , ...);
25
+ WEAK void error (const char * format , ...) {
26
+ #if DEVICE_STDIO_MESSAGES
27
+ va_list arg ;
28
+ va_start (arg , format );
29
+ vfprintf (stderr , format , arg );
30
+ va_end (arg );
31
+ #endif
32
+ exit (1 );
33
+ }
Original file line number Diff line number Diff line change 16
16
// math.h required for floating point operations for baud rate calculation
17
17
#include <math.h>
18
18
#include <string.h>
19
+ #include <stdlib.h>
19
20
20
21
#include "serial_api.h"
21
22
#include "cmsis.h"
Original file line number Diff line number Diff line change 16
16
// math.h required for floating point operations for baud rate calculation
17
17
#include <math.h>
18
18
#include <string.h>
19
+ #include <stdlib.h>
19
20
20
21
#include "serial_api.h"
21
22
#include "cmsis.h"
Original file line number Diff line number Diff line change 16
16
// math.h required for floating point operations for baud rate calculation
17
17
#include <math.h>
18
18
#include <string.h>
19
+ #include <stdlib.h>
19
20
20
21
#include "serial_api.h"
21
22
#include "cmsis.h"
Original file line number Diff line number Diff line change 16
16
// math.h required for floating point operations for baud rate calculation
17
17
#include <math.h>
18
18
#include <string.h>
19
+ #include <stdlib.h>
19
20
20
21
#include "serial_api.h"
21
22
#include "cmsis.h"
Original file line number Diff line number Diff line change 16
16
// math.h required for floating point operations for baud rate calculation
17
17
#include <math.h>
18
18
#include <string.h>
19
+ #include <stdlib.h>
19
20
20
21
#include "serial_api.h"
21
22
#include "cmsis.h"
Original file line number Diff line number Diff line change 16
16
// math.h required for floating point operations for baud rate calculation
17
17
#include <math.h>
18
18
#include <string.h>
19
+ #include <stdlib.h>
19
20
20
21
#include "serial_api.h"
21
22
#include "cmsis.h"
Original file line number Diff line number Diff line change 18
18
// math.h required for floating point operations for baud rate calculation
19
19
#include <math.h>
20
20
#include <string.h>
21
+ #include <stdlib.h>
21
22
22
23
#include "serial_api.h"
23
24
#include "cmsis.h"
You can’t perform that action at this time.
0 commit comments