diff --git a/src/h/ecl-atomic-ops.h b/src/h/ecl-atomic-ops.h index 9fca5f883..af4170454 100644 --- a/src/h/ecl-atomic-ops.h +++ b/src/h/ecl-atomic-ops.h @@ -28,7 +28,7 @@ #else # define AO_load(x) (x) # define AO_store(x,y) ((x)=(y)) -# define AO_nop_full(x,y) +# define AO_nop_full() #endif #endif /* ECL_ATOMIC_OPS_H */ diff --git a/src/h/stack-resize.h b/src/h/stack-resize.h index cf14e4646..5c4e926a6 100644 --- a/src/h/stack-resize.h +++ b/src/h/stack-resize.h @@ -23,21 +23,21 @@ * via mprotect(), so we have to use sigprocmask instead. No * performance problems, since this is only used for stack * resizing. */ -#ifdef ECL_USE_MPROTECT -#ifdef HAVE_SIGPROCMASK -#include -#define ECL_STACK_RESIZE_DISABLE_INTERRUPTS(the_env) \ - sigset_t __sigset_new, __sigset_previous; \ - sigfillset(&__sigset_new); \ - pthread_sigmask(SIG_BLOCK, &__sigset_new, &__sigset_previous) -#define ECL_STACK_RESIZE_ENABLE_INTERRUPTS(the_env) \ - pthread_sigmask(SIG_SETMASK, &__sigset_previous, NULL) +#if defined(ECL_THREADS) && defined(ECL_USE_MPROTECT) +# ifdef HAVE_SIGPROCMASK +# include +# define ECL_STACK_RESIZE_DISABLE_INTERRUPTS(the_env) \ + sigset_t __sigset_new, __sigset_previous; \ + sigfillset(&__sigset_new); \ + pthread_sigmask(SIG_BLOCK, &__sigset_new, &__sigset_previous) +# define ECL_STACK_RESIZE_ENABLE_INTERRUPTS(the_env) \ + pthread_sigmask(SIG_SETMASK, &__sigset_previous, NULL) +# else +# error "Can't protect stack resizing from interrupts without sigprocmask. Either build ECL without mprotect() or live with possible race conditions." +# endif /* HAVE_SIGPROCMASK */ #else -#error "Can't protect stack resizing from interrupts without sigprocmask. Either build ECL without mprotect() or live with possible race conditions." -#endif /* HAVE_SIGPROCMASK */ -#else -#define ECL_STACK_RESIZE_DISABLE_INTERRUPTS(the_env) ecl_disable_interrupts_env(the_env); -#define ECL_STACK_RESIZE_ENABLE_INTERRUPTS(the_env) ecl_enable_interrupts_env(env); -#endif /* ECL_USE_MPROTECT */ +# define ECL_STACK_RESIZE_DISABLE_INTERRUPTS(the_env) ecl_disable_interrupts_env(the_env); +# define ECL_STACK_RESIZE_ENABLE_INTERRUPTS(the_env) ecl_enable_interrupts_env(env); +# endif /* ECL_THREADS && ECL_USE_MPROTECT */ #endif /* ECL_STACK_RESIZE_H */