From 8f403251a8104b7ce108de2cadfce25876223503 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Sat, 5 Aug 2023 13:18:33 +0200 Subject: [PATCH] Fix missing asprintf definition on Haiku It needs _GNU_SOURCE and is declared in stdio.h as on GNU/Linux, but I suppose it's not included by the existing includes. --- cmake/Conky.cmake | 9 +++++++++ src/timeinfo.cc | 1 + 2 files changed, 10 insertions(+) diff --git a/cmake/Conky.cmake b/cmake/Conky.cmake index 2f821d96..5746bd48 100644 --- a/cmake/Conky.cmake +++ b/cmake/Conky.cmake @@ -122,6 +122,15 @@ if(OS_SOLARIS) set(conky_libs ${conky_libs} -L/usr/local/lib) endif(OS_SOLARIS) +if(OS_HAIKU) + # For asprintf + add_definitions(-D_GNU_SOURCE) # Standard definitions + set( + CMAKE_REQUIRED_DEFINITIONS + "${CMAKE_REQUIRED_DEFINITIONS} -D_GNU_SOURCE" + ) +endif(OS_HAIKU) + # Do version stuff set(VERSION_MAJOR "1") set(VERSION_MINOR "19") diff --git a/src/timeinfo.cc b/src/timeinfo.cc index ed9983ea..1a1da8ea 100644 --- a/src/timeinfo.cc +++ b/src/timeinfo.cc @@ -35,6 +35,7 @@ #include #include #include +#include #include "conky.h" #include "logging.h" #include "text_object.h"