From 2415d59d94a8dcbc93baf7fec00aee2eb2d0c5e2 Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Sat, 25 Oct 2014 03:06:45 -0700 Subject: [PATCH] Windows C++ fixes --- src/platform/qt/Window.cpp | 2 +- src/platform/qt/Window.h | 2 +- src/util/socket.h | 10 ++++------ 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/platform/qt/Window.cpp b/src/platform/qt/Window.cpp index 737a94086..79b39caf5 100644 --- a/src/platform/qt/Window.cpp +++ b/src/platform/qt/Window.cpp @@ -7,8 +7,8 @@ #include #include "GameController.h" -#include "GDBWindow.h" #include "GDBController.h" +#include "GDBWindow.h" #include "LoadSaveState.h" #include "LogView.h" diff --git a/src/platform/qt/Window.h b/src/platform/qt/Window.h index eceb64f0b..3368b590c 100644 --- a/src/platform/qt/Window.h +++ b/src/platform/qt/Window.h @@ -8,6 +8,7 @@ extern "C" { #include "gba.h" } +#include "GDBController.h" #include "Display.h" #include "LoadSaveState.h" @@ -16,7 +17,6 @@ struct StartupOptions; namespace QGBA { class GameController; -class GDBController; class LogView; class WindowBackground; diff --git a/src/util/socket.h b/src/util/socket.h index a84f9e13d..416d72682 100644 --- a/src/util/socket.h +++ b/src/util/socket.h @@ -48,10 +48,9 @@ static inline Socket SocketOpenTCP(int port, uint32_t bindAddress) { struct sockaddr_in bindInfo = { .sin_family = AF_INET, .sin_port = htons(port), - .sin_addr = { - .s_addr = htonl(bindAddress) - } + .sin_addr = { 0 } }; + bindInfo.sin_addr.s_addr = htonl(bindAddress); int err = bind(sock, (const struct sockaddr*) &bindInfo, sizeof(struct sockaddr_in)); if (err) { close(sock); @@ -69,10 +68,9 @@ static inline Socket SocketConnectTCP(int port, uint32_t destinationAddress) { struct sockaddr_in bindInfo = { .sin_family = AF_INET, .sin_port = htons(port), - .sin_addr = { - .s_addr = htonl(destinationAddress) - } + .sin_addr = { 0 } }; + bindInfo.sin_addr.s_addr = htonl(destinationAddress); int err = connect(sock, (const struct sockaddr*) &bindInfo, sizeof(struct sockaddr_in)); if (err) { close(sock);