[Live-devel] MSVC 2005+ compilation

maks maksqwe1 at ukr.net
Tue Dec 17 09:01:48 PST 2013


When I compile liveMedia using MSVC 2012 I got error:
"mp3streamstate.cpp(412): error C4996: 'fileno': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _fileno. See online help for details"

---------------
MSDN(http://msdn.microsoft.com/en-us/library/ms235384.aspx):
The following POSIX names for functions are deprecated. In most cases, prepending an underscore character gives the standard equivalent name. Note that some functions have more secure versions ("_s" suffix).

This POSIX function is deprecated beginning in Visual C++ 2005. Use the ISO C++ conformant _fileno instead.
---------------

mp3streamstate.cpp has:
#if defined(__WIN32__) || defined(_WIN32)
#define snprintf _snprintf
#endif

Fix, add check for msvc version:
#if defined(__WIN32__) || defined(_WIN32)
#define snprintf _snprintf
#if _MSC_VER >= 1400 // 1400 == vs2005
#define fileno _fileno
#endif
#endif





More information about the live-devel mailing list