Winsock2.h must be included before anything that includes Winsock.h.

This commit is contained in:
Martin Ling 2013-12-22 14:50:11 +00:00
parent 5321ac6b52
commit 589edd9b81
1 changed files with 5 additions and 4 deletions

View File

@ -17,7 +17,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifdef _WIN32
#define _WIN32_WINNT 0x0501 #define _WIN32_WINNT 0x0501
#include <winsock2.h>
#include <ws2tcpip.h>
#endif
#include "libsigrok.h" #include "libsigrok.h"
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
@ -25,10 +29,7 @@
#include <glib.h> #include <glib.h>
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#ifdef _WIN32 #ifndef _WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
#else
#include <sys/socket.h> #include <sys/socket.h>
#include <netinet/in.h> #include <netinet/in.h>
#include <arpa/inet.h> #include <arpa/inet.h>