1From 145e16008e7479ea58278e55f71d6dfcd4db714b Mon Sep 17 00:00:00 2001
2From: Peter Seiderer <ps.report@gmx.net>
3Date: Fri, 18 Jun 2021 19:51:45 +0200
4Subject: [PATCH] backend/microtek: fix uclibc compile (include stdarg.h for
5 va_list/va_start/va_end)
6MIME-Version: 1.0
7Content-Type: text/plain; charset=UTF-8
8Content-Transfer-Encoding: 8bit
9
10Fixes:
11
12  microtek.c: In function ‘MDBG_INIT’:
13  microtek.c:163:3: error: unknown type name ‘va_list’
14    163 |   va_list ap;
15        |   ^~~~~~~
16  microtek.c:78:1: note: ‘va_list’ is defined in header ‘<stdarg.h>’; did you forget to ‘#include <stdarg.h>’?
17     77 | #include "microtek.h"
18    +++ |+#include <stdarg.h>
19     78 |
20  microtek.c:164:3: warning: implicit declaration of function ‘va_start’; did you mean ‘sane_start’? [-Wimplicit-function-declaration]
21    164 |   va_start(ap, format);
22        |   ^~~~~~~~
23        |   sane_start
24  microtek.c:165:54: warning: passing argument 4 of ‘vsnprintf’ makes pointer from integer without a cast [-Wint-conversion]
25    165 |   vsnprintf(_mdebug_string, MAX_MDBG_LENGTH, format, ap);
26        |                                                      ^~
27        |                                                      |
28        |                                                      int
29  In file included from ../include/sane/sanei_config.h:50,
30                   from microtek.c:70:
31  .../host/x86_64-buildroot-linux-uclibc/sysroot/usr/include/stdio.h:359:57: note: expected ‘__va_list_tag *’ but argument is of type ‘int’
32    359 |         const char *__restrict __format, __gnuc_va_list __arg)
33        |                                          ~~~~~~~~~~~~~~~^~~~~
34  microtek.c:166:3: warning: implicit declaration of function ‘va_end’ [-Wimplicit-function-declaration]
35    166 |   va_end(ap);
36        |   ^~~~~~
37
38[Upstream: https://gitlab.com/sane-project/backends/-/merge_requests/638]
39Signed-off-by: Peter Seiderer <ps.report@gmx.net>
40---
41 backend/microtek.c | 1 +
42 1 file changed, 1 insertion(+)
43
44diff --git a/backend/microtek.c b/backend/microtek.c
45index 200a69c1a..63560179c 100644
46--- a/backend/microtek.c
47+++ b/backend/microtek.c
48@@ -57,6 +57,7 @@
49
50 #include "../include/sane/config.h"
51
52+#include <stdarg.h>
53 #include <stdlib.h>
54 #include <string.h>
55 #include <unistd.h>
56--
572.31.1
58
59