From 664b53d5c4920e66e4a57c7515ccfd1bd1477bac Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Filipe=20La=C3=ADns?= <lains@riseup.net>
Date: Wed, 2 Apr 2025 03:43:51 +0100
Subject: [PATCH] build: add -D_POSIX_C_SOURCE=200809L
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Filipe Laíns <lains@riseup.net>
---
 meson.build | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/meson.build b/meson.build
index 810a6fa9948217a9b7ac5731057a27fd2a6cf95a..3b88c75eabccf8d8ef9e44e6f36440806ad012cb 100644
--- a/meson.build
+++ b/meson.build
@@ -10,6 +10,7 @@ cc = meson.get_compiler('c')
 add_project_arguments(
   '-D_BSD_SOURCE',
   '-D_DEFAULT_SOURCE',
+  '-D_POSIX_C_SOURCE=200809L',
   cc.get_supported_arguments(
     '-Wimplicit-function-declaration',
     '-Wmisleading-indentation',
@@ -31,7 +32,7 @@ check_functions = [
 
 foreach f : check_functions
   name = f[0].to_upper().underscorify()
-  if cc.has_function(f[0], prefix : '#define _BSD_SOURCE\n#define _DEFAULT_SOURCE\n#include <@0@>'.format(f[1])) and cc.has_header_symbol(f[1], f[0], prefix : '#define _BSD_SOURCE\n#define _DEFAULT_SOURCE')
+  if cc.has_function(f[0], prefix : '#define _BSD_SOURCE\n#define _DEFAULT_SOURCE\n#define _POSIX_C_SOURCE 200809L\n#include <@0@>'.format(f[1])) and cc.has_header_symbol(f[1], f[0], prefix : '#define _BSD_SOURCE\n#define _DEFAULT_SOURCE\n#define _POSIX_C_SOURCE 200809L')
     cdata.set('HAVE_@0@'.format(name), 1)
     cdata.set('HAVE_DECL_@0@'.format(name), 1)
   else
