Recently, I was learning about networking in C++ and I found boost.asio
which is a cross platform library, and then I got a thought about how this library is a cross platform since Windows provides different library for networking and even mac also,
so how its function works on different machines, does cross platform libraries create their own functions for this purpose or they contain different private functions of different machine's logics and provides public functions which then during compiling time check for on which machine that codes are compiling and change our written functions with machines defined libraries.
For example
//Operations for windows
Private void WindowsFunc
{ code }
//Operations for mac
Private void MacFunc
{ code }
//library's functions
Public void Do
{
//Performs different operations
//for different machines
If (windows)
WindowsFunc
else if (Mac)
MacFunc
}
It could be a solution may be