From c1136180cc5a0f991244129609f0e5d1af19b13a Mon Sep 17 00:00:00 2001 From: Nikolaus Klepp Date: Thu, 11 Jun 2015 03:00:34 +0200 Subject: [PATCH] Fix FTBFS on freebsd This resolves Bug 2431 Signed-off-by: Nikolaus Klepp (cherry picked from commit 3be9f300c9a754320a02fd10a729ef797ffb8506) --- kdeprint/cups/make_driver_db_cups.cpp | 3 +++ kdeprint/ppdloader.cpp | 4 ++++ kio/kio/connection.cpp | 2 +- kio/kio/kurlcompletion.cpp | 4 ++-- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/kdeprint/cups/make_driver_db_cups.cpp b/kdeprint/cups/make_driver_db_cups.cpp index d1c556242..bc6e4383b 100644 --- a/kdeprint/cups/make_driver_db_cups.cpp +++ b/kdeprint/cups/make_driver_db_cups.cpp @@ -19,6 +19,9 @@ **/ #include +#ifndef _GNU_SOURCE +#define _GNU_SOURCE /* Needed for getline */ +#endif #include #include #include diff --git a/kdeprint/ppdloader.cpp b/kdeprint/ppdloader.cpp index d80e8ae5a..aedce2dda 100644 --- a/kdeprint/ppdloader.cpp +++ b/kdeprint/ppdloader.cpp @@ -17,6 +17,10 @@ * Boston, MA 02110-1301, USA. **/ +#ifndef _GNU_SOURCE +#define _GNU_SOURCE /* Needed for getline */ +#endif + #include "ppdloader.h" #include "foomatic2loader.h" #include "driver.h" diff --git a/kio/kio/connection.cpp b/kio/kio/connection.cpp index 0e65643c8..786fbd5e3 100644 --- a/kio/kio/connection.cpp +++ b/kio/kio/connection.cpp @@ -43,7 +43,7 @@ #include #include -#if defined(__OpenBSD__) +#if defined(__OpenBSD__) || defined(__FreeBSD__) #define __progname getprogname() #else extern char *__progname; diff --git a/kio/kio/kurlcompletion.cpp b/kio/kio/kurlcompletion.cpp index 2f02f3271..7d9941480 100644 --- a/kio/kio/kurlcompletion.cpp +++ b/kio/kio/kurlcompletion.cpp @@ -778,13 +778,13 @@ bool KURLCompletion::userCompletion(const MyURL &url, TQString *match) // Environment variables // -#if !defined(__OpenBSD__) +#if !defined(__OpenBSD__) && !defined(__FreeBSD__) extern char **environ; // Array of environment variables #endif bool KURLCompletion::envCompletion(const MyURL &url, TQString *match) { -#if defined(__OpenBSD__) +#if defined(__OpenBSD__) || defined(__FreeBSD__) return false; #else if ( url.file().at(0) != '$' )