From df5a993197ac286305df259d79ac0b4c8d42f3b0 Mon Sep 17 00:00:00 2001 From: Bogdan Marinescu Date: Mon, 29 Jul 2013 18:54:22 +0300 Subject: [PATCH] __cxa_pure_virtual changes - rename stdio.cpp to retarget.cpp, since it doesn't contain only stdio-related code - move __cxa_pure_virtual from exit.c to retarget.cpp where it belongs. --- libraries/mbed/common/exit.c | 7 ------- libraries/mbed/common/{stdio.cpp => retarget.cpp} | 6 ++++++ 2 files changed, 6 insertions(+), 7 deletions(-) rename libraries/mbed/common/{stdio.cpp => retarget.cpp} (98%) diff --git a/libraries/mbed/common/exit.c b/libraries/mbed/common/exit.c index 1785b386e6..f1f4bc2ca1 100644 --- a/libraries/mbed/common/exit.c +++ b/libraries/mbed/common/exit.c @@ -15,7 +15,6 @@ */ #include "semihost_api.h" #include "mbed_interface.h" -#include "toolchain.h" #ifdef TOOLCHAIN_GCC_CW // TODO: Ideally, we would like to define directly "_ExitProcess" @@ -35,9 +34,3 @@ void exit(int return_code) { while (1); } - -WEAK void __cxa_pure_virtual(void); -WEAK void __cxa_pure_virtual(void) { - exit(1); -} - diff --git a/libraries/mbed/common/stdio.cpp b/libraries/mbed/common/retarget.cpp similarity index 98% rename from libraries/mbed/common/stdio.cpp rename to libraries/mbed/common/retarget.cpp index 116dff5130..b6c022a362 100644 --- a/libraries/mbed/common/stdio.cpp +++ b/libraries/mbed/common/retarget.cpp @@ -18,6 +18,7 @@ #include "FileSystemLike.h" #include "FilePath.h" #include "serial_api.h" +#include "toolchain.h" #include #if defined(__ARMCC_VERSION) @@ -386,4 +387,9 @@ namespace __gnu_cxx { error("Exception"); } } +extern "C" WEAK void __cxa_pure_virtual(void); +extern "C" WEAK void __cxa_pure_virtual(void) { + exit(1); +} + #endif