1From ab725a3faaeead90ae3c63cbcd370af087c413a5 Mon Sep 17 00:00:00 2001
2From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
3Date: Mon, 27 Mar 2017 17:55:06 -0700
4Subject: [PATCH] addrdb/coord-config-parse.y: add missing <time.h> include
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9The %union definition uses the time_t structure. In order to use this
10structure, the <time.h> header has to be included. Otherwise, the build
11breaks with some C libraries, such as musl:
12
13In file included from coord-config-lex.l:23:0:
14coord-config-parse.y:107:2: error: unknown type name ‘time_t’
15  time_t timestamp;
16  ^
17
18This patch includes <time.h> using the '%code requires' directive of
19Yacc.
20
21Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
22Signed-off-by: Khem Raj <raj.khem@gmail.com>
23---
24Upstream-Status: Pending
25
26 addrdb/coord-config-parse.y | 4 ++++
27 1 file changed, 4 insertions(+)
28
29diff --git a/addrdb/coord-config-parse.y b/addrdb/coord-config-parse.y
30index 2e10a88..85ee058 100644
31--- a/addrdb/coord-config-parse.y
32+++ b/addrdb/coord-config-parse.y
33@@ -102,6 +102,10 @@
34
35 %}
36
37+%code requires {
38+#include <time.h>
39+}
40+
41 %union {
42 	unsigned long number;
43 	time_t timestamp;
44--
452.12.1
46
47