diff --git a/src/handlesegfault.c b/src/handlesegfault.c index d57efc6..65e285e 100755 --- a/src/handlesegfault.c +++ b/src/handlesegfault.c @@ -4,16 +4,21 @@ // Handling Sigfault errors. Prevents the code from exiting R. // This is only available for UNIX platforms. #ifndef WIN_COMPILE +#ifdef HAVE_XML void segfault_KGML(int signal, siginfo_t *si, void *arg){ EVAL(lang2(install("registerMemoryErr"), mkString("KGML2igraph"))); error("Critical memory error in KGML2igraph. Please save your work and restart R."); } +#endif +#ifdef HAVE_SBML void segfault_SBML(int signal, siginfo_t *si, void *arg){ EVAL(lang2(install("registerMemoryErr"), mkString("SBML2igraph"))); error("Critical memory error in SBML2igraph. Please save your work and restart R."); } #endif +#endif +#ifdef HAVE_XML void handle_segfault_KGML(){ #ifndef WIN_COMPILE struct sigaction sa; @@ -26,7 +31,9 @@ void handle_segfault_KGML(){ sigaction(SIGSEGV, &sa, NULL); #endif } +#endif +#ifdef HAVE_SBML void handle_segfault_SBML(){ #ifndef WIN_COMPILE struct sigaction sa; @@ -39,3 +46,4 @@ void handle_segfault_SBML(){ sigaction(SIGSEGV, &sa, NULL); #endif } +#endif diff --git a/src/handlesegfault.h b/src/handlesegfault.h index 3822879..c2f7426 100755 --- a/src/handlesegfault.h +++ b/src/handlesegfault.h @@ -15,8 +15,12 @@ extern "C" { #endif +#ifdef HAVE_XML void handle_segfault_KGML(); +#endif +#ifdef HAVE_SBML void handle_segfault_SBML(); +#endif #ifdef __cplusplus }