File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 14
14
#include "../extensions/cmark-gfm-core-extensions.h"
15
15
16
16
#if defined(__OpenBSD__ )
17
- #include <unistd.h>
17
+ # include <sys/param.h>
18
+ # if OpenBSD >= 201605
19
+ # define USE_PLEDGE
20
+ # include <unistd.h>
21
+ # endif
18
22
#endif
19
23
20
24
#if defined(_WIN32 ) && !defined(__CYGWIN__ )
@@ -121,7 +125,7 @@ int main(int argc, char *argv[]) {
121
125
int options = CMARK_OPT_DEFAULT ;
122
126
int res = 1 ;
123
127
124
- #if defined( __OpenBSD__ )
128
+ #ifdef USE_PLEDGE
125
129
if (pledge ("stdio rpath" , NULL ) != 0 ) {
126
130
perror ("pledge" );
127
131
return 1 ;
@@ -275,7 +279,7 @@ int main(int argc, char *argv[]) {
275
279
}
276
280
}
277
281
278
- #if defined( __OpenBSD__ )
282
+ #ifdef USE_PLEDGE
279
283
if (pledge ("stdio" , NULL ) != 0 ) {
280
284
perror ("pledge" );
281
285
return 1 ;
You can’t perform that action at this time.
0 commit comments