[ox/std] Add substitutes file with missing __cxa_pure_virtual handler

This commit is contained in:
Gary Talent 2019-06-15 12:47:11 -05:00
parent de210c5c7e
commit 47ce0408d5
2 changed files with 30 additions and 0 deletions

View File

@ -6,6 +6,7 @@ add_library(
memops.cpp memops.cpp
new.cpp new.cpp
random.cpp random.cpp
substitutes.cpp
stacktrace.cpp stacktrace.cpp
strops.cpp strops.cpp
trace.cpp trace.cpp

29
deps/ox/src/ox/std/substitutes.cpp vendored Normal file
View File

@ -0,0 +1,29 @@
/*
* Copyright 2015 - 2018 gtalent2@gmail.com
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef OX_USE_STDLIB
#include <cstdlib>
#include <stdio.h>
// weak link panic to ensure that it exists, but allow it to be overriden by
// platform specific code
void __attribute__((weak)) panic(const char *msg) {
printf("Unexpected state:\n%s", msg);
std::abort();
}
extern "C" {
void __cxa_pure_virtual() {
panic("Missing virtual function");
}
}
#endif