I am porting a Windows library to Android (with the GNU Standard C++ Library option, libstdc++-v3) and there seem to be numerous naming differences between the VC and GNU libraries, e.g.:
_stricmpis calledstrcasecmpinstead_unlinkis calledunlink_scalbis calledscalbn_finiteis calledisfinite_isnanis calledisnan_itoaanditoado not seem to exist in GNU C++atoidoes exist, but notatoi64
The documentation of both VC and GNU libraries implies that they implement “ISO” C++, for example I can get a few warnings out of VC2008 for not using “ISO C++” names, such as this one: “warning C4996: ‘itoa’: The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _itoa.” Similarly GNU’s manual says “The GNU Standard C++ Library v3 is an ongoing project to implement the ISO 14882 Standard C++ library”.
So how do the libraries end up with these different names? How can I tell which names are more “standard”?
Also, is there an index of libstdc++-v3 anywhere, i.e. a simple list of all functions in the library? I can only find a manual and the “source documentation” which does not appear to offer a list of functions.
This has very little to do with the C++ standard library. It has more to do with C99 and POSIX.
strcasecmpis a POSIX function that libstdc++ happens to implement. msvcrt typically stays at arm’s length from POSIX.unlinkis similar—it’s a POSIX function.scalbnis the name of the function in the C99 standard. MSVC doesn’t support C99. However,scalbnis part of C++11, so I would expect it to show up in msvcrt eventually.isfiniteandisnanare both C99.itoais neither C99 nor POSIX. It’s a strange beast that just shows up in the night.I’ll also point out what several others have pointed out: it’s technically more correct to prefix any functions in the standard library that are actually non-standard with an underscore. That’s the reason for the proliferation of underscores in msvcrt.