Path: blob/master/thirdparty/miniupnpc/src/miniupnpc_socketdef.h
9904 views
/* $Id: miniupnpc_socketdef.h,v 1.1 2018/03/13 23:44:10 nanard Exp $ */1/* Miniupnp project : http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/2* Author : Thomas Bernard3* Copyright (c) 2018 Thomas Bernard4* This software is subject to the conditions detailed in the5* LICENCE file provided within this distribution */6#ifndef MINIUPNPC_SOCKETDEF_H_INCLUDED7#define MINIUPNPC_SOCKETDEF_H_INCLUDED89#ifdef _WIN321011#define ISINVALID(s) (INVALID_SOCKET==(s))1213#else1415#ifndef SOCKET16#define SOCKET int17#endif18#ifndef SSIZE_T19#define SSIZE_T ssize_t20#endif21#ifndef INVALID_SOCKET22#define INVALID_SOCKET (-1)23#endif24#ifndef ISINVALID25#define ISINVALID(s) ((s)<0)26#endif2728#endif2930#ifdef _MSC_VER31#define MSC_CAST_INT (int)32#else33#define MSC_CAST_INT34#endif3536/* definition of PRINT_SOCKET_ERROR */37#ifdef _WIN3238#define PRINT_SOCKET_ERROR(x) fprintf(stderr, "Socket error: %s, %d\n", x, WSAGetLastError());39#else40#define PRINT_SOCKET_ERROR(x) perror(x)41#endif4243#endif /* MINIUPNPC_SOCKETDEF_H_INCLUDED */444546