[patches] [PATCH] Fix FreeBSD build
Konstantin Osipov
kostja at tarantool.org
Tue Mar 6 21:38:08 MSK 2018
* Konstantin Belyavskiy <k.belyavskiy at tarantool.org> [18/03/06 20:19]:
> Under FreeBSD getline prototype is not provided by
> default due to compatibility problems.
> Use _GNU_SOURCE macro to solve this issue.
> Based on @zloidemon proposal.
>
> Closes #3217.
> ---
> branch: gh-3217-enable-getline-prototype-freebsd
> test/unit/say.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/test/unit/say.c b/test/unit/say.c
> index 4e4b3f94e..dd027951b 100644
> --- a/test/unit/say.c
> +++ b/test/unit/say.c
> @@ -1,3 +1,7 @@
> +#ifndef _GNU_SOURCE
> +#define _GNU_SOURCE
> +#endif
Please avoid doing this in say.c, add compile definitions in
cmake, or use sscanf instead of getline().
> +
> #include <string.h>
> #include <fiber.h>
> #include <memory.h>
> --
> 2.14.3 (Apple Git-98)
--
Konstantin Osipov, Moscow, Russia, +7 903 626 22 32
http://tarantool.org - www.twitter.com/kostja_osipov
More information about the Tarantool-patches
mailing list