Brad Bishop | e42b3e3 | 2020-01-15 22:08:42 -0500 | [diff] [blame] | 1 | From 9b39a985bcd6cd34f0820f3680f145d46c0e56bd Mon Sep 17 00:00:00 2001 |
| 2 | From: Titouan Christophe <titouan.christophe@railnova.eu> |
| 3 | Date: Sun, 8 Dec 2019 01:55:59 +0100 |
| 4 | Subject: [PATCH] Allow avro C to be built on musl based systems. |
| 5 | MIME-Version: 1.0 |
| 6 | Content-Type: text/plain; charset=UTF-8 |
| 7 | Content-Transfer-Encoding: 8bit |
| 8 | |
| 9 | The type `ssize_t` is defined in sys/types.h, and nowhere else |
| 10 | in the musl standard C library, so it should be included for the |
| 11 | compilation to succeed. |
| 12 | |
| 13 | This fixes several errors like: |
| 14 | |
| 15 | In file included from src/generic.c:29:0: |
| 16 | src/generic.c: In function ‘avro_generic_value_new’: |
| 17 | src/avro_generic_internal.h:63:39: |
| 18 | error: ‘ssize_t’ undeclared (first use in this function); |
| 19 | did you mean ‘size_t’? |
| 20 | |
| 21 | Upstream-Status: Backport |
| 22 | Signed-off-by: Titouan Christophe <titouan.christophe@railnova.eu> |
| 23 | --- |
| 24 | lang/c/src/avro_generic_internal.h | 2 ++ |
| 25 | 1 file changed, 2 insertions(+) |
| 26 | |
| 27 | diff --git a/lang/c/src/avro_generic_internal.h b/lang/c/src/avro_generic_internal.h |
| 28 | index 709403c03..9843ed652 100644 |
| 29 | --- a/lang/c/src/avro_generic_internal.h |
| 30 | +++ b/lang/c/src/avro_generic_internal.h |
| 31 | @@ -24,6 +24,8 @@ extern "C" { |
| 32 | #define CLOSE_EXTERN |
| 33 | #endif |
| 34 | |
| 35 | +#include <sys/types.h> |
| 36 | + |
| 37 | #include "avro/generic.h" |
| 38 | #include "avro/schema.h" |
| 39 | #include "avro/value.h" |
| 40 | -- |
| 41 | 2.24.1 |
| 42 | |