MinGW fixes

CMakeLists.txt
* Added definition of SDL_MAIN_HANDLED to solve linking error
src/dsound_compat.h
* Included mmsystem.h for LPCWAVEFORMATEX struct definition
src/file_find.cc
* FindClose is within Win32 API
src/mmx.cc
* __asm keyword is restricted to MSVC
This commit is contained in:
k3tamina 2022-05-30 22:14:59 +02:00
parent 501ae1161d
commit 2cb79fef5a
4 changed files with 4 additions and 2 deletions

View File

@ -272,3 +272,4 @@ target_include_directories(${EXECUTABLE_NAME} PRIVATE ${ZLIB_INCLUDE_DIRS})
target_link_libraries(${EXECUTABLE_NAME} ${SDL2_LIBRARIES})
target_include_directories(${EXECUTABLE_NAME} PRIVATE ${SDL2_INCLUDE_DIRS})
add_definitions(-DSDL_MAIN_HANDLED)

View File

@ -9,6 +9,7 @@
#include <windows.h>
#include <mmreg.h>
#include <mmsystem.h>
#define DIRECTSOUND_VERSION 0x0300
#include <dsound.h>

View File

@ -47,7 +47,7 @@ bool fileFindNext(DirectoryFileFindData* findData)
// 0x4E63CC
bool findFindClose(DirectoryFileFindData* findData)
{
#if defined(_MSC_VER)
#if defined(_WIN32)
FindClose(findData->hFind);
#else
if (closedir(findData->dir) != 0) {

View File

@ -13,7 +13,7 @@ bool mmxIsSupported()
// TODO: There are other ways to determine MMX using FLAGS register.
#ifdef _WIN32
#if defined (_MSC_VER)
__asm
{
mov eax, 1