- Init cin/cout/clog as early as possible using compiler specific attributes
- Set unitbuf for cerr as required by standard
- Move the streambuf out into own header and make the read/write function (to console) mockable
- Split test into small, named functions
(At least) the Android NDKs stdio.h does define fseeko but not if __USE_FILE_OFFSET64
is defined and the API level is below 24.
As the usage of this macro was inconsistent between the check and the
use LFS could be wrongly detected leading to a compile failure later.
Fixes#111
The macro based solution has the downside of cluttering the global
namespace and requires duplication in both config headers.
Additionally ftello64 might not be available on some system where the
define check succeeds.
This solution uses a cpp file to wrap the functions adding enhanced
exists checks and additionally checking for overflow returning -1
(error) in that case as mandated by the standard for the filebuf
functions.
Finally a configure check determines general availability of LFS and if
it is not available the standard fseek/ftell functions are used.
That flag forces ISO conformance removing the declarations of the
required _w* functions.
Move the implementations using those into source files and undef
__STRICT_ANSI__ inside that file
Also allows to not use the *_s functions on MSVC as
_CRT_SECURE_NO_WARNINGS can be safely define inside the cpp files.