Fix getdelim and getline having the wrong external linkage.
This commit is contained in:
parent
8a7a0db8c7
commit
8d2c585479
|
@ -26,7 +26,7 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
ssize_t getdelim(char** lineptr, size_t* n, int delim, FILE* fp)
|
extern "C" ssize_t getdelim(char** lineptr, size_t* n, int delim, FILE* fp)
|
||||||
{
|
{
|
||||||
if ( !lineptr || (*lineptr && !n) || !fp ) { errno = EINVAL; return -1; }
|
if ( !lineptr || (*lineptr && !n) || !fp ) { errno = EINVAL; return -1; }
|
||||||
const size_t DEFAULT_BUFSIZE = 32UL;
|
const size_t DEFAULT_BUFSIZE = 32UL;
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
ssize_t getline(char** lineptr, size_t* n, FILE* fp)
|
extern "C" ssize_t getline(char** lineptr, size_t* n, FILE* fp)
|
||||||
{
|
{
|
||||||
return getdelim(lineptr, n, '\n', fp);
|
return getdelim(lineptr, n, '\n', fp);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue