Created
May 13, 2018 07:45
-
-
Save aras-p/bdb8473bfbad532d6cf406047f06d956 to your computer and use it in GitHub Desktop.
asio vs windows
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// will this compile on windows? haha nope | |
// why? because asio transitively includes winsock2.h somewhere, which includes windows.h somewhere, | |
// which hijacks SendMessage to be SendMessageA or SendMessageW (and also means hundreds of thousands of lines | |
// of header includes, but that's just compilation "throughput" issue, not an error by itself) | |
// message.h file | |
struct MessageThing | |
{ | |
void SendMessage(int foo); | |
}; | |
// message.cpp file | |
#include "message.h" | |
#include <asio.hpp> // let's say we need Boost asio for something | |
void MessageThing::SendMessage(int foo) | |
{ | |
// whatever | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment