1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-10-30 04:26:50 +03:00

exceptions: optionally enforce c++ standards (#6333)

* exceptions: 3 choices: legacy, std::new never returns 0, or exceptions enabled
* arduino_new (doc, example, array)
This commit is contained in:
david gauchard
2019-08-29 00:21:10 +02:00
committed by GitHub
parent 0a031ce957
commit 85f1ea7c78
6 changed files with 420 additions and 65 deletions

View File

@@ -32,7 +32,7 @@ extern "C" void __cxa_pure_virtual(void) __attribute__ ((__noreturn__));
extern "C" void __cxa_deleted_virtual(void) __attribute__ ((__noreturn__));
#ifndef __cpp_exceptions
#if !defined(__cpp_exceptions) && !defined(NEW_OOM_ABORT)
void *operator new(size_t size)
{
void *ret = malloc(size);
@@ -52,7 +52,7 @@ void *operator new[](size_t size)
}
return ret;
}
#endif
#endif // arduino's std::new legacy
void __cxa_pure_virtual(void)
{