PlatformIO package of the Teensy core framework compatible with GCC 10 & C++20
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

new.h 1.9KB

3 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /* Teensyduino Core Library
  2. * http://www.pjrc.com/teensy/
  3. * Copyright (c) 2017 PJRC.COM, LLC.
  4. *
  5. * Permission is hereby granted, free of charge, to any person obtaining
  6. * a copy of this software and associated documentation files (the
  7. * "Software"), to deal in the Software without restriction, including
  8. * without limitation the rights to use, copy, modify, merge, publish,
  9. * distribute, sublicense, and/or sell copies of the Software, and to
  10. * permit persons to whom the Software is furnished to do so, subject to
  11. * the following conditions:
  12. *
  13. * 1. The above copyright notice and this permission notice shall be
  14. * included in all copies or substantial portions of the Software.
  15. *
  16. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  17. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  18. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  19. * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
  20. * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
  21. * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  22. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  23. * SOFTWARE.
  24. */
  25. /* Header to define new/delete operators as they aren't provided by avr-gcc by default
  26. Adapted from from http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=59453
  27. */
  28. #ifndef NEW_H
  29. #define NEW_H
  30. #ifdef __cplusplus
  31. #include <stdlib.h>
  32. void * operator new(size_t size);
  33. void * operator new[](size_t size);
  34. void operator delete(void * ptr);
  35. void operator delete[](void * ptr);
  36. void operator delete(void * ptr, size_t size);
  37. void operator delete[](void * ptr, size_t size);
  38. __extension__ typedef int __guard __attribute__((mode (__DI__)));
  39. extern "C" int __cxa_guard_acquire(__guard *);
  40. extern "C" void __cxa_guard_release (__guard *);
  41. extern "C" void __cxa_guard_abort (__guard *);
  42. extern "C" void __cxa_pure_virtual(void);
  43. #endif // __cplusplus
  44. #endif