Skip to content

Commit 1c7e2a0

Browse files
rboy1prateekmedia
andauthored
[FIX] Fixed issue with cross compiling using MINGW-w64 (#1731)
* Fixed issue with cross compiling using MINGW-w64 * Update ts_tables_epg.c * Update ccx_encoders_common.h * Update ccx_common_platform.h * Update ts_tables_epg.c formatting changes a recommended by the clang test --------- Co-authored-by: Prateek Sunal <[email protected]>
1 parent fb6a830 commit 1c7e2a0

File tree

5 files changed

+17
-3
lines changed

5 files changed

+17
-3
lines changed

docs/CHANGES.TXT

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
- Fix: Resolve compile-time error about implicit declarations (#1646)
5151
- Fix: fatal out of memory error extracting from a VOB PS
5252
- Fix: Unit Test Rust failing due to changes in Rust Version 1.86.0
53+
- Fix: Support for MINGW-w64 cross compiling
5354
- Fix: Build with ENABLE_FFMPEG to support ffmpeg 5
5455

5556
0.94 (2021-12-14)

src/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,9 @@ set(FREETYPE_SOURCE
119119
)
120120
#Windows specific libraries and linker flags
121121
if(WIN32)
122-
include_directories ("${PROJECT_SOURCE_DIR}/thirdparty/win_spec_incld/")
122+
if(NOT MINGW)
123+
include_directories ("${PROJECT_SOURCE_DIR}/thirdparty/win_spec_incld/")
124+
endif()
123125
include_directories ("${PROJECT_SOURCE_DIR}/thirdparty/win_iconv/")
124126
aux_source_directory ("${PROJECT_SOURCE_DIR}/thirdparty/win_iconv/" SOURCEFILE)
125127
set (EXTRA_LIBS ${EXTRA_LIBS} ws2_32 winmm Bcrypt)

src/lib_ccx/ccx_common_platform.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@
2626
#undef UINT64_MAX
2727
#define UINT64_MAX _UI64_MAX
2828
typedef int socklen_t;
29-
typedef int ssize_t;
29+
#if !defined(__MINGW64__) && !defined(__MINGW32__)
30+
typedef int ssize_t;
31+
#endif
3032
typedef uint32_t in_addr_t;
3133
#ifndef IN_CLASSD
3234
#define IN_CLASSD(i) (((INT32)(i) & 0xf0000000) == 0xe0000000)
@@ -118,3 +120,4 @@
118120
typedef uint8_t UBYTE;
119121

120122
#endif // CCX_PLATFORM_H
123+

src/lib_ccx/ccx_encoders_common.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
#define _CC_ENCODER_COMMON_H
33

44
#ifdef WIN32
5-
#include "..\\thirdparty\\win_iconv\\iconv.h"
5+
#if defined(__MINGW64__) || defined(__MINGW32__)
6+
#include <iconv.h>
7+
#else
8+
#include "..\\thirdparty\\win_iconv\\iconv.h"
9+
#endif
610
#else
711
#include "iconv.h"
812
#endif

src/lib_ccx/ts_tables_epg.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44
#include "utility.h"
55
#include <stdbool.h>
66
#ifdef WIN32
7+
#if defined(__MINGW64__) || defined(__MINGW32__)
8+
#include <iconv.h>
9+
#else
710
#include "..\\thirdparty\\win_iconv\\iconv.h"
11+
#endif
812
#else
913
#include "iconv.h"
1014
#endif

0 commit comments

Comments
 (0)