Windows: Buildfixes

This commit is contained in:
Vicki Pfau 2022-09-21 20:22:14 -07:00
parent c57075a539
commit 536170c331
2 changed files with 5 additions and 1 deletions

View File

@ -195,9 +195,11 @@ static inline Socket SocketOpenTCP(int port, const struct Address* bindAddress)
int err;
int enable = 1;
const int enable = 1;
#ifdef GEKKO
err = net_setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &enable, sizeof(enable));
#elif defined(_WIN32)
err = setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (const char*) &enable, sizeof(enable));
#else
err = setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &enable, sizeof(enable));
#endif

View File

@ -5,6 +5,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include <mgba/script/context.h>
#include <errno.h>
#include <mgba/internal/script/socket.h>
#include <mgba/script/macros.h>
#include <mgba-util/socket.h>