Commit 10c94cdc authored by Marco Simonelli's avatar Marco Simonelli Committed by Richard Pospesel
Browse files

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

- fixes required to build third_party/libwebrtc
parent 346a1b54
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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) {
+10 −3
Original line number Diff line number Diff line
@@ -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 {

+11 −0
Original line number Diff line number Diff line
@@ -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 {
+1 −1
Original line number Diff line number Diff line
@@ -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"
+3 −0
Original line number Diff line number Diff line
@@ -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)
Loading