I am trying to compile ustl C++ library with MinGW GCC compiler on Windows 10.
The 41st line in the C++ header below was able to solve thanks to this answer, but there is a problem at line 43. How should I solve it?
https://github.com/msharov/ustl/blob/master/fstream.h#L41
// int ioctl (const char* rname, int request, long argument = 0); // orig
int ioctl (const char* rname, int request, long argument = 0u);
inline int ioctl (const char* rname, int request, int argument) { return fstream::ioctl (rname, request, long(argument)); }
inline int ioctl (const char* rname, int request, void* argument) { return fstream::ioctl (rname, request, intptr_t(argument)); }
MinGW GCC compiler (10.3.0 (Rev5, Built by MSYS2 project)) error message:
fstream.h:43:132: error: call of overloaded 'ioctl(const char*&, int&, uintptr_t)' is ambiguous
43 | inline int ioctl (const char* rname, int request, void* argument) { return fstream::ioctl (rname, request, uintptr_t(argument)); }
-- Edit: Thanks for the hint. With another answer, below code works for me:
https://github.com/msharov/ustl/blob/master/fstream.h#L43
// ... intptr_t(argument)); // orig
*((long*)(argument)));