api-nocxx.cpp (878B)
1 // This file is part of Blend2D project <https://blend2d.com> 2 // 3 // See blend2d.h or LICENSE.md for license and copyright information 4 // SPDX-License-Identifier: Zlib 5 6 #include "api-build_p.h" 7 #include "runtime_p.h" 8 9 // This file provides support for building Blend2D without C++ standard library. 10 // Blend2D doesn't really use any C++ features that would require a C++ runtime 11 // library, but there are little things here and there that require some attention. 12 #ifdef BL_BUILD_NO_STDCXX 13 14 BL_BEGIN_C_DECLS 15 16 // `__cxa_pure_virtual` replaces all abstract virtual functions (that have no 17 // implementation). We provide a replacement with `BL_HIDDEN` attribute to 18 // make it local to Blend2D library. 19 BL_HIDDEN void __cxa_pure_virtual() noexcept { 20 bl_runtime_failure("[Blend2D] __cxa_pure_virtual(): Pure virtual function called"); 21 } 22 23 BL_END_C_DECLS 24 25 #endif // BL_BUILD_NO_STDCXX