Forwarded from https://trac.videolan.org/vlc/ticket/3503:
| gmake[4]: Entering directory `/usr/home/igor/vlc-1.1.0-pre1/src'
| CC config/libvlccore_la-dirs_xdg.lo
| config/dirs_xdg.c: In function 'config_GetTypeDir': config/dirs_xdg.c:141: | error: implicit declaration of function 'getline'
| FreeBSD have not getline().
getline() and getdelim() are specified by POSIX here:
http://www.opengroup.org/onlinepubs/9699919799/functions/getline.html
>How-To-Repeat:
C-compile the following test case:
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
char *line = NULL;
size_t linesize = 0;
ssize_t linelen;
while ((linelen = getline(&line, &linesize, stdin)) != -1)
fwrite(line, 1, linelen, stdout);
free(line);
if (ferror(stdin))
{
perror("Standard input");
return 1;
}
return 0;
}
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
From: Andrey Chernov <ac...@nagual.pp.ru>
To: =?koi8-r?Q?R=E9mi?= Denis-Courmont <r...@videolan.org>
Cc: freebsd-gn...@FreeBSD.ORG
Subject: Re: standards/145517: POSIX getline() missing
Date: Fri, 9 Apr 2010 00:10:01 +0400
> http://www.opengroup.org/onlinepubs/9699919799/functions/getline.html
> >How-To-Repeat:
> C-compile the following test case:
man 3 getline
(in FreeBSD-current for sure)
--
http://ache.pp.ru/
From: David Schultz <d...@FreeBSD.ORG>
To: RXmi Denis-Courmont <r...@videolan.org>
Cc: freebsd-gn...@FreeBSD.ORG
Subject: Re: standards/145517: POSIX getline() missing
Date: Fri, 9 Apr 2010 16:43:40 -0400
On Thu, Apr 08, 2010, RXmi Denis-Courmont wrote:
> VLC media player compilation reportedly fails due to getline() not being defined.
The relevant caveat here is the one described in the COMPATIBILITY
section of the manpage:
COMPATIBILITY
Many application writers used the name getline before the getline() func-
tion was introduced in IEEE Std 1003.1 ("POSIX.1"), so a prototype is not
provided by default in order to avoid compatibility problems. Applica-
tions that wish to use the getline() function described herein should
either request a strict IEEE Std 1003.1-2008 ("POSIX.1") environment by
defining the macro _POSIX_C_SOURCE to the value 200809 or greater, or by
defining the macro _WITH_GETLINE, prior to the inclusion of <stdio.h>.
For compatibility with GNU libc, defining either _BSD_SOURCE or
_GNU_SOURCE prior to the inclusion of <stdio.h> will also make getline()
available.