aboutsummaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-support/lowpan-tools/lowpan-tools/0001-addrdb-coord-config-parse.y-add-missing-time.h-inclu.patch
blob: 81a3f52d90c80c72e3d0099e0e6e5a6e587ee8cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
From ab725a3faaeead90ae3c63cbcd370af087c413a5 Mon Sep 17 00:00:00 2001
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Date: Mon, 27 Mar 2017 17:55:06 -0700
Subject: [PATCH] addrdb/coord-config-parse.y: add missing <time.h> include
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The %union definition uses the time_t structure. In order to use this
structure, the <time.h> header has to be included. Otherwise, the build
breaks with some C libraries, such as musl:

In file included from coord-config-lex.l:23:0:
coord-config-parse.y:107:2: error: unknown type name ‘time_t’
  time_t timestamp;
  ^

This patch includes <time.h> using the '%code requires' directive of
Yacc.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
Upstream-Status: Pending

 addrdb/coord-config-parse.y | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/addrdb/coord-config-parse.y b/addrdb/coord-config-parse.y
index 2e10a88..85ee058 100644
--- a/addrdb/coord-config-parse.y
+++ b/addrdb/coord-config-parse.y
@@ -102,6 +102,10 @@
 
 %}
 
+%code requires {
+#include <time.h>
+}
+
 %union {
 	unsigned long number;
 	time_t timestamp;
-- 
2.12.1