Skip to content

Commit 17be97a

Browse files
authored
Define _BSD_SOURCE in builtin.c for OpenBSD support (#3278)
On OpenBSD, some prototypes are hidden behind `_BSD_SOURCE`. Defining this variable fixes #3252, and also fixes #3276. This can be seen as a regression of #2631.
1 parent 95ee663 commit 17be97a

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/builtin.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
# define _XPG6
66
# define __EXTENSIONS__
77
#endif
8+
#ifdef __OpenBSD__
9+
# define _BSD_SOURCE
10+
#endif
811
#include <sys/time.h>
912
#include <stdlib.h>
1013
#include <stddef.h>

tests/optional.test

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ last(range(365 * 67)|("1970-03-01T01:02:03Z"|strptime("%Y-%m-%dT%H:%M:%SZ")|mkti
1212
null
1313
[2037,1,11,1,2,3,3,41]
1414

15+
# Regression test for #3276
16+
fromdate
17+
"2038-01-19T03:14:08Z"
18+
2147483648
19+
1520
# %e is not available on mingw/WIN32
1621
strftime("%A, %B %e, %Y")
1722
1435677542.822351

0 commit comments

Comments
 (0)