I am currently developing a cross-platform C application . Is there any compiler macro that is only defined at compile time on Windows, so I can #ifdefspecify some specific Windows * include?
A typical example is the choice between WinSock and Berkeley socket headers:
#ifdef _WINDOWS
#include <winsock.h>
#else
#include <sys/socket.h>
#include <netinet/in.h>
#include <sys/un.h>
#include <arpa/inet.h>
#include <netdb.h>
#endif
So I'm looking for something like a _WINDOWS macro .
source
share