jmpbuf-unwind.h 689 B

12345678910111213141516171819202122
  1. /*
  2. * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  3. */
  4. #include <setjmp.h>
  5. /* Test if longjmp to JMPBUF would unwind the frame
  6. containing a local variable at ADDRESS. */
  7. #undef _JMPBUF_UNWINDS
  8. #define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \
  9. ((void *) (address) > (void *) demangle (jmpbuf[JB_SP]))
  10. #ifdef __UCLIBC_HAS_THREADS_NATIVE__
  11. #include <stdint.h>
  12. #include <unwind.h>
  13. #define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
  14. _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
  15. #define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
  16. ((uintptr_t) (_address) - (_adj) > (uintptr_t) (_jmpbuf)[JB_SP] - (_adj))
  17. #endif