all repos — mgba @ c689e32856c7564c7a7a28a25d2776e1a65a7f21

mGBA Game Boy Advance Emulator

All: Several MSVC build fixes
Jeffrey Pfau jeffrey@endrift.com
Sun, 17 Apr 2016 18:03:13 -0700
commit

c689e32856c7564c7a7a28a25d2776e1a65a7f21

parent

f28d9d96a112a392d49660fa1a2551179c0d8d52

M src/platform/qt/Display.hsrc/platform/qt/Display.h

@@ -6,6 +6,10 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef QGBA_DISPLAY #define QGBA_DISPLAY +extern "C" { +#include "util/common.h" +} + #include <QWidget> #include "MessagePainter.h"
M src/platform/qt/PaletteView.hsrc/platform/qt/PaletteView.h

@@ -13,8 +13,6 @@ #include "Swatch.h"

#include "ui_PaletteView.h" -class GameController; - namespace QGBA { class Swatch;
M src/util/common.hsrc/util/common.h

@@ -23,15 +23,22 @@ #include <string.h>

#include "version.h" +#ifdef _WIN32 +// WinSock2 gets very angry if it's included too late +#include <winsock2.h> +#endif #ifdef _MSC_VER +#include <Windows.h> #include <sys/types.h> typedef intptr_t ssize_t; -#define inline __inline +#define PATH_MAX MAX_PATH #define restrict __restrict #define strcasecmp _stricmp #define strncasecmp _strnicmp #define ftruncate _chsize #define snprintf _snprintf +#define strdup _strdup +#define lseek _lseek #elif defined(__wii__) typedef intptr_t ssize_t; #else
M src/util/nointro.csrc/util/nointro.c

@@ -158,7 +158,8 @@ char line[512];

struct { char* key; struct NoIntroItem* item; - } keyStack[KEY_STACK_SIZE] = {}; + } keyStack[KEY_STACK_SIZE]; + memset(keyStack, 0, sizeof(keyStack)); struct Table* parent = 0; size_t stackDepth = 0;
M src/util/socket.hsrc/util/socket.h

@@ -8,12 +8,11 @@ #define SOCKET_H

#include "util/common.h" -#ifdef __cplusplus +#if defined(__cplusplus) && !defined(restrict) #define restrict __restrict__ #endif #ifdef _WIN32 -#include <winsock2.h> #include <ws2tcpip.h> #define SOCKET_FAILED(s) ((s) == INVALID_SOCKET)