I am writing a cross platform socket library and will use the pimpl idiom so that users include'ing headers for the library will not need to worry about operating system specific issues.
So, for example a file portable.hpp
would be like this:
// forward declare pimpl
struct socketimpl;
class portable
{
public:
private:
socketimpl *pimpl_; // hide OS specific details
};
But how do I name the implementation files.
I could have portablewin.cpp
, portablelinux.cpp
etc.
Would I then have specific folders for the different operating systems supported?
A folder structure like this:
/makefile
/include/
/src/unix/
/src/windows/
Then there would be a standard makefile which would include a helper makefile which would be have the specific files etc for each supported platform.
Then use an OS specific makefile for each OS?
Is that the best plan? Or any other ideas?