Mercurial > pub > dyncall > dyncall
diff test/thunk/test_thunk.c @ 371:451299d50c1a
- windows arm64 support (dyncall, dyncallback, cmake support for armasm64), thanks Bernhard Urban-Forster!
- minor cleanups
author | Tassilo Philipp |
---|---|
date | Fri, 25 Dec 2020 18:07:39 +0100 |
parents | f5577f6bf97a |
children | 51af8ec8d8e6 |
line wrap: on
line diff
--- a/test/thunk/test_thunk.c Sat Dec 19 20:02:08 2020 +0100 +++ b/test/thunk/test_thunk.c Fri Dec 25 18:07:39 2020 +0100 @@ -6,7 +6,7 @@ Description: License: - Copyright (c) 2011-2018 Daniel Adler <dadler@uni-goettingen.de>, + Copyright (c) 2011-2020 Daniel Adler <dadler@uni-goettingen.de>, Tassilo Philipp <tphilipp@potion-studios.com> Permission to use, copy, modify, and distribute this software for any @@ -116,7 +116,19 @@ { dcTest_initPlatform(); +#if defined(DC__OS_MacOSX) + /* Memory access errors can result into SIGBUS */ + signal(SIGBUS, segv_handler); + + struct sigaction sigAct; + sigfillset(&(sigAct.sa_mask)); + sigAct.sa_sigaction = segv_handler; + /* we need to enable SA_ONSTACK which allows faulting on the stack */ + sigAct.sa_flags = SA_SIGINFO|SA_RESTART|SA_ONSTACK; + sigaction(SIGSEGV, &sigAct, NULL); +#else signal(SIGSEGV, segv_handler); +#endif printf("Allocating ...\n"); printf("... W^X memory: ");