diff --git a/docs/CHANGES.TXT b/docs/CHANGES.TXT index 7aac62924..73d3d0f24 100644 --- a/docs/CHANGES.TXT +++ b/docs/CHANGES.TXT @@ -48,6 +48,7 @@ - Fix: Resolve compile-time error about implicit declarations (#1646) - Fix: fatal out of memory error extracting from a VOB PS - Fix: Unit Test Rust failing due to changes in Rust Version 1.86.0 +- Fix: Support for MINGW-w64 cross compiling - Fix: Build with ENABLE_FFMPEG to support ffmpeg 5 0.94 (2021-12-14) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3852799b4..a04809916 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -123,7 +123,9 @@ set(FREETYPE_SOURCE ) #Windows specific libraries and linker flags if(WIN32) - include_directories ("${PROJECT_SOURCE_DIR}/thirdparty/win_spec_incld/") + if(NOT MINGW) + include_directories ("${PROJECT_SOURCE_DIR}/thirdparty/win_spec_incld/") + endif() include_directories ("${PROJECT_SOURCE_DIR}/thirdparty/win_iconv/") aux_source_directory ("${PROJECT_SOURCE_DIR}/thirdparty/win_iconv/" SOURCEFILE) set (EXTRA_LIBS ${EXTRA_LIBS} ws2_32 winmm Bcrypt) diff --git a/src/lib_ccx/ccx_common_platform.h b/src/lib_ccx/ccx_common_platform.h index 84eae9751..6f1bb57d5 100644 --- a/src/lib_ccx/ccx_common_platform.h +++ b/src/lib_ccx/ccx_common_platform.h @@ -26,7 +26,9 @@ #undef UINT64_MAX #define UINT64_MAX _UI64_MAX typedef int socklen_t; - typedef int ssize_t; + #if !defined(__MINGW64__) && !defined(__MINGW32__) + typedef int ssize_t; + #endif typedef uint32_t in_addr_t; #ifndef IN_CLASSD #define IN_CLASSD(i) (((INT32)(i) & 0xf0000000) == 0xe0000000) @@ -118,3 +120,4 @@ typedef uint8_t UBYTE; #endif // CCX_PLATFORM_H + diff --git a/src/lib_ccx/ccx_encoders_common.h b/src/lib_ccx/ccx_encoders_common.h index 5ddd324d9..5fbddc8a6 100644 --- a/src/lib_ccx/ccx_encoders_common.h +++ b/src/lib_ccx/ccx_encoders_common.h @@ -2,7 +2,11 @@ #define _CC_ENCODER_COMMON_H #ifdef WIN32 - #include "..\\thirdparty\\win_iconv\\iconv.h" + #if defined(__MINGW64__) || defined(__MINGW32__) + #include + #else + #include "..\\thirdparty\\win_iconv\\iconv.h" + #endif #else #include "iconv.h" #endif diff --git a/src/lib_ccx/ts_tables_epg.c b/src/lib_ccx/ts_tables_epg.c index 24908e71a..383a88bff 100644 --- a/src/lib_ccx/ts_tables_epg.c +++ b/src/lib_ccx/ts_tables_epg.c @@ -4,7 +4,11 @@ #include "utility.h" #include #ifdef WIN32 +#if defined(__MINGW64__) || defined(__MINGW32__) +#include +#else #include "..\\thirdparty\\win_iconv\\iconv.h" +#endif #else #include "iconv.h" #endif