Skip to content

Instantly share code, notes, and snippets.

@aras-p
Created May 13, 2018 07:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aras-p/bdb8473bfbad532d6cf406047f06d956 to your computer and use it in GitHub Desktop.
Save aras-p/bdb8473bfbad532d6cf406047f06d956 to your computer and use it in GitHub Desktop.
asio vs windows
// 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