chronoxor / FastBinaryEncoding

Fast Binary Encoding is ultra fast and universal serialization solution for C++, C#, Go, Java, JavaScript, Kotlin, Python, Ruby, Swift
https://chronoxor.github.io/FastBinaryEncoding
MIT License
827 stars 86 forks source link

Is there a specific reason to undef HOST_NOT_FOUND? #94

Closed MrJia1997 closed 10 months ago

MrJia1997 commented 10 months ago

Just wonder. Is there a specific reason to undef HOST_NOT_FOUND? What's the problem if it's still defined?

https://github.com/chronoxor/FastBinaryEncoding/blob/b1f5223846c76ae909d720a83099fff1ffdd5da6/proto/fbe.h#L44

chronoxor commented 10 months ago

Quick answer - we have HOST_NOT_FOUND duplicate in one of our projects and we want a quick solution for this issue 😊(https://emojipedia.org/smiling-face-with-smiling-eyes) image

chronoxor commented 10 months ago

But other definitions from Winapi.h must be undefined anyway, because they are duplicates even with std libraries (e.g. std::min, std::max):

undef DELETE

undef ERROR

undef Yield

undef min

undef max

undef uuid_t

MrJia1997 commented 10 months ago

Thank you for your prompt response! The reason why I ask this is that HOST_NOT_FOUND is also used in netdb.h on Linux, and undefine it will cause some other libraries to not work, e.g., Asio.

chronoxor commented 10 months ago

Probably I'll remove it soon. Thanks for pointing on this!

chronoxor commented 10 months ago

Fixed in FBE 1.14.5.0