Skip to content

Commit 072f56e

Browse files
committed
Fix the build on OpenBSD, and possibly other BSDs
1 parent 6d901c4 commit 072f56e

File tree

4 files changed

+17
-5
lines changed

4 files changed

+17
-5
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MULTICALL = 1
22
CFLAGS = -Os -g -Wall -W
3-
CFLAGS += -std=c23
3+
CFLAGS += -std=c2x
44
PREFIX = /usr/local
55
RST2MAN = rst2man
66
RM = rm -f

denv.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
* SPDX-License-Identifier: MIT
55
*/
66

7+
#ifndef __linux
8+
#define _BSD_SOURCE
9+
#endif
10+
711
#define _DEFAULT_SOURCE
812
#define _GNU_SOURCE
913
#define _POSIX_C_SOURCE 200809L

dmon.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,12 @@
55
* Distributed under terms of the MIT license.
66
*/
77

8-
#define _GNU_SOURCE 1
9-
#define _POSIX_C_SOURCE 199309L
8+
#ifndef __linux
9+
#define _BSD_SOURCE
10+
#endif
11+
12+
#define _GNU_SOURCE
13+
#define _POSIX_C_SOURCE 200809L
1014

1115
#include "deps/cflag/cflag.h"
1216
#include "deps/clog/clog.h"

task.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
/*
22
* task.c
3-
* Copyright (C) 2010-2020 Adrian Perez <[email protected]>
3+
* Copyright (C) 2010-2024 Adrian Perez <[email protected]>
44
*
55
* Distributed under terms of the MIT license.
66
*/
77

8-
#define _POSIX_C_SOURCE 199309L
8+
#ifndef __linux
9+
#define _BSD_SOURCE
10+
#endif
11+
912
#define _DEFAULT_SOURCE
13+
#define _POSIX_C_SOURCE 199309L
1014

1115
#include "task.h"
1216
#include "deps/clog/clog.h"

0 commit comments

Comments
 (0)