diff options
-rw-r--r-- | src/main.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -8,7 +8,11 @@ #include "node.h" #if defined(__OpenBSD__) -#include <unistd.h> +# include <sys/param.h> +# if OpenBSD >= 201605 +# define USE_PLEDGE +# include <unistd.h> +# endif #endif #if defined(_WIN32) && !defined(__CYGWIN__) @@ -81,7 +85,7 @@ int main(int argc, char *argv[]) { writer_format writer = FORMAT_HTML; int options = CMARK_OPT_DEFAULT; -#if defined(__OpenBSD__) +#ifdef USE_PLEDGE if (pledge("stdio rpath", NULL) != 0) { perror("pledge"); return 1; @@ -187,7 +191,7 @@ int main(int argc, char *argv[]) { } } -#if defined(__OpenBSD__) +#ifdef USE_PLEDGE if (pledge("stdio", NULL) != 0) { perror("pledge"); return 1; |