Skip to content

Commit 3682fc8

Browse files
committed
[docopt_c.py] Fix macOS support; [test/docopt.h] Regenerate
1 parent 4b4fa48 commit 3682fc8

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

docopt_c.py

+6
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,12 @@
105105
106106
#include <sys/param.h>
107107
108+
#if defined(__APPLE__) || defined(__APPLE_CC__)
109+
/* ARG_MAX gives a segfault on macOS when used for array size below */
110+
#undef ARG_MAX
111+
#undef NCARGS
112+
#endif
113+
108114
#else
109115
110116
#include <limits.h>

test/docopt.h

+6
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@ typedef size_t bool;
6262

6363
#include <sys/param.h>
6464

65+
#if defined(__APPLE__) || defined(__APPLE_CC__)
66+
/* ARG_MAX gives a segfault on macOS when used for array size below */
67+
#undef ARG_MAX
68+
#undef NCARGS
69+
#endif
70+
6571
#else
6672

6773
#include <limits.h>

0 commit comments

Comments
 (0)