[patches] [PATCH] Fix FreeBSD build

Konstantin Osipov kostja at tarantool.org
Wed Mar 7 15:58:27 MSK 2018


* Konstantin Belyavskiy <k.belyavskiy at tarantool.org> [18/03/07 13:58]:
> As I checked _POSIX_C_SOURCE yesterday, it doesn't work on OSX.
> Also we are already using _GNU_SOURCE flag in 
> src/box/lua/info.c and i n various third-party modules.

BTW, this is a good proof why this approach is broken.

If you look at the original patch, git show d00ebc91, you'll see
that gnu source was added to compile a piece of code which is no
longer there. The code is now gone, and the gnuism is stuck in the
source forever. 

If you look at the patch itself, it was a yet another quick fix
made in a rush and most likely pushed without thorough
consideration.

Please don't follow that path.

We should either make a decision to use getline() and make a
compatibility wrapper in third_party/compat, or get rid of it.

> I can use cmake, but again I think there are two options:
> 1. Using getline with _GNU_SOURCE flag as in man example.
> 2. Get rid of getline

Yes, please get rid of getline(). You can make a compatibility
wrapper if you like, in third_party/compat, which is the same as
getting rid of it. You can use fscanf(). You can dig up how to
properly make POSIX standard api available on Mac OS X and add
this define to trivia/config.h, so that we never again have an
issue with POSIX functions on MAC OS X. There are so many sound
alternatives, please just do one of them.

-- 
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