mirror of https://github.com/mgba-emu/mgba.git
Fix the build on MSVC.
This commit is contained in:
parent
40e9dfcf5c
commit
15b4df3b2b
|
@ -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}
|
||||
|
|
|
@ -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 <sys/time.h>
|
||||
typedef intptr_t ssize_t;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#include <QTimer>
|
||||
|
||||
#include <memory>
|
||||
#include <functional>
|
||||
|
||||
#include <mgba/core/core.h>
|
||||
#include <mgba/core/thread.h>
|
||||
|
|
|
@ -49,6 +49,10 @@
|
|||
#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>
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue