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
876 stars 90 forks source link

"fbe.h" windows header file problem hope to modify #67

Closed coretimes closed 2 years ago

coretimes commented 2 years ago

To resolve the conflict between WinSock2.h and windows.h

update FastBinaryEncoding\source\generator_cpp.cpp

change: line 196

#elif defined(_WIN32) || defined(_WIN64)
#include <windows.h>
#undef DELETE
#undef ERROR
#undef HOST_NOT_FOUND
#undef Yield
#undef min
#undef max
#undef uuid_t
#endif

to:

#elif defined(_WIN32) || defined(_WIN64)
//#include <windows.h>
#undef DELETE
#undef ERROR
#undef HOST_NOT_FOUND
#undef Yield
#undef min
#undef max
#undef uuid_t
#endif

inser line 6334:

    // Generate win
    WriteLine();
    WriteLineIndent("#if defined(_WIN32) || defined(_WIN64)");
    WriteLineIndent("#include <windows.h>");
    WriteLineIndent("#undef uuid_t");
    WriteLineIndent("#endif");

std::max -> (std::max)

chronoxor commented 2 years ago

Fixed, please check on your side!

coretimes commented 2 years ago

Fixed, please check on your side!

The above modification is a bit problematic, I finally solved the conflict problem by using WIN32_LEAN_AND_MEAN