0002-Add-missing-sys-types.h-includes.patch 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. From d33f16f463e888846d69ddfbeeb963d40972b654 Mon Sep 17 00:00:00 2001
  2. From: Luiz Angelo Daros de Luca <luizluca@gmail.com>
  3. Date: Thu, 15 Oct 2015 12:35:00 +0900
  4. Subject: [PATCH] Add missing <sys/types.h> includes
  5. [Thomas: backport from upstream commit
  6. 33495ef9b42a783c8f5f2c056ac5699481d3cc7e, allows to fix the build with
  7. the musl C library.]
  8. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  9. ---
  10. backend/epsonds-io.c | 3 +++
  11. backend/hp5400.c | 3 +++
  12. backend/hp5590.c | 3 +++
  13. backend/kvs20xx_cmd.h | 4 ++++
  14. backend/kvs40xx.h | 3 +++
  15. include/sane/sanei_udp.h | 3 +++
  16. 6 files changed, 19 insertions(+)
  17. diff --git a/backend/epsonds-io.c b/backend/epsonds-io.c
  18. index 28bacfc..512997d 100644
  19. --- a/backend/epsonds-io.c
  20. +++ b/backend/epsonds-io.c
  21. @@ -16,6 +16,9 @@
  22. #include "sane/config.h"
  23. #include <ctype.h>
  24. #include <unistd.h> /* sleep */
  25. +#ifdef HAVE_SYS_TYPES_H
  26. +#include <sys/types.h>
  27. +#endif
  28. #include "epsonds.h"
  29. #include "epsonds-io.h"
  30. diff --git a/backend/hp5400.c b/backend/hp5400.c
  31. index 61de3db..cfa2dc9 100644
  32. --- a/backend/hp5400.c
  33. +++ b/backend/hp5400.c
  34. @@ -67,6 +67,9 @@
  35. #include <stdlib.h> /* malloc, free */
  36. #include <string.h> /* memcpy */
  37. #include <stdio.h>
  38. +#ifdef HAVE_SYS_TYPES_H
  39. +#include <sys/types.h>
  40. +#endif
  41. #define HP5400_CONFIG_FILE "hp5400.conf"
  42. diff --git a/backend/hp5590.c b/backend/hp5590.c
  43. index 7b1cd60..5422372 100644
  44. --- a/backend/hp5590.c
  45. +++ b/backend/hp5590.c
  46. @@ -48,6 +48,9 @@
  47. #include <stdio.h>
  48. #include <string.h>
  49. #include <unistd.h>
  50. +#ifdef HAVE_SYS_TYPES_H
  51. +#include <sys/types.h>
  52. +#endif
  53. #include "../include/sane/sane.h"
  54. #define BACKEND_NAME hp5590
  55. diff --git a/backend/kvs20xx_cmd.h b/backend/kvs20xx_cmd.h
  56. index c18b754..4acaf62 100644
  57. --- a/backend/kvs20xx_cmd.h
  58. +++ b/backend/kvs20xx_cmd.h
  59. @@ -9,6 +9,10 @@
  60. Panasonic KV-S20xx USB-SCSI scanners.
  61. */
  62. +#ifdef HAVE_SYS_TYPES_H
  63. +#include <sys/types.h>
  64. +#endif
  65. +
  66. #define COMMAND_BLOCK 1
  67. #define DATA_BLOCK 2
  68. #define RESPONSE_BLOCK 3
  69. diff --git a/backend/kvs40xx.h b/backend/kvs40xx.h
  70. index fa17163..02e0da6 100644
  71. --- a/backend/kvs40xx.h
  72. +++ b/backend/kvs40xx.h
  73. @@ -10,6 +10,9 @@
  74. #include "../include/sane/config.h"
  75. #include <semaphore.h>
  76. +#ifdef HAVE_SYS_TYPES_H
  77. +#include <sys/types.h>
  78. +#endif
  79. #undef BACKEND_NAME
  80. #define BACKEND_NAME kvs40xx
  81. diff --git a/include/sane/sanei_udp.h b/include/sane/sanei_udp.h
  82. index c44afdd..e32fc1a 100644
  83. --- a/include/sane/sanei_udp.h
  84. +++ b/include/sane/sanei_udp.h
  85. @@ -27,6 +27,9 @@
  86. #include <netinet/in.h>
  87. #include <netdb.h>
  88. #endif
  89. +#ifdef HAVE_SYS_TYPES_H
  90. +#include <sys/types.h>
  91. +#endif
  92. extern SANE_Status sanei_udp_open(const char *host, int port, int *fdp);
  93. extern SANE_Status sanei_udp_open_broadcast(int *fdp);
  94. --
  95. 2.7.4