mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-20 04:28:10 +00:00
fix(c-wrapper): use abort instead of fatal
This commit is contained in:
parent
18f0782b46
commit
429a231cb0
1 changed files with 10 additions and 10 deletions
|
|
@ -113,9 +113,9 @@ private:
|
|||
// Runtime checker.
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
static inline void fatal (const char *message) {
|
||||
std::cout << "[FATAL C-WRAPPER]" << message << std::endl;
|
||||
//exit(1);
|
||||
static inline void abort (const char *message) {
|
||||
std::cerr << "[FATAL C-WRAPPER]" << message << std::endl;
|
||||
std::abort();
|
||||
}
|
||||
|
||||
public:
|
||||
|
|
@ -135,7 +135,7 @@ public:
|
|||
|
||||
CppDerivedPrivateType *derived = dynamic_cast<CppDerivedPrivateType *>(base);
|
||||
if (!derived)
|
||||
fatal("Invalid cast.");
|
||||
abort("Invalid cast.");
|
||||
return derived;
|
||||
#else
|
||||
return static_cast<CppDerivedPrivateType *>(base);
|
||||
|
|
@ -170,11 +170,11 @@ public:
|
|||
|
||||
std::shared_ptr<BaseType> cppObject = reinterpret_cast<WrappedObject<BaseType> *>(cObject)->cppPtr;
|
||||
if (!cppObject)
|
||||
fatal("Cpp Object is null.");
|
||||
abort("Cpp Object is null.");
|
||||
|
||||
std::shared_ptr<DerivedType> derivedCppObject = std::static_pointer_cast<DerivedType>(cppObject);
|
||||
if (!derivedCppObject)
|
||||
fatal("Invalid derived cpp object.");
|
||||
abort("Invalid derived cpp object.");
|
||||
|
||||
return derivedCppObject;
|
||||
#else
|
||||
|
|
@ -207,11 +207,11 @@ public:
|
|||
|
||||
BaseType *cppObject = reinterpret_cast<WrappedClonableObject<BaseType> *>(cObject)->cppPtr;
|
||||
if (!cppObject)
|
||||
fatal("Cpp Object is null.");
|
||||
abort("Cpp Object is null.");
|
||||
|
||||
DerivedType *derivedCppObject = dynamic_cast<DerivedType *>(cppObject);
|
||||
if (!derivedCppObject)
|
||||
fatal("Invalid derived cpp object.");
|
||||
abort("Invalid derived cpp object.");
|
||||
|
||||
return derivedCppObject;
|
||||
#else
|
||||
|
|
@ -294,9 +294,9 @@ public:
|
|||
return nullptr;
|
||||
|
||||
try {
|
||||
return getCBackPtr(std::static_pointer_cast<CppType>(cppObject->shared_from_this()));
|
||||
return getCBackPtr(std::static_pointer_cast<CppType>(cppObject->sharedFromThis()));
|
||||
} catch (const std::bad_weak_ptr &e) {
|
||||
fatal(e.what());
|
||||
abort(e.what());
|
||||
}
|
||||
|
||||
L_ASSERT(false);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue