Skip to content
Myr

Define `_BSD_SOURCE` in builtin.c for OpenBSD support (#3278)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

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.

authored by itchyny · committed by GitHub · parent 95ee663 · Browse files · 2 files+8 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+8 added−0 removed

  • tests:+5 added−0 removed
  • other:+3 added−0 removed

2 files+8 added−0 removed

modified:src/builtin.c+3 added
3 unmodified lines
4#else5# define _XPG66# define __EXTENSIONS__7#endif8#ifdef __OpenBSD__9# define _BSD_SOURCE10#endif11#include <sys/time.h>12#include <stdlib.h>13#include <stddef.h>14#ifdef HAVE_ALLOCA_H
2061 unmodified lines
modified:tests/optional.test+5 added
10 unmodified lines
11last(range(365 * 67)|("1970-03-01T01:02:03Z"|strptime("%Y-%m-%dT%H:%M:%SZ")|mktime) + (86400 * .)|strftime("%Y-%m-%dT%H:%M:%SZ")|strptime("%Y-%m-%dT%H:%M:%SZ"))12null13[2037,1,11,1,2,3,3,41]1415# Regression test for #327616fromdate17"2038-01-19T03:14:08Z"1821474836481920# %e is not available on mingw/WIN3221strftime("%A, %B %e, %Y")221435677542.82235123"Tuesday, June 30, 2015"
2 unmodified lines