aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Araps <dylan.araps@gmail.com>2026-02-28 14:43:26 +0200
committerDylan Araps <dylan.araps@gmail.com>2026-02-28 14:43:26 +0200
commit74596d8273552f11959fe51fb8fff84a18ca9b83 (patch)
treeb7f164166586ed456fbcd9be8860ff9382132bf5
parent2a6d855693a0ae6cfe8078e91b1c4ae1c92c3603 (diff)
build: Maybe fix OpenBSD
We'll see how this goes...
-rw-r--r--config.h.in9
-rwxr-xr-xconfigure3
-rw-r--r--dfm.c5
3 files changed, 12 insertions, 5 deletions
diff --git a/config.h.in b/config.h.in
index eb2470a..ece0ddc 100644
--- a/config.h.in
+++ b/config.h.in
@@ -162,6 +162,15 @@
#define DFM_MARGIN 3
//
+// OS specific flags.
+//
+#ifdef __linux__
+#define _GNU_SOURCE
+#define _BSD_SOURCE
+#define _POSIX_C_SOURCE 200809L
+#endif
+
+//
// Configuration overrides from ./configure.
//
#include "$CFG_MACRO_GEN"
diff --git a/configure b/configure
index b169a66..6c21732 100755
--- a/configure
+++ b/configure
@@ -63,11 +63,8 @@ export STRIP="${STRIP:-strip}"
# Compiler flags.
#
export cc_flags="-std=$c_version -O2 -pipe"
-export cc_flags="$cc_flags -D_POSIX_C_SOURCE=200809L"
-export cc_flags="$cc_flags -D_BSD_SOURCE -D_GNU_SOURCE"
export cc_flags="$cc_flags -Wall -Wextra -pedantic -Wshadow"
-
#///////////////////////////////////////////////////////////////////////////////
#
# NOTE: Do not edit below this line.
diff --git a/dfm.c b/dfm.c
index c2fa0d5..6a2d16a 100644
--- a/dfm.c
+++ b/dfm.c
@@ -33,6 +33,9 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
+
+#include "config.h"
+
#include <assert.h>
#include <dirent.h>
#include <errno.h>
@@ -50,8 +53,6 @@
#include <sys/types.h>
#include <sys/wait.h>
-#include "config.h"
-
#include "lib/arg.h"
#include "lib/bitset.h"
#include "lib/date.h"