0002-addrdb-coord-config-parse.y-add-missing-time.h-inclu.patch 1.2 KB

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