mirror of
https://github.com/dlang/phobos.git
synced 2025-05-01 15:40:36 +03:00
std.stdio: Deprecate extern(C) getdelim
The publicly available `extern(C)` binding for `getdelim` in `std.stdio` has been deprecated. Any code that still needs it can import the symbol from `core.sys.posix.stdio` in druntime instead.
This commit is contained in:
parent
f78fd811f0
commit
2db474be28
2 changed files with 7 additions and 5 deletions
|
@ -1,5 +1,5 @@
|
||||||
Deprecate `std.stdio.getline`
|
Deprecate `std.stdio.getdelim` and `std.stdio.getline`
|
||||||
|
|
||||||
The publicly available `extern(C)` binding for `getline` in `std.stdio` has
|
The publicly available `extern(C)` bindings for `getdelim` and `getline` in
|
||||||
been deprecated. Any code that still needs it can import the symbol from
|
`std.stdio` have been deprecated. Any code that still needs it can import the
|
||||||
`core.sys.posix.stdio` in druntime instead.
|
symbol from `core.sys.posix.stdio` in druntime instead.
|
||||||
|
|
|
@ -256,6 +256,8 @@ static if (__traits(compiles, core.sys.posix.stdio.getdelim))
|
||||||
{
|
{
|
||||||
extern(C) nothrow @nogc
|
extern(C) nothrow @nogc
|
||||||
{
|
{
|
||||||
|
// @@@DEPRECATED_2.104@@@
|
||||||
|
deprecated("To be removed after 2.104. Use core.sys.posix.stdio.getline instead.")
|
||||||
ptrdiff_t getdelim(char**, size_t*, int, FILE*);
|
ptrdiff_t getdelim(char**, size_t*, int, FILE*);
|
||||||
|
|
||||||
// @@@DEPRECATED_2.104@@@
|
// @@@DEPRECATED_2.104@@@
|
||||||
|
@ -5497,7 +5499,7 @@ private size_t readlnImpl(FILE* fps, ref char[] buf, dchar terminator, File.Orie
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto s = getdelim(&lineptr, &n, terminator, fps);
|
auto s = core.sys.posix.stdio.getdelim(&lineptr, &n, terminator, fps);
|
||||||
if (s < 0)
|
if (s < 0)
|
||||||
{
|
{
|
||||||
if (ferror(fps))
|
if (ferror(fps))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue