1From 8cc60d618f81f2eeaa926cd60ed9b55ee6cda6ea Mon Sep 17 00:00:00 2001
2From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
3Date: Mon, 8 Aug 2016 15:42:46 +0200
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>
22---
23 addrdb/coord-config-parse.y | 4 ++++
24 1 file changed, 4 insertions(+)
25
26diff --git a/addrdb/coord-config-parse.y b/addrdb/coord-config-parse.y
27index 2e10a88..85ee058 100644
28--- a/addrdb/coord-config-parse.y
29+++ b/addrdb/coord-config-parse.y
30@@ -102,6 +102,10 @@
31
32 %}
33
34+%code requires {
35+#include <time.h>
36+}
37+
38 %union {
39 	unsigned long number;
40 	time_t timestamp;
41--
422.7.4
43
44