hplip/add_missing_includes_and_define_GNU_SOURCE.patch
2025-01-14 15:39:17 +00:00

96 lines
2.1 KiB
Diff

From d52301159a5add137b46e7183970ea1f1cbfe8ac Mon Sep 17 00:00:00 2001
From: Martin Wilck <mwilck@suse.com>
Date: Fri, 15 Sep 2023 18:27:13 +0200
Subject: [PATCH 04/19] add missing includes and define GNU_SOURCE
---
common/utils.c | 5 +++++
io/hpmud/jd.c | 1 +
protocol/hp_ipp.c | 4 ++++
scan/sane/bb_ledm.c | 1 +
scan/sane/sclpml.c | 5 +++++
5 files changed, 16 insertions(+)
diff --git a/common/utils.c b/common/utils.c
index d8ecee9..6f5cef9 100644
--- a/common/utils.c
+++ b/common/utils.c
@@ -1,9 +1,14 @@
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
+
#include "utils.h"
#include "string.h"
#include <dlfcn.h>
#include <sys/stat.h>
#include <errno.h>
#include <stdlib.h>
+#include <string.h>
extern int errno;
diff --git a/io/hpmud/jd.c b/io/hpmud/jd.c
index be3c823..c15ed9c 100644
--- a/io/hpmud/jd.c
+++ b/io/hpmud/jd.c
@@ -31,6 +31,7 @@
#endif
#include <signal.h>
+#include <stdlib.h>
#include "hpmud.h"
#include "hpmudi.h"
diff --git a/protocol/hp_ipp.c b/protocol/hp_ipp.c
index 8b72c65..9b05f5e 100644
--- a/protocol/hp_ipp.c
+++ b/protocol/hp_ipp.c
@@ -18,6 +18,10 @@ Boston, MA 02110-1301, USA.
\******************************************************************************/
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
+
#include <cups/cups.h>
#include <cups/language.h>
#include <cups/ppd.h>
diff --git a/scan/sane/bb_ledm.c b/scan/sane/bb_ledm.c
index 4b18af8..eaf1299 100644
--- a/scan/sane/bb_ledm.c
+++ b/scan/sane/bb_ledm.c
@@ -27,6 +27,7 @@
# include "xml.h"
# include <stdlib.h>
+# include <unistd.h>
# include <stdint.h>
# define _STRINGIZE(x) #x
diff --git a/scan/sane/sclpml.c b/scan/sane/sclpml.c
index 9a5975f..3250541 100644
--- a/scan/sane/sclpml.c
+++ b/scan/sane/sclpml.c
@@ -25,11 +25,16 @@
\************************************************************************************/
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
+
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
+#include <sys/time.h>
#include "sane.h"
#include "saneopts.h"
#include "common.h"
--
2.42.0