Define _BSD_SOURCE macro for getline on FreeBSD
authorPeter <necmon@yahoo.com>
Thu, 7 Jul 2016 18:27:46 +0000 (21:27 +0300)
committerPeter <necmon@yahoo.com>
Thu, 7 Jul 2016 18:28:13 +0000 (21:28 +0300)
commitfa11bad1f882f54db7a698f418f5dd6dae4aaa51
tree892c8a0fac8b8dba800da542c82f9338ed17c2b3
parentfe68c365c61f8dd84afc03db716edd31fd153d98
Define _BSD_SOURCE macro for getline on FreeBSD

According to manpage:

https://www.freebsd.org/cgi/man.cgi?query=getline&apropos=0&sektion=0&manpath=FreeBSD+8.2-RELEASE&format=html

FreeBSD requires either `_WITH_GETLINE`, `_BSD_SOURCE` or `_GNU_SOURCE`
defined to make `getline` available via `<stdio.h>`.

By adding a definition in CMake is the cleanest way as otherwise we get:

> macro name is a reserved identifier

and muting it with `pragma` will be a messier solution
(e.g. dotnet/corefx@ba88726).

Commit migrated from https://github.com/dotnet/corefx/commit/03ac51a99d963f5324eb1b749d3e425d21ec2115
src/libraries/Native/CMakeLists.txt