Skip to content
Snippets Groups Projects
Verified Commit 3daeb2e9 authored by Marco Simonelli's avatar Marco Simonelli Committed by Pier Angelo Vendrame
Browse files

Bug 41459: WebRTC fails to build under mingw (Part 2)

- fixes required to build third_party/libwebrtc
parent 046d4fc2
1 merge request!609Bug 41687: Rebased alpha to 102.10
......@@ -15,7 +15,7 @@
#include "rtc_base/system/arch.h"
#if defined(WEBRTC_POSIX)
#if (defined(WEBRTC_POSIX) || defined(__MINGW32__))
#define WebRtcIsac_lrint lrint
#elif (defined(WEBRTC_ARCH_X86) && defined(WIN32))
static __inline long int WebRtcIsac_lrint(double x_dbl) {
......
......@@ -16,9 +16,16 @@
#endif
#include <stdint.h>
#ifdef XP_WIN // Moving this into the global namespace
typedef int pid_t; // matching what used to be in
#endif // video_capture_defines.h
// Use int on all clang-cl builds and x86 mingw builds.
// Use long long on Windows x64 building under MinGW
// Must be consistent with the same typedefs in video_capture_defines.h
#if defined(XP_WIN)
#if defined(_MSC_VER) || !defined(_WIN64)
typedef int pid_t;
#else
typedef long long pid_t;
#endif
#endif
namespace webrtc {
......
......@@ -14,6 +14,17 @@
#include "api/video/video_frame.h"
#include "common_video/libyuv/include/webrtc_libyuv.h"
// Use int on all clang-cl builds and x86 mingw builds.
// Use long long on Windows x64 building under MinGW
// Must be consistent with the same typedefs in desktop_capture_types.h
#if defined(XP_WIN)
#if defined(_MSC_VER) || !defined(_WIN64)
typedef int pid_t;
#else
typedef long long pid_t;
#endif
#endif
namespace webrtc {
enum {
......
......@@ -12,7 +12,7 @@
#define MODULES_VIDEO_CAPTURE_MAIN_SOURCE_WINDOWS_DEVICE_INFO_DS_H_
#include <dshow.h>
#include <Ks.h>
#include <ks.h>
#include <dbt.h>
#include "modules/video_capture/device_info_impl.h"
......
......@@ -88,6 +88,8 @@ void SetCurrentThreadName(const char* name) {
set_thread_description_func(::GetCurrentThread(), wide_thread_name);
}
#if defined(_MSC_VER)
// SEH is only impelmented for the MSVC compiler
// For details see:
// https://docs.microsoft.com/en-us/visualstudio/debugger/how-to-set-a-thread-name-in-native-code
#pragma pack(push, 8)
......@@ -107,6 +109,7 @@ void SetCurrentThreadName(const char* name) {
} __except (EXCEPTION_EXECUTE_HANDLER) { // NOLINT
}
#pragma warning(pop)
#endif // _MSC_VER
#elif defined(WEBRTC_LINUX) || defined(WEBRTC_ANDROID)
prctl(PR_SET_NAME, reinterpret_cast<unsigned long>(name)); // NOLINT
#elif defined(WEBRTC_MAC) || defined(WEBRTC_IOS)
......
......@@ -59,6 +59,20 @@
#define ECONNREFUSED WSAECONNREFUSED
#undef EHOSTUNREACH
#define EHOSTUNREACH WSAEHOSTUNREACH
#undef ENOTEMPTY
#define ENOTEMPTY WSAENOTEMPTY
#undef EPROCLIM
#define EPROCLIM WSAEPROCLIM
#undef EUSERS
#define EUSERS WSAEUSERS
#undef EDQUOT
#define EDQUOT WSAEDQUOT
#undef ESTALE
#define ESTALE WSAESTALE
#undef EREMOTE
#define EREMOTE WSAEREMOTE
#undef EACCES
#define EACCES WSAEACCES
#define SOCKET_EACCES WSAEACCES
#endif // WEBRTC_WIN
......
......@@ -11,7 +11,7 @@
#ifndef RTC_BASE_SYNCHRONIZATION_RW_LOCK_WIN_H_
#define RTC_BASE_SYNCHRONIZATION_RW_LOCK_WIN_H_
#include <Windows.h>
#include <windows.h>
#include "rtc_base/synchronization/rw_lock_wrapper.h"
......
......@@ -14,7 +14,7 @@
#include <cerrno>
#ifdef _WIN32
#include <Windows.h>
#include <windows.h>
#else
#include <string.h>
#endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment