c-smile / sciter-sdk

Sciter is an embeddable HTML/CSS/scripting engine
http://sciter.com
Other
2.11k stars 224 forks source link

Question: #define _WINSOCKAPI_ within Sciter (and Boost.Asio) #213

Closed anthony-ozdemir closed 2 years ago

anthony-ozdemir commented 2 years ago

Hi,

I'm currently trying to build Sciter with Boost.Asio (https://www.boost.org/).

I saw the following lines on couple of Sciter header files:

#if defined(_WIN32)
  #ifndef WIN32_LEAN_AND_MEAN
    #define WIN32_LEAN_AND_MEAN
  #endif
  #define _WINSOCKAPI_
  #include <windows.h>
#endif

It looks like Sciter doesn't use winsocks. So in this case, what is the purpose behind _WINSOCKAPI_definition?

So long as WIN32_LEAN_AND_MEAN is defined, then "winsock.h" won't be included anyway.

Problem is Asio also contains the following line of code and doesn't compile.

# if defined(_WINSOCKAPI_) && !defined(_WINSOCK2API_)
#  error WinSock.h has already been included
# endif // defined(_WINSOCKAPI_) && !defined(_WINSOCK2API_)

I solved the issue by including Boost.Asio before Sciter but I'm still concerned about internals of Sciter.

Could someone confirm that Sciter doesn't use winsock.h and #define _WINSOCKAPI_ is not necessary?

c-smile commented 2 years ago

Yeah, those are remnants of previous versions.

I've removed them here