diff --git a/CMakeLists.txt b/CMakeLists.txt index c97ce8b94..107e8349d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -195,6 +195,7 @@ if(WIN32) 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} diff --git a/include/mgba-util/common.h b/include/mgba-util/common.h index 7b28a56da..4f36c0a17 100644 --- a/include/mgba-util/common.h +++ b/include/mgba-util/common.h @@ -46,6 +46,7 @@ typedef intptr_t ssize_t; #define snprintf _snprintf #define strdup _strdup #define lseek _lseek +#define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR) #elif defined(__wii__) #include typedef intptr_t ssize_t; diff --git a/include/mgba-util/png-io.h b/include/mgba-util/png-io.h index 20803303e..983992856 100644 --- a/include/mgba-util/png-io.h +++ b/include/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 struct VFile; diff --git a/src/lr35902/debugger/cli-debugger.c b/src/lr35902/debugger/cli-debugger.c index bfd3bcd48..953f6d754 100644 --- a/src/lr35902/debugger/cli-debugger.c +++ b/src/lr35902/debugger/cli-debugger.c @@ -54,7 +54,7 @@ static void _disassemble(struct CLIDebuggerSystem* debugger, struct CLIDebugVect 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) { diff --git a/src/platform/qt/GameController.h b/src/platform/qt/GameController.h index 79b18d3bf..7b8d6908b 100644 --- a/src/platform/qt/GameController.h +++ b/src/platform/qt/GameController.h @@ -14,6 +14,7 @@ #include #include +#include #include #include diff --git a/src/platform/qt/Window.cpp b/src/platform/qt/Window.cpp index 4c92ac495..6e86d9ed3 100644 --- a/src/platform/qt/Window.cpp +++ b/src/platform/qt/Window.cpp @@ -49,6 +49,10 @@ #include #include #endif +#ifdef M_CORE_GBA +#include +#include +#endif #include "feature/commandline.h" #include "feature/sqlite3/no-intro.h" #include diff --git a/src/util/vfs/vfs-fd.c b/src/util/vfs/vfs-fd.c index 39b2164ee..2b301703d 100644 --- a/src/util/vfs/vfs-fd.c +++ b/src/util/vfs/vfs-fd.c @@ -53,7 +53,7 @@ struct VFile* VFileFromFD(int fd) { } 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; }