Last active
August 29, 2015 14:14
-
-
Save pocarist/96aa47c4529131392355 to your computer and use it in GitHub Desktop.
Fix compile error for NetBSD/i386 (OCaml 4.02 or later)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- ocaml-4.02.1/asmrun/signals_osdep.h 2014-09-29 04:46:24.000000000 +0900 | |
+++ ocaml-4.02.1_fix/asmrun/signals_osdep.h 2014-10-05 15:22:24.000000000 +0900 | |
@@ -163,14 +172,24 @@ | |
#elif defined(TARGET_i386) && defined(SYS_bsd_elf) | |
- #define DECLARE_SIGNAL_HANDLER(name) \ | |
- static void name(int sig, siginfo_t * info, struct sigcontext * context) | |
+ #if defined (__NetBSD__) | |
+ #include <ucontext.h> | |
+ #define DECLARE_SIGNAL_HANDLER(name) \ | |
+ static void name(int sig, siginfo_t * info, ucontext_t * context) | |
+ #else | |
+ #define DECLARE_SIGNAL_HANDLER(name) \ | |
+ static void name(int sig, siginfo_t * info, struct sigcontext * context) | |
+ #endif | |
#define SET_SIGACT(sigact,name) \ | |
sigact.sa_sigaction = (void (*)(int,siginfo_t *,void *)) (name); \ | |
sigact.sa_flags = SA_SIGINFO | |
- #define CONTEXT_PC (context->sc_eip) | |
+ #if defined (__NetBSD__) | |
+ #define CONTEXT_PC (_UC_MACHINE_PC(context)) | |
+ #else | |
+ #define CONTEXT_PC (context->sc_eip) | |
+ #endif | |
#define CONTEXT_FAULTING_ADDRESS ((char *) info->si_addr) | |
/****************** I386, BSD */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment