file_stdio should add missing std namespace to FILE type
In Boost Beast FILE is used without std namespace, but the C++ header is included. Thus is does not compile for some operating systems.
boost/beast/core/file_stdio.hpp:29:5: error: 'FILE' does not name a type
FILE* f_ = nullptr;
^
A change from
#include <cstdio>
to
#include <stdio.h>
would compile, but the C include is deprecated in C++. Therefore it is recommended to replace FILE with std::FILE. There seems to be 7 occurrences of FILE: 4 of them in file_stdio.hpp and 3 in the corresponding file_stdio.ipp.
@spdw Interesting. Do you know how well supported std::FILE is? We're still testing against clang 3.
Would you be able to recommend a compiler/stdlib combination where this fails so I can add it to our test suite?
A fix for this is already in the works, see: https://github.com/boostorg/beast/pull/1906 and https://github.com/vinniefalco/beast/commits/embarcadero
A fix for this is already in the works, see: #1906 and https://github.com/vinniefalco/beast/commits/embarcadero
To me it looks like the header file is adapted only, the ipp file on that branch still lacks the std:: prefix for FILE.