diff --git a/deps/sdl2_net/include/SDL2/SDL_net.h b/deps/sdl2_net/include/SDL2/SDL_net.h index bd5ec7f7..16c545c9 100644 --- a/deps/sdl2_net/include/SDL2/SDL_net.h +++ b/deps/sdl2_net/include/SDL2/SDL_net.h @@ -1,6 +1,6 @@ /* SDL_net: An example cross-platform network library for use with SDL - Copyright (C) 1997-2016 Sam Lantinga + Copyright (C) 1997-2022 Sam Lantinga Copyright (C) 2012 Simeon Maxein This software is provided 'as-is', without any express or implied @@ -20,10 +20,8 @@ 3. This notice may not be removed or altered from any source distribution. */ -/* $Id$ */ - -#ifndef _SDL_NET_H -#define _SDL_NET_H +#ifndef SDL_NET_H_ +#define SDL_NET_H_ #ifdef WITHOUT_SDL #include @@ -57,8 +55,8 @@ extern "C" { /* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL */ #define SDL_NET_MAJOR_VERSION 2 -#define SDL_NET_MINOR_VERSION 0 -#define SDL_NET_PATCHLEVEL 1 +#define SDL_NET_MINOR_VERSION 2 +#define SDL_NET_PATCHLEVEL 0 /* This macro can be used to fill a version structure with the compile-time * version of the SDL_net library. @@ -70,34 +68,85 @@ extern "C" { (X)->patch = SDL_NET_PATCHLEVEL; \ } -/* This function gets the version of the dynamically linked SDL_net library. - it should NOT be used to fill a version structure, instead you should - use the SDL_NET_VERSION() macro. +#if SDL_NET_MAJOR_VERSION < 3 && SDL_MAJOR_VERSION < 3 +/** + * This is the version number macro for the current SDL_net version. + * + * In versions higher than 2.9.0, the minor version overflows into + * the thousands digit: for example, 2.23.0 is encoded as 4300. + * This macro will not be available in SDL 3.x or SDL_net 3.x. + * + * Deprecated, use SDL_NET_VERSION_ATLEAST or SDL_NET_VERSION instead. + */ +#define SDL_NET_COMPILEDVERSION \ + SDL_VERSIONNUM(SDL_NET_MAJOR_VERSION, SDL_NET_MINOR_VERSION, SDL_NET_PATCHLEVEL) +#endif /* SDL_NET_MAJOR_VERSION < 3 && SDL_MAJOR_VERSION < 3 */ + +/** + * This macro will evaluate to true if compiled with SDL_net at least X.Y.Z. + */ +#define SDL_NET_VERSION_ATLEAST(X, Y, Z) \ + ((SDL_NET_MAJOR_VERSION >= X) && \ + (SDL_NET_MAJOR_VERSION > X || SDL_NET_MINOR_VERSION >= Y) && \ + (SDL_NET_MAJOR_VERSION > X || SDL_NET_MINOR_VERSION > Y || SDL_NET_PATCHLEVEL >= Z)) + +/** + * Query the version of SDL_net that the program is linked against. + * + * This function gets the version of the dynamically linked SDL_net library. + * This is separate from the SDL_NET_VERSION() macro, which tells you what + * version of the SDL_net headers you compiled against. + * + * This returns static internal data; do not free or modify it! + * + * \returns a pointer to the version information. + * + * \since This function is available since SDL_net 2.0.0. */ extern DECLSPEC const SDLNet_version * SDLCALL SDLNet_Linked_Version(void); -/* Initialize/Cleanup the network API - SDL must be initialized before calls to functions in this library, - because this library uses utility functions from the SDL library. -*/ -extern DECLSPEC int SDLCALL SDLNet_Init(void); +/** + * Initialize SDL_net. + * + * You must successfully call this function before it is safe to call any + * other function in this library, with one exception: a human-readable error + * message can be retrieved from SDLNet_GetError() if this function fails. + * + * SDL must be initialized before calls to functions in this library, because + * this library uses utility functions from the SDL library. + * + * It is safe to call this more than once; the library keeps a counter of init + * calls, and decrements it on each call to SDLNet_Quit, so you must pair your + * init and quit calls. + * + * \returns 0 on success, -1 on error. + * + * \since This function is available since SDL_net 2.0.0. + */ +extern DECLSPEC int SDLCALL SDLNet_Init(void); + +/** + * Deinitialize SDL_net. + * + * You must call this when done with the library, to free internal resources. + * It is safe to call this when the library isn't initialized, as it will just + * return immediately. + * + * Once you have as many quit calls as you have had successful calls to + * SDLNet_Init, the library will actually deinitialize. + * + * \since This function is available since SDL_net 2.0.0. + */ extern DECLSPEC void SDLCALL SDLNet_Quit(void); -/***********************************************************************/ -/* IPv4 hostname resolution API */ -/***********************************************************************/ + +/* IPv4 hostname resolution API... */ typedef struct { Uint32 host; /* 32-bit IPv4 host address */ Uint16 port; /* 16-bit protocol port */ } IPaddress; -/* Resolve a host name and port to an IP address in network form. - If the function succeeds, it will return 0. - If the host couldn't be resolved, the host portion of the returned - address will be INADDR_NONE, and the function will return -1. - If 'host' is NULL, the resolved host will be set to INADDR_ANY. - */ #ifndef INADDR_ANY #define INADDR_ANY 0x00000000 #endif @@ -110,69 +159,179 @@ typedef struct { #ifndef INADDR_BROADCAST #define INADDR_BROADCAST 0xFFFFFFFF #endif + +/** + * Resolve a host name and port to an IP address in network form. + * + * If `host` is NULL, the resolved host will be set to `INADDR_ANY`. + * + * If the host couldn't be resolved, the host portion of the returned address + * will be INADDR_NONE, and the function will return -1. + * + * \param address to be filled in with the resolved address and port. + * \param host the hostname to lookup (like "libsdl.org") + * \param port the port intended to be connected to, to fill into address. + * \returns zero on success, -1 on error. + * + * \since This function is available since SDL_net 2.0.0. + */ extern DECLSPEC int SDLCALL SDLNet_ResolveHost(IPaddress *address, const char *host, Uint16 port); -/* Resolve an ip address to a host name in canonical form. - If the ip couldn't be resolved, this function returns NULL, - otherwise a pointer to a static buffer containing the hostname - is returned. Note that this function is not thread-safe. -*/ +/** + * Resolve an IP address to a host name in canonical form. + * + * If the IP couldn't be resolved, this function returns NULL, otherwise a + * pointer to a static buffer containing the hostname is returned. + * + * **Warning**: This function is not thread-safe! + * + * \param ip the IP address to resolve into a hostname. + * + * \since This function is available since SDL_net 2.0.0. + */ extern DECLSPEC const char * SDLCALL SDLNet_ResolveIP(const IPaddress *ip); -/* Get the addresses of network interfaces on this system. - This returns the number of addresses saved in 'addresses' +/** + * Get the addresses of network interfaces on this system. + * + * \param addresses where to store the returned information. + * \param maxcount the number of results that can be stored at `addresses` + * \returns the number of addresses saved in `addresses` + * + * \since This function is available since SDL_net 2.0.0. */ extern DECLSPEC int SDLCALL SDLNet_GetLocalAddresses(IPaddress *addresses, int maxcount); -/***********************************************************************/ -/* TCP network API */ -/***********************************************************************/ + +/* TCP network API */ typedef struct _TCPsocket *TCPsocket; -/* Open a TCP network socket - If ip.host is INADDR_NONE or INADDR_ANY, this creates a local server - socket on the given port, otherwise a TCP connection to the remote - host and port is attempted. The address passed in should already be - swapped to network byte order (addresses returned from - SDLNet_ResolveHost() are already in the correct form). - The newly created socket is returned, or NULL if there was an error. -*/ +/** + * Open a TCP network socket. + * + * If `ip->host` is INADDR_NONE or INADDR_ANY, this creates a local server + * socket on the given port, otherwise a TCP connection to the remote host and + * port is attempted. The address passed in should already be swapped to + * network byte order (addresses returned from SDLNet_ResolveHost() are + * already in the correct form). + * + * \param ip The address to open a connection to (or to host a server on). + * \returns the newly created socket, or NULL if there was an error. + * + * \since This function is available since SDL_net 2.0.0. + * + * \sa SDLNet_TCP_Close + */ extern DECLSPEC TCPsocket SDLCALL SDLNet_TCP_Open(IPaddress *ip); -/* Accept an incoming connection on the given server socket. - The newly created socket is returned, or NULL if there was an error. -*/ +/** + * Accept an incoming connection on the given server socket. + * + * `server` must be a socket returned by SDLNet_TCP_Open with an address of + * INADDR_NONE or INADDR_ANY (a "server socket"). Other sockets do not accept + * connections. + * + * \param server the server socket to accept a connection on. + * \returns the newly created socket, or NULL if there was an error. + * + * \since This function is available since SDL_net 2.0.0. + */ extern DECLSPEC TCPsocket SDLCALL SDLNet_TCP_Accept(TCPsocket server); -/* Get the IP address of the remote system associated with the socket. - If the socket is a server socket, this function returns NULL. -*/ +/** + * Get the IP address of the remote system associated with the socket. + * + * If the socket is a server socket, this function returns NULL. + * + * This returns a pointer to internal memory; you should not modify or free + * it, and should assume it's only valid until the socket is given to + * SDLNet_TCP_Close. + * + * \param sock the socket to query. + * \returns the address information for the socket. + * + * \since This function is available since SDL_net 2.0.0. + */ extern DECLSPEC IPaddress * SDLCALL SDLNet_TCP_GetPeerAddress(TCPsocket sock); -/* Send 'len' bytes of 'data' over the non-server socket 'sock' - This function returns the actual amount of data sent. If the return value - is less than the amount of data sent, then either the remote connection was - closed, or an unknown socket error occurred. -*/ -extern DECLSPEC int SDLCALL SDLNet_TCP_Send(TCPsocket sock, const void *data, - int len); +/** + * Send data over a non-server socket. + * + * `sock` must be a valid socket that was created by SDLNet_TCP_Open with a + * specific address, or SDLNet_TCP_Accept. + * + * This function sends `len` bytes, pointed to by `data` over the non-server + * socket `sock`. + * + * This function returns the actual amount of data sent. If the return value + * is less than the amount of data sent, then either the remote connection was + * closed, or an unknown socket error occurred. + * + * This function may block! + * + * \param sock the socket to send data to. + * \param data a pointer to the bytes to send. + * \param len the number of bytes, pointed to by `data`, to transmit. + * \returns number of bytes sent, which might be less if there was a problem + * or connection failure. If the socket is invalid, this function can + * return -1, but in valid uses it'll return >= 0. + * + * \since This function is available since SDL_net 2.0.0. + * + * \sa SDLNet_TCP_Recv + */ +extern DECLSPEC int SDLCALL SDLNet_TCP_Send(TCPsocket sock, const void *data, int len); -/* Receive up to 'maxlen' bytes of data over the non-server socket 'sock', - and store them in the buffer pointed to by 'data'. - This function returns the actual amount of data received. If the return - value is less than or equal to zero, then either the remote connection was - closed, or an unknown socket error occurred. -*/ +/** + * Receive data from a non-server socket. + * + * `sock` must be a valid socket that was created by SDLNet_TCP_Open with a + * specific address, or SDLNet_TCP_Accept. + * + * Receive up to `maxlen` bytes of data over the non-server socket `sock`, and + * store them in the buffer pointed to by `data`. + * + * This function returns the actual amount of data received. If the return + * value is less than or equal to zero, then either the remote connection was + * closed, or an unknown socket error occurred. + * + * Note that this will return the number of bytes available at the first + * moment the socket is able to see new data. If packets are coming in slowly + * from the network, this might be less data than you expect at a given time. + * + * This function may block! Use SDLNet_CheckSockets() to make sure there is + * data available before calling this function, if you want to avoid blocking. + * + * \param sock the socket to send data to. + * \param data a pointer to where to store received data. + * \param maxlen the maximum number of bytes that can be stored at `data`. + * \returns number of bytes received, which might be less than `maxlen`. + * + * \since This function is available since SDL_net 2.0.0. + * + * \sa SDLNet_TCP_Send + * \sa SDLNet_CheckSockets + */ extern DECLSPEC int SDLCALL SDLNet_TCP_Recv(TCPsocket sock, void *data, int maxlen); -/* Close a TCP network socket */ +/** + * Close a TCP network socket. + * + * All TCP sockets (server and non-server) are deinitialized through this + * function. Call this once you are done with a socket, and assume the handle + * is invalid once you have. + * + * Closing a socket will disconnect any communication and free its resources. + * + * \param sock socket to close. + * + * \since This function is available since SDL_net 2.0.0. + */ extern DECLSPEC void SDLCALL SDLNet_TCP_Close(TCPsocket sock); -/***********************************************************************/ -/* UDP network API */ -/***********************************************************************/ +/* UDP network API */ /* The maximum channels on a a UDP socket */ #define SDLNET_MAX_UDPCHANNELS 32 @@ -189,105 +348,362 @@ typedef struct { IPaddress address; /* The source/dest address of an incoming/outgoing packet */ } UDPpacket; -/* Allocate/resize/free a single UDP packet 'size' bytes long. - The new packet is returned, or NULL if the function ran out of memory. +/** + * Allocate a single UDP packet. + * + * This allocates a packet with `size` bytes of space for payload. + * + * When done with this packet, you can free it with SDLNet_FreePacket. Packets + * can be reused multiple times; you don't have to allocate a new one for each + * piece of data you intend to send. + * + * You can allocate multiple packets at once with SDLNet_AllocPacketV. + * + * \param size the maximum number of bytes of payload this packet will + * contain. + * \returns the new packet, or NULL if the function ran out of memory. + * + * \since This function is available since SDL_net 2.0.0. + * + * \sa SDLNet_ResizePacket + * \sa SDLNet_FreePacket + * \sa SDLNet_AllocPacketV */ extern DECLSPEC UDPpacket * SDLCALL SDLNet_AllocPacket(int size); + + +/** + * Reallocate a UDP packet's payload space. + * + * This takes an existing packet and makes sure it can contain at least + * `newsize` bytes of space for payload. + * + * When done with this packet, you can free it with SDLNet_FreePacket. Packets + * can be used multiple times; you don't have to allocate a new one for each + * piece of data you intend to send. + * + * Please note that on memory allocation failure, this function will leave the + * existing buffer alone, and _will return the original buffer size_. It will + * not return an error value, it'll just leave the packet as it was! + * + * **Warning**: Existing contents of the packet's data are lost when resizing, + * whether you are growing or shrinking the payload space, since SDL_net does + * not realloc the existing data. + * + * \param newsize the new maximum number of bytes of payload this packet will + * contain. + * \returns the new maximum payload size, which will be unchanged from the + * previous if the system ran out of memory. + * + * \since This function is available since SDL_net 2.0.0. + * + * \sa SDLNet_AllocPacket + * \sa SDLNet_FreePacket + */ extern DECLSPEC int SDLCALL SDLNet_ResizePacket(UDPpacket *packet, int newsize); + + +/** + * Dispose of a UDP packet. + * + * This frees both the packet's payload and the packet itself. Once this call + * completes, the packet's pointer is invalid and should not be used anymore. + * + * \param packet the packet to free. + * + * \since This function is available since SDL_net 2.0.0. + * + * \sa SDLNet_AllocPacket + * \sa SDLNet_ResizePacket + */ extern DECLSPEC void SDLCALL SDLNet_FreePacket(UDPpacket *packet); -/* Allocate/Free a UDP packet vector (array of packets) of 'howmany' packets, - each 'size' bytes long. - A pointer to the first packet in the array is returned, or NULL if the - function ran out of memory. +/** + * Allocate a UDP packet vector (array of packets). + * + * This allocates `howmany` packets at once, each `size` bytes long. + * + * You must free the results of this function with SDLNet_FreePacketV, and + * must not free individual packets from this function with SDLNet_FreePacket. + * + * \param howmany the number of packets to allocate. + * \param size the maximum bytes of payload each packet should contain. + * \returns a pointer to the first packet in the array, or NULL if the + * function ran out of memory. + * + * \since This function is available since SDL_net 2.0.0. + * + * \sa SDLNet_FreePacketV */ extern DECLSPEC UDPpacket ** SDLCALL SDLNet_AllocPacketV(int howmany, int size); + + +/** + * Free a UDP packet vector (array of packets). + * + * This frees the results of a previous call to SDLNet_AllocPacketV(), freeing + * both the set of packets and the array that holds them. + * + * It is safe to free a NULL array through here; it's a harmless no-op. + * + * You must not use this to free packets allocated through any function other + * than SDLNet_AllocPacketV(). + * + * \param packetV the results of a call to SDLNet_AllocPacketV(). + * + * \since This function is available since SDL_net 2.0.0. + * + * \sa SDLNet_AllocPacketV + */ extern DECLSPEC void SDLCALL SDLNet_FreePacketV(UDPpacket **packetV); - -/* Open a UDP network socket - If 'port' is non-zero, the UDP socket is bound to a local port. - The 'port' should be given in native byte order, but is used - internally in network (big endian) byte order, in addresses, etc. - This allows other systems to send to this socket via a known port. -*/ +/** + * Open a UDP network socket. + * + * If `port` is non-zero, the UDP socket is bound to a local port. + * + * The `port` should be given in native byte order, but is used internally in + * network (big endian) byte order, in addresses, etc. This allows other + * systems to send to this socket via a known port. + * + * Note that UDP sockets at the platform layer "bind" to a nework port number, + * but SDL_net's UDP sockets also "bind" to a "channel" on top of that, with + * SDLNet_UDP_Bind(). But the term is used for both. + * + * When you are done communicating over the returned socket, you can shut it + * down and free its resources with SDLNet_UDP_Close(). + * + * \param port the UDP port to bind this socket to. + * \returns a new UDP socket, ready to communicate. + * + * \since This function is available since SDL_net 2.0.0. + * + * \sa SDLNet_UDP_Close + * \sa SDLNet_UDP_Bind + */ extern DECLSPEC UDPsocket SDLCALL SDLNet_UDP_Open(Uint16 port); -/* Set the percentage of simulated packet loss for packets sent on the socket. -*/ +/** + * Set the percentage of simulated packet loss for packets sent on the socket. + * + * SDL_net can optionally, at random, drop packets that are being sent and + * received, to simulate bad networking conditions. As these sort of + * conditions can happen in the real world but likely won't between machines + * on the same LAN, you can use this function in testing to make sure your app + * is robust against network problems even on a fast, reliable network. + * + * You probably don't want to use this function outside of local testing. + * + * \param sock the socket to simulate packet loss on. + * \param percent a value from 0 to 100 of likelihood to drop a packet (higher + * the number means more likelihood of dropping. + * + * \since This function is available since SDL_net 2.0.0. + */ extern DECLSPEC void SDLCALL SDLNet_UDP_SetPacketLoss(UDPsocket sock, int percent); -/* Bind the address 'address' to the requested channel on the UDP socket. - If the channel is -1, then the first unbound channel that has not yet - been bound to the maximum number of addresses will be bound with - the given address as it's primary address. - If the channel is already bound, this new address will be added to the - list of valid source addresses for packets arriving on the channel. - If the channel is not already bound, then the address becomes the primary - address, to which all outbound packets on the channel are sent. - This function returns the channel which was bound, or -1 on error. -*/ +/** + * Bind an address to the requested channel on the UDP socket. + * + * Note that UDP sockets at the platform layer "bind" to a nework port number, + * but SDL_net's UDP sockets also "bind" to a "channel" on top of that, with + * SDLNet_UDP_Bind(). But the term is used for both. + * + * If `channel` is -1, then the first unbound channel that has not yet been + * bound to the maximum number of addresses will be bound with the given + * address as it's primary address. + * + * If the channel is already bound, this new address will be added to the list + * of valid source addresses for packets arriving on the channel. If the + * channel is not already bound, then the address becomes the primary address, + * to which all outbound packets on the channel are sent. + * + * \param sock the UDP socket to bind an address to a channel on. + * \param channel the channel of the socket to bind to, or -1 to use the first + * available channel. + * \param address the address to bind to the socket's channel. + * \returns the channel which was bound, or -1 on error. + * + * \since This function is available since SDL_net 2.0.0. + * + * \sa SDLNet_UDP_Unbind + */ extern DECLSPEC int SDLCALL SDLNet_UDP_Bind(UDPsocket sock, int channel, const IPaddress *address); -/* Unbind all addresses from the given channel */ +/** + * Unbind all addresses from the given channel. + * + * Note that UDP sockets at the platform layer "bind" to a nework port number, + * but SDL_net's UDP sockets also "bind" to a "channel" on top of that, with + * SDLNet_UDP_Bind(). But the term is used for both. + * + * \param sock the UDP socket to unbind addresses from a channel on. + * \param channel the channel of the socket to unbind. + * + * \since This function is available since SDL_net 2.0.0. + * + * \sa SDLNet_UDP_Bind + */ extern DECLSPEC void SDLCALL SDLNet_UDP_Unbind(UDPsocket sock, int channel); -/* Get the primary IP address of the remote system associated with the - socket and channel. If the channel is -1, then the primary IP port - of the UDP socket is returned -- this is only meaningful for sockets - opened with a specific port. - If the channel is not bound and not -1, this function returns NULL. +/** + * Get the IP address of the remote system for a socket and channel. + * + * If `channel` is -1, then the primary IP port of the UDP socket is returned + * -- this is only meaningful for sockets opened with a specific port. + * + * If the channel is not bound and not -1, this function returns NULL. + * + * \param sock the UDP socket to unbind addresses from a channel on. + * \param channel the channel of the socket to unbind. + * \returns the address bound to the socket's channel, or + * + * \since This function is available since SDL_net 2.0.0. */ extern DECLSPEC IPaddress * SDLCALL SDLNet_UDP_GetPeerAddress(UDPsocket sock, int channel); -/* Send a vector of packets to the the channels specified within the packet. - If the channel specified in the packet is -1, the packet will be sent to - the address in the 'src' member of the packet. - Each packet will be updated with the status of the packet after it has - been sent, -1 if the packet send failed. - This function returns the number of packets sent. -*/ +/** + * Send a vector of packets to the the channels specified within the packet. + * + * If the channel specified in the packet is -1, the packet will be sent to + * the address in the `src` member of the packet. + * + * Each packet will be updated with the status of the packet after it has been + * sent, -1 if the packet send failed. + * + * This function takes an array of packets but does not need to be allocated + * through SDLNet_AllocPacketV; if you supply your own array of packets you + * allocated individually, that is okay. + * + * **Warning**: UDP is an _unreliable protocol_, which means we can report + * that your packet has been successfully sent from your machine, but then it + * never makes it to its destination when a router along the way quietly drops + * it. If this happens--and this is a common result on the internet!--you will + * not know the packet never made it. Also, packets may arrive in a different + * order than you sent them. Plan accordingly! + * + * **Warning**: The maximum size of the packet is limited by the MTU (Maximum + * Transfer Unit) of the transport medium. It can be as low as 250 bytes for + * some PPP links, and as high as 1500 bytes for ethernet. Different sizes can + * be sent, but the system might split it into multiple transmission fragments + * behind the scenes, that need to be reassembled on the other side (and the + * packet is lost if any fragment is lost in transit). So the less you can + * reasonably send in a single packet, the better, as it will be more reliable + * and lower latency. + * + * \param sock the UDP socket to send packets on. + * \param packets an array of packets to send to the network. + * \param npackets the number of packets in the `packets` array. + * \returns the number of packets successfully sent from this machine. + * + * \since This function is available since SDL_net 2.0.0. + * + * \sa SDLNet_UDP_RecV + */ extern DECLSPEC int SDLCALL SDLNet_UDP_SendV(UDPsocket sock, UDPpacket **packets, int npackets); -/* Send a single packet to the specified channel. - If the channel specified in the packet is -1, the packet will be sent to - the address in the 'src' member of the packet. - The packet will be updated with the status of the packet after it has - been sent. - This function returns 1 if the packet was sent, or 0 on error. - - NOTE: - The maximum size of the packet is limited by the MTU (Maximum Transfer Unit) - of the transport medium. It can be as low as 250 bytes for some PPP links, - and as high as 1500 bytes for ethernet. -*/ +/** + * Send a single UDP packet to the specified channel. + * + * If the channel specified is -1, the packet will be sent to the address in + * the `src` member of the packet. + * + * The packet will be updated with the status of the packet after it has been + * sent. + * + * **Warning**: UDP is an _unreliable protocol_, which means we can report + * that your packet has been successfully sent from your machine, but then it + * never makes it to its destination when a router along the way quietly drops + * it. If this happens--and this is a common result on the internet!--you will + * not know the packet never made it. Also, packets may arrive in a different + * order than you sent them. Plan accordingly! + * + * **Warning**: The maximum size of the packet is limited by the MTU (Maximum + * Transfer Unit) of the transport medium. It can be as low as 250 bytes for + * some PPP links, and as high as 1500 bytes for ethernet. Different sizes can + * be sent, but the system might split it into multiple transmission fragments + * behind the scenes, that need to be reassembled on the other side (and the + * packet is lost if any fragment is lost in transit). So the less you can + * reasonably send in a single packet, the better, as it will be more reliable + * and lower latency. + * + * \param sock the UDP socket to send packets on. + * \param packet a single packet to send to the network. + * \returns 1 if the packet was sent, or 0 on error. + * + * \since This function is available since SDL_net 2.0.0. + */ extern DECLSPEC int SDLCALL SDLNet_UDP_Send(UDPsocket sock, int channel, UDPpacket *packet); -/* Receive a vector of pending packets from the UDP socket. - The returned packets contain the source address and the channel they arrived - on. If they did not arrive on a bound channel, the the channel will be set - to -1. - The channels are checked in highest to lowest order, so if an address is - bound to multiple channels, the highest channel with the source address - bound will be returned. - This function returns the number of packets read from the network, or -1 - on error. This function does not block, so can return 0 packets pending. -*/ +/** + * Receive a vector of pending packets from a UDP socket. + * + * The returned packets contain the source address and the channel they + * arrived on. If they did not arrive on a bound channel, the the channel will + * be set to -1. + * + * The channels are checked in highest to lowest order, so if an address is + * bound to multiple channels, the highest channel with the source address + * bound will be returned. + * + * This function takes an array of packets but does not need to be allocated + * through SDLNet_AllocPacketV; if you supply your own array of packets you + * allocated individually, that is okay, as long as the last element in the + * array is NULL, so SDL_net knows the array bounds. The arrays returned by + * SDLNet_AllocPacketV are properly NULL-terminated for these purposes. + * + * This function does not block, so it can return 0 packets pending, which is + * not an error condition. + * + * \param sock the UDP socket to receive packets on. + * \param packets an array of packets, NULL terminated. + * \returns the number of packets read from the network, or -1 on error. 0 + * means no packets were currently available. + * + * \since This function is available since SDL_net 2.0.0. + * + * \sa SDLNet_UDP_SendV + * \sa SDLNet_UDP_Recv + */ extern DECLSPEC int SDLCALL SDLNet_UDP_RecvV(UDPsocket sock, UDPpacket **packets); -/* Receive a single packet from the UDP socket. - The returned packet contains the source address and the channel it arrived - on. If it did not arrive on a bound channel, the the channel will be set - to -1. - The channels are checked in highest to lowest order, so if an address is - bound to multiple channels, the highest channel with the source address - bound will be returned. - This function returns the number of packets read from the network, or -1 - on error. This function does not block, so can return 0 packets pending. -*/ +/** + * Receive a single packet from a UDP socket. + * + * The returned packets contain the source address and the channel they + * arrived on. If they did not arrive on a bound channel, the the channel will + * be set to -1. + * + * The channels are checked in highest to lowest order, so if an address is + * bound to multiple channels, the highest channel with the source address + * bound will be returned. + * + * This function does not block, so it can return 0 packets pending, which is + * not an error condition. + * + * \param sock the UDP socket to receive packets on. + * \param packet a single packet to receive data into from the network. + * \returns 1 if a new packet is available, or -1 on error. 0 means no packets + * were currently available. + * + * \since This function is available since SDL_net 2.0.0. + * + * \sa SDLNet_UDP_Send + * \sa SDLNet_UDP_RecvV + */ extern DECLSPEC int SDLCALL SDLNet_UDP_Recv(UDPsocket sock, UDPpacket *packet); -/* Close a UDP network socket */ +/** + * Close a UDP socket. + * + * This disconnects the socket and frees any resources it retains. + * + * This socket may not be used again once given to this function. + * + * \param sock UDP socket to close. + * + * \since This function is available since SDL_net 2.0.0. + */ extern DECLSPEC void SDLCALL SDLNet_UDP_Close(UDPsocket sock); @@ -302,74 +718,257 @@ typedef struct _SDLNet_GenericSocket { int ready; } *SDLNet_GenericSocket; -/* Allocate a socket set for use with SDLNet_CheckSockets() - This returns a socket set for up to 'maxsockets' sockets, or NULL if - the function ran out of memory. +/** + * Allocate a socket set for use with SDLNet_CheckSockets(). + * + * To query if new data is available on a socket, you use a "socket set" with + * SDLNet_CheckSockets(). A socket set is just a list of sockets behind the + * scenes; you allocate a set and then add/remove individual sockets to/from + * the set. + * + * When done with a socket set, you can free it with SDLNet_FreeSocketSet. + * + * \param maxsockets the maximum amount of sockets to include in this set. + * \returns a socket set for up to `maxsockets` sockets, or NULL if the + * function ran out of memory. + * + * \since This function is available since SDL_net 2.0.0. + * + * \sa SDLNet_FreeSocketSet */ extern DECLSPEC SDLNet_SocketSet SDLCALL SDLNet_AllocSocketSet(int maxsockets); -/* Add a socket to a set of sockets to be checked for available data */ +/** + * Add a socket to a socket set, to be checked for available data. + * + * Generally you don't want to call this generic function, but rather the + * specific, inline function that wraps it: SDLNet_TCP_AddSocket() or + * SDLNet_UDP_AddSocket(). + * + * This function will fail if you add a socket to the set when the set already + * has its maximum number of sockets added, but otherwise it will always + * succeed. + * + * If `sock` is NULL, nothing is added to the set; this lets you query the + * number of sockets currently contained in the set. + * + * \param set the socket set to add a new socket to. + * \param sock the socket to add to the set. + * \returns the total number of sockets contained in the set (including this + * new one), or -1 if the set is already full. + * + * \since This function is available since SDL_net 2.0.0. + * + * \sa SDLNet_TCP_AddSocket + * \sa SDLNet_UDP_AddSocket + * \sa SDLNet_DelSocket + * \sa SDLNet_TCP_DelSocket + * \sa SDLNet_UDP_DelSocket + * \sa SDLNet_CheckSockets + */ extern DECLSPEC int SDLCALL SDLNet_AddSocket(SDLNet_SocketSet set, SDLNet_GenericSocket sock); + +/** + * Add a TCP socket to a socket set, to be checked for available data. + * + * This is a small TCP-specific wrapper over SDLNet_AddSocket; please refer + * to that function's documentation. + * + * \param set the socket set to add a new socket to. + * \param sock the socket to add to the set. + * \returns the total number of sockets contained in the set (including this new one), + * or -1 if the set is already full. + * + * \since This function is available since SDL_net 2.0.0. + * + * \sa SDLNet_AddSocket + */ SDL_FORCE_INLINE int SDLNet_TCP_AddSocket(SDLNet_SocketSet set, TCPsocket sock) { return SDLNet_AddSocket(set, (SDLNet_GenericSocket)sock); } + +/** + * Add a UDP socket to a socket set, to be checked for available data. + * + * This is a small UDP-specific wrapper over SDLNet_AddSocket; please refer + * to that function's documentation. + * + * \param set the socket set to add a new socket to. + * \param sock the socket to add to the set. + * \returns the total number of sockets contained in the set (including this new one), + * or -1 if the set is already full. + * + * \since This function is available since SDL_net 2.0.0. + * + * \sa SDLNet_AddSocket + */ SDL_FORCE_INLINE int SDLNet_UDP_AddSocket(SDLNet_SocketSet set, UDPsocket sock) { return SDLNet_AddSocket(set, (SDLNet_GenericSocket)sock); } -/* Remove a socket from a set of sockets to be checked for available data */ +/** + * Remove a socket from a set of sockets to be checked for available data. + * + * Generally you don't want to call this generic function, but rather the + * specific, inline function that wraps it: SDLNet_TCP_DelSocket() or + * SDLNet_UDP_DelSocket(). + * + * If `sock` is NULL, nothing is removed from the set; this lets you query the + * number of sockets currently contained in the set. + * + * This will return -1 if the socket was not found in the set; in such a case, + * nothing is removed from the set. + * + * \param set the socket set to remove a socket from. + * \param sock the socket to remove from the set. + * \returns the total number of sockets contained in the set (after `sock`'s + * removal), or -1 if `sock` was not in the set. + * + * \since This function is available since SDL_net 2.0.0. + * + * \sa SDLNet_TCP_DelSocket + * \sa SDLNet_UDP_DelSocket + * \sa SDLNet_AddSocket + * \sa SDLNet_TCP_AddSocket + * \sa SDLNet_UDP_AddSocket + * \sa SDLNet_CheckSockets + */ extern DECLSPEC int SDLCALL SDLNet_DelSocket(SDLNet_SocketSet set, SDLNet_GenericSocket sock); + +/** + * Remove a TCP socket from a socket set. + * + * This is a small TCP-specific wrapper over SDLNet_DelSocket; please refer + * to that function's documentation. + * + * \param set the socket set to remove a socket from. + * \param sock the socket to remove from the set. + * \returns the total number of sockets contained in the set (after + * `sock`'s removal), or -1 if `sock` was not in the set. + * + * \since This function is available since SDL_net 2.0.0. + * + * \sa SDLNet_DelSocket + */ SDL_FORCE_INLINE int SDLNet_TCP_DelSocket(SDLNet_SocketSet set, TCPsocket sock) { return SDLNet_DelSocket(set, (SDLNet_GenericSocket)sock); } + +/** + * Remove a UDP socket from a socket set. + * + * This is a small UDP-specific wrapper over SDLNet_DelSocket; please refer + * to that function's documentation. + * + * \param set the socket set to remove a socket from. + * \param sock the socket to remove from the set. + * \returns the total number of sockets contained in the set (after + * `sock`'s removal), or -1 if `sock` was not in the set. + * + * \since This function is available since SDL_net 2.0.0. + * + * \sa SDLNet_DelSocket + */ SDL_FORCE_INLINE int SDLNet_UDP_DelSocket(SDLNet_SocketSet set, UDPsocket sock) { return SDLNet_DelSocket(set, (SDLNet_GenericSocket)sock); } -/* This function checks to see if data is available for reading on the - given set of sockets. If 'timeout' is 0, it performs a quick poll, - otherwise the function returns when either data is available for - reading, or the timeout in milliseconds has elapsed, which ever occurs - first. This function returns the number of sockets ready for reading, - or -1 if there was an error with the select() system call. -*/ +/** + * Check a socket set for data availability. + * + * This function checks to see if data is available for reading on the given + * set of sockets. If 'timeout' is 0, it performs a quick poll, otherwise the + * function returns when either data is available for reading, or the timeout + * in milliseconds has elapsed, whichever occurs first. + * + * \param set the socket set to check for ready sockets. + * \param timeout the time to wait in milliseconds for new data to arrive. A + * timeout of zero checks for new data and returns without + * blocking. + * \returns the number of sockets ready for reading, or -1 if there was an + * error with the select() system call. + * + * \since This function is available since SDL_net 2.0.0. + */ extern DECLSPEC int SDLCALL SDLNet_CheckSockets(SDLNet_SocketSet set, Uint32 timeout); -/* After calling SDLNet_CheckSockets(), you can use this function on a - socket that was in the socket set, to find out if data is available - for reading. -*/ +/* !!! FIXME: wikiheaders.pl ignores macros, atm */ +/** + * See if a specific socket has data available after checking it in a set. + * + * After calling SDLNet_CheckSockets(), you can use this function on a + * socket that was in the socket set, to find out if data is available + * for reading. + * + * \param sock the socket to check. + * \returns non-zero if socket has new data available, zero otherwise. + * + * \since This function is available since SDL_net 2.0.0. + */ #define SDLNet_SocketReady(sock) _SDLNet_SocketReady((SDLNet_GenericSocket)(sock)) SDL_FORCE_INLINE int _SDLNet_SocketReady(SDLNet_GenericSocket sock) { return (sock != NULL) && (sock->ready); } -/* Free a set of sockets allocated by SDL_NetAllocSocketSet() */ +/** + * Free a set of sockets allocated by SDLNet_AllocSocketSet(). + * + * When done with a socket set, call this function to free its resources. + * + * This only frees the socket set, not the individual sockets in the set, + * which would still (at some future point) need to be closed with + * SDLNet_TCP_Close or SDLNet_UDP_Close. + * + * \param set the socket set to free. + * + * \since This function is available since SDL_net 2.0.0. + */ extern DECLSPEC void SDLCALL SDLNet_FreeSocketSet(SDLNet_SocketSet set); -/***********************************************************************/ -/* Error reporting functions */ -/***********************************************************************/ +/* Error reporting functions */ + +/** + * Set an error message to be retrieved with SDLNet_GetError. + * + * Generally you don't need to call this (SDL_net will use it internally to + * report errors), but it could be useful if you need to inject an error + * message of your own in here. + * + * \param fmt a printf-style format string for the error message. + * + * \since This function is available since SDL_net 2.0.0. + */ extern DECLSPEC void SDLCALL SDLNet_SetError(const char *fmt, ...); + +/** + * Get the latest error message from SDL_net. + * + * The error message, depending on how SDL_net was built, may or may not be + * thread-local data. Sometimes things will set an error message when no + * failure was reported; the error string is only meaningful right after a + * public API reports a failure, and should be ignored otherwise. + * + * \returns the last set error message in UTF-8 encoding. + * + * \since This function is available since SDL_net 2.0.0. + */ extern DECLSPEC const char * SDLCALL SDLNet_GetError(void); -/***********************************************************************/ -/* Inline functions to read/write network data */ -/***********************************************************************/ +/* Inline functions to read/write network data */ -/* Warning, some systems have data access alignment restrictions */ -#if defined(sparc) || defined(mips) || defined(__arm__) -#define SDL_DATA_ALIGNED 1 +/* Warning, most systems have data access alignment restrictions */ +#if defined(__i386__) || defined(__x86_64__) || defined(_M_X64) || defined(_M_IX86) || defined(_M_AMD64) +#define SDL_DATA_ALIGNED 0 #endif #ifndef SDL_DATA_ALIGNED -#define SDL_DATA_ALIGNED 0 +#define SDL_DATA_ALIGNED 1 #endif /* Write a 16/32-bit value to network packet buffer */ @@ -420,9 +1019,9 @@ SDL_FORCE_INLINE void _SDLNet_Write32(Uint32 value, void *areap) area[3] = value & 0xFF; } -SDL_FORCE_INLINE Uint16 _SDLNet_Read16(void *areap) +SDL_FORCE_INLINE Uint16 _SDLNet_Read16(const void *areap) { - Uint8 *area = (Uint8*)areap; + const Uint8 *area = (const Uint8*)areap; return ((Uint16)area[0]) << 8 | ((Uint16)area[1]); } @@ -440,4 +1039,4 @@ SDL_FORCE_INLINE Uint32 _SDLNet_Read32(const void *areap) #endif #include "close_code.h" -#endif /* _SDL_NET_H */ +#endif /* SDL_NET_H_ */ diff --git a/deps/sdl2_net/lib/cmake/SDL2_net/SDL2_net-static-targets-release.cmake b/deps/sdl2_net/lib/cmake/SDL2_net/SDL2_net-static-targets-release.cmake new file mode 100644 index 00000000..78934263 --- /dev/null +++ b/deps/sdl2_net/lib/cmake/SDL2_net/SDL2_net-static-targets-release.cmake @@ -0,0 +1,19 @@ +#---------------------------------------------------------------- +# Generated CMake target import file for configuration "Release". +#---------------------------------------------------------------- + +# Commands may need to know the format version. +set(CMAKE_IMPORT_FILE_VERSION 1) + +# Import target "SDL2_net::SDL2_net-static" for configuration "Release" +set_property(TARGET SDL2_net::SDL2_net-static APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) +set_target_properties(SDL2_net::SDL2_net-static PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "C" + IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libSDL2_net.a" + ) + +list(APPEND _IMPORT_CHECK_TARGETS SDL2_net::SDL2_net-static ) +list(APPEND _IMPORT_CHECK_FILES_FOR_SDL2_net::SDL2_net-static "${_IMPORT_PREFIX}/lib/libSDL2_net.a" ) + +# Commands beyond this point should not need to know the version. +set(CMAKE_IMPORT_FILE_VERSION) diff --git a/deps/sdl2_net/lib/cmake/SDL2_net/SDL2_net-static-targets.cmake b/deps/sdl2_net/lib/cmake/SDL2_net/SDL2_net-static-targets.cmake new file mode 100644 index 00000000..8c46dfb5 --- /dev/null +++ b/deps/sdl2_net/lib/cmake/SDL2_net/SDL2_net-static-targets.cmake @@ -0,0 +1,99 @@ +# Generated by CMake + +if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.5) + message(FATAL_ERROR "CMake >= 2.6.0 required") +endif() +cmake_policy(PUSH) +cmake_policy(VERSION 2.6...3.19) +#---------------------------------------------------------------- +# Generated CMake target import file. +#---------------------------------------------------------------- + +# Commands may need to know the format version. +set(CMAKE_IMPORT_FILE_VERSION 1) + +# Protect against multiple inclusion, which would fail when already imported targets are added once more. +set(_targetsDefined) +set(_targetsNotDefined) +set(_expectedTargets) +foreach(_expectedTarget SDL2_net::SDL2_net-static) + list(APPEND _expectedTargets ${_expectedTarget}) + if(NOT TARGET ${_expectedTarget}) + list(APPEND _targetsNotDefined ${_expectedTarget}) + endif() + if(TARGET ${_expectedTarget}) + list(APPEND _targetsDefined ${_expectedTarget}) + endif() +endforeach() +if("${_targetsDefined}" STREQUAL "${_expectedTargets}") + unset(_targetsDefined) + unset(_targetsNotDefined) + unset(_expectedTargets) + set(CMAKE_IMPORT_FILE_VERSION) + cmake_policy(POP) + return() +endif() +if(NOT "${_targetsDefined}" STREQUAL "") + message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_targetsDefined}\nTargets not yet defined: ${_targetsNotDefined}\n") +endif() +unset(_targetsDefined) +unset(_targetsNotDefined) +unset(_expectedTargets) + + +# Compute the installation prefix relative to this file. +get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +if(_IMPORT_PREFIX STREQUAL "/") + set(_IMPORT_PREFIX "") +endif() + +# Create imported target SDL2_net::SDL2_net-static +add_library(SDL2_net::SDL2_net-static STATIC IMPORTED) + +set_target_properties(SDL2_net::SDL2_net-static PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include/SDL2" + INTERFACE_LINK_LIBRARIES "\$" +) + +if(CMAKE_VERSION VERSION_LESS 2.8.12) + message(FATAL_ERROR "This file relies on consumers using CMake 2.8.12 or greater.") +endif() + +# Load information for each installed configuration. +get_filename_component(_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) +file(GLOB CONFIG_FILES "${_DIR}/SDL2_net-static-targets-*.cmake") +foreach(f ${CONFIG_FILES}) + include(${f}) +endforeach() + +# Cleanup temporary variables. +set(_IMPORT_PREFIX) + +# Loop over all imported files and verify that they actually exist +foreach(target ${_IMPORT_CHECK_TARGETS} ) + foreach(file ${_IMPORT_CHECK_FILES_FOR_${target}} ) + if(NOT EXISTS "${file}" ) + message(FATAL_ERROR "The imported target \"${target}\" references the file + \"${file}\" +but this file does not exist. Possible reasons include: +* The file was deleted, renamed, or moved to another location. +* An install or uninstall procedure did not complete successfully. +* The installation package was faulty and contained + \"${CMAKE_CURRENT_LIST_FILE}\" +but not all the files it references. +") + endif() + endforeach() + unset(_IMPORT_CHECK_FILES_FOR_${target}) +endforeach() +unset(_IMPORT_CHECK_TARGETS) + +# This file does not depend on other imported targets which have +# been exported from the same project but in a separate export set. + +# Commands beyond this point should not need to know the version. +set(CMAKE_IMPORT_FILE_VERSION) +cmake_policy(POP) diff --git a/deps/sdl2_net/lib/cmake/SDL2_net/SDL2_netConfig.cmake b/deps/sdl2_net/lib/cmake/SDL2_net/SDL2_netConfig.cmake new file mode 100644 index 00000000..99e51fc1 --- /dev/null +++ b/deps/sdl2_net/lib/cmake/SDL2_net/SDL2_netConfig.cmake @@ -0,0 +1,14 @@ +set(SDL2_net_FOUND ON) + +set(SDL2NET_SDL2_REQUIRED_VERSION 2.0.4) + +include(CMakeFindDependencyMacro) + +#FIXME: can't add SDL2NET_SDL2_REQUIRED_VERSION since not all SDL2 installs ship SDL2ConfigVersion.cmake +if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/SDL2_net-shared-targets.cmake") + include("${CMAKE_CURRENT_LIST_DIR}/SDL2_net-shared-targets.cmake") +endif() + +if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/SDL2_net-static-targets.cmake") + include("${CMAKE_CURRENT_LIST_DIR}/SDL2_net-static-targets.cmake") +endif() diff --git a/deps/sdl2_net/lib/cmake/SDL2_net/SDL2_netConfigVersion.cmake b/deps/sdl2_net/lib/cmake/SDL2_net/SDL2_netConfigVersion.cmake new file mode 100644 index 00000000..55b85967 --- /dev/null +++ b/deps/sdl2_net/lib/cmake/SDL2_net/SDL2_netConfigVersion.cmake @@ -0,0 +1,48 @@ +# This is a basic version file for the Config-mode of find_package(). +# It is used by write_basic_package_version_file() as input file for configure_file() +# to create a version-file which can be installed along a config.cmake file. +# +# The created file sets PACKAGE_VERSION_EXACT if the current version string and +# the requested version string are exactly the same and it sets +# PACKAGE_VERSION_COMPATIBLE if the current version is >= requested version. +# The variable CVF_VERSION must be set before calling configure_file(). + +set(PACKAGE_VERSION "2.2.0") + +if (PACKAGE_FIND_VERSION_RANGE) + # Package version must be in the requested version range + if ((PACKAGE_FIND_VERSION_RANGE_MIN STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION_MIN) + OR ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_GREATER PACKAGE_FIND_VERSION_MAX) + OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND PACKAGE_VERSION VERSION_GREATER_EQUAL PACKAGE_FIND_VERSION_MAX))) + set(PACKAGE_VERSION_COMPATIBLE FALSE) + else() + set(PACKAGE_VERSION_COMPATIBLE TRUE) + endif() +else() + if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) + set(PACKAGE_VERSION_COMPATIBLE FALSE) + else() + set(PACKAGE_VERSION_COMPATIBLE TRUE) + if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION) + set(PACKAGE_VERSION_EXACT TRUE) + endif() + endif() +endif() + + +# if the installed project requested no architecture check, don't perform the check +if("FALSE") + return() +endif() + +# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it: +if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "8" STREQUAL "") + return() +endif() + +# check that the installed version has the same 32/64bit-ness as the one which is currently searching: +if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "8") + math(EXPR installedBits "8 * 8") + set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)") + set(PACKAGE_VERSION_UNSUITABLE TRUE) +endif() diff --git a/deps/sdl2_net/lib/libSDL2_net.a b/deps/sdl2_net/lib/libSDL2_net.a index 880d4dd3..b1bc4626 100644 Binary files a/deps/sdl2_net/lib/libSDL2_net.a and b/deps/sdl2_net/lib/libSDL2_net.a differ diff --git a/deps/sdl2_net/lib/pkgconfig/SDL2_net.pc b/deps/sdl2_net/lib/pkgconfig/SDL2_net.pc index d90c86e0..42a9c1f1 100644 --- a/deps/sdl2_net/lib/pkgconfig/SDL2_net.pc +++ b/deps/sdl2_net/lib/pkgconfig/SDL2_net.pc @@ -5,7 +5,9 @@ includedir=${prefix}/include Name: SDL2_net Description: net library for Simple DirectMedia Layer -Version: 2.0.1 -Requires: sdl2 >= 2.0.0 +Version: 2.2.0 +Requires: sdl2 >= 2.0.4 +Requires.private: Libs: -L${libdir} -lSDL2_net -Cflags: -I${includedir}/SDL2 +Libs.private: +Cflags: -I${includedir} -I${includedir}/SDL2