seanmiddleditch / libtelnet

Simple RFC-complient TELNET implementation as a C library.
http://github.com/seanmiddleditch/libtelnet
Other
329 stars 133 forks source link

Fix to compile with Visual C++ 2015 #27

Closed egtra closed 7 years ago

egtra commented 8 years ago

Some fixes for Visual C++ 2015.

thefallentree commented 8 years ago

cool

seanmiddleditch commented 8 years ago

I'm against the changing from Unicode to Multibyte. The latter should be considered deprecated.

I'm also unsure about the conditions that were added for the macros. The compiler version is not directly related to the stdlib version, e.g. you can use mingw to compile using Microsoft's headers.

egtra commented 7 years ago

Thank you for response. I agree it.

But condition for #define snprintf _snprintf is needed for Visual C++ 2015. Because Visual C++ 2015 generates following compile error if there is #define snprintf _snprintf.

1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1927): fatal error C1189: #error: Macro definition of snprintf conflicts with Standard Library function declaration

e.g. you can use mingw to compile using Microsoft's headers.

Therefore I use _UCRT instead _MSC_VER for condition.

seanmiddleditch commented 7 years ago

Looks much better. I forgot to ask the first time: could you please rebase this onto the develop branch? Thanks!

egtra commented 7 years ago

Sure. I rebased it. Thank you too!