Skip to content
This repository has been archived by the owner on Nov 27, 2024. It is now read-only.

Fix to compile with Visual C++ 2015 #27

Merged
merged 9 commits into from
Aug 21, 2017

Conversation

egtra
Copy link
Contributor

@egtra egtra commented Nov 7, 2016

Some fixes for Visual C++ 2015.

  • Add #undef environ. Because environ is defined (*__p__environ()) in <stdlib.h>.
  • Remove snprintf macro. Visual C++ 2015 has snprintf.
  • Remove ECONNRESET macro. This is copy from libtelnet-proxy.c to libtelnet-chatd.c.

@thefallentree
Copy link
Contributor

cool

@seanmiddleditch
Copy link
Owner

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
Copy link
Contributor Author

egtra commented Dec 3, 2016

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
Copy link
Owner

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

@egtra
Copy link
Contributor Author

egtra commented Dec 10, 2016

Sure. I rebased it. Thank you too!

@seanmiddleditch seanmiddleditch merged commit 2b645e9 into seanmiddleditch:master Aug 21, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants