all repos — mgba @ 15b4df3b2b021e9fa08f179316c4945ea0125e7a

mGBA Game Boy Advance Emulator

Fix the build on MSVC.
waddlesplash waddlesplash@gmail.com
Thu, 16 Mar 2017 15:33:30 -0400
commit

15b4df3b2b021e9fa08f179316c4945ea0125e7a

parent

40e9dfcf5c3f512fa332a48d5a478329971b0aca

M CMakeLists.txtCMakeLists.txt

@@ -195,6 +195,7 @@ file(GLOB OS_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/platform/windows/*.c)

source_group("Windows-specific code" FILES ${OS_SRC}) if(MSVC) add_definitions(-DNOMINMAX -DWIN32_LEAN_AND_MEAN) + set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE) endif() elseif(UNIX) add_definitions(-DUSE_PTHREADS)

@@ -525,10 +526,12 @@ elseif(USE_ZLIB)

list(APPEND VFS_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/util/vfs/vfs-zip.c ${CMAKE_CURRENT_SOURCE_DIR}/src/third-party/zlib/contrib/minizip/ioapi.c ${CMAKE_CURRENT_SOURCE_DIR}/src/third-party/zlib/contrib/minizip/unzip.c) - set_source_files_properties( - ${CMAKE_CURRENT_SOURCE_DIR}/src/third-party/zlib/contrib/minizip/ioapi.c - ${CMAKE_CURRENT_SOURCE_DIR}/src/third-party/zlib/contrib/minizip/unzip.c - PROPERTIES COMPILE_FLAGS "-Wno-unused-parameter -Wno-implicit-function-declaration") + if(NOT MSVC) + set_source_files_properties( + ${CMAKE_CURRENT_SOURCE_DIR}/src/third-party/zlib/contrib/minizip/ioapi.c + ${CMAKE_CURRENT_SOURCE_DIR}/src/third-party/zlib/contrib/minizip/unzip.c + PROPERTIES COMPILE_FLAGS "-Wno-unused-parameter -Wno-implicit-function-declaration") + endif() endif() if (USE_LZMA)

@@ -593,7 +596,7 @@ endif()

if(M_CORE_GBA) add_definitions(-DM_CORE_GBA) - list(APPEND CORE_SRC + list(APPEND CORE_SRC ${ARM_SRC} ${GBA_SRC} ${GBA_CHEATS_SRC}
M include/mgba-util/common.hinclude/mgba-util/common.h

@@ -46,6 +46,7 @@ #define ftruncate _chsize

#define snprintf _snprintf #define strdup _strdup #define lseek _lseek +#define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR) #elif defined(__wii__) #include <sys/time.h> typedef intptr_t ssize_t;
M include/mgba-util/png-io.hinclude/mgba-util/png-io.h

@@ -12,6 +12,10 @@ CXX_GUARD_START

#ifdef USE_PNG +// png.h defines its own version of restrict which conflicts with mGBA's. +#ifdef restrict +#undef restrict +#endif #include <png.h> struct VFile;
M src/lr35902/debugger/cli-debugger.csrc/lr35902/debugger/cli-debugger.c

@@ -54,7 +54,7 @@ }

static inline uint16_t _printLine(struct CLIDebugger* debugger, uint16_t address, int segment) { struct CLIDebuggerBackend* be = debugger->backend; - struct LR35902InstructionInfo info = {}; + struct LR35902InstructionInfo info = {0}; char disassembly[48]; char* disPtr = disassembly; if (segment >= 0) {
M src/platform/qt/GameController.hsrc/platform/qt/GameController.h

@@ -14,6 +14,7 @@ #include <QString>

#include <QTimer> #include <memory> +#include <functional> #include <mgba/core/core.h> #include <mgba/core/thread.h>
M src/platform/qt/Window.cppsrc/platform/qt/Window.cpp

@@ -49,6 +49,10 @@ #ifdef M_CORE_GB

#include <mgba/internal/gb/gb.h> #include <mgba/internal/gb/video.h> #endif +#ifdef M_CORE_GBA +#include <mgba/internal/gba/gba.h> +#include <mgba/internal/gba/video.h> +#endif #include "feature/commandline.h" #include "feature/sqlite3/no-intro.h" #include <mgba-util/vfs.h>
M src/util/vfs/vfs-fd.csrc/util/vfs/vfs-fd.c

@@ -53,7 +53,7 @@ return 0;

} struct stat stat; - if (fstat(fd, &stat) < 0 || S_ISDIR(stat.st_mode)) { + if (fstat(fd, &stat) < 0 || (stat.st_mode & S_IFDIR)) { close(fd); return 0; }