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.
This commit is contained in:
itchyny authored and GitHub committed 2025-03-04 21:39:52 +09:00
1 parent 95ee663b28
commit 17be97a8ad
2 files changed
+8

No files matched your search

+3
View File
@@ -5,6 +5,9 @@
# define _XPG6
# define __EXTENSIONS__
#endif
#ifdef __OpenBSD__
# define _BSD_SOURCE
#endif
#include <sys/time.h>
#include <stdlib.h>
#include <stddef.h>
+5
View File
@@ -12,6 +12,11 @@ last(range(365 * 67)|("1970-03-01T01:02:03Z"|strptime("%Y-%m-%dT%H:%M:%SZ")|mkti
null
[2037,1,11,1,2,3,3,41]
# Regression test for #3276
fromdate
"2038-01-19T03:14:08Z"
2147483648
# %e is not available on mingw/WIN32
strftime("%A, %B %e, %Y")
1435677542.822351