Bug 1244773 - Fixed ffvpx compilation on mingw. r=jya
authorJacek Caban <jacek@codeweavers.com>
Sat, 23 Apr 2016 14:34:59 +0200 (2016-04-23)
changeset 294679 5680a55b2ec1293dc2d9b5f8568a345d3d809d7b
parent 294678 2102e672350f76dc86fbfdcb14b2432578a52d27
child 294680 b068d21a21087b21042d106a9fab94cab3f3bcf0
push id30208
push usercbook@mozilla.com
push dateMon, 25 Apr 2016 09:55:37 +0000 (2016-04-25)
treeherdermozilla-central@1c6385ae1fe7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjya
bugs1244773
milestone48.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1244773 - Fixed ffvpx compilation on mingw. r=jya
media/ffvpx/config.h
media/ffvpx/libavutil/moz.build
--- a/media/ffvpx/config.h
+++ b/media/ffvpx/config.h
@@ -2,21 +2,35 @@
 /* vim:set ts=2 sw=2 sts=2 et cindent: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef MOZ_FFVPX_CONFIG_H
 #define MOZ_FFVPX_CONFIG_H
 #if defined(XP_WIN)
+// Avoid conflicts with mozilla-config.h
+#if !defined(_MSC_VER)
+#undef HAVE_DIRENT_H
+#undef HAVE_UNISTD_H
+#endif
 #if defined(HAVE_64BIT_BUILD)
 #include "config_win64.h"
 #else
 #include "config_win32.h"
 #endif
+// Adjust configure defines for GCC
+#if !defined(_MSC_VER)
+#if !defined(HAVE_64BIT_BUILD)
+#undef HAVE_MM_EMPTY
+#define HAVE_MM_EMPTY 0
+#endif
+#undef HAVE_LIBC_MSVCRT
+#define HAVE_LIBC_MSVCRT 0
+#endif
 #elif defined(XP_DARWIN)
 #if defined(HAVE_64BIT_BUILD)
 #include "config_darwin64.h"
 #else
 #include "config_darwin32.h"
 #endif
 #elif defined(XP_UNIX)
 #if defined(HAVE_64BIT_BUILD)
--- a/media/ffvpx/libavutil/moz.build
+++ b/media/ffvpx/libavutil/moz.build
@@ -46,17 +46,17 @@ SOURCES += [
     'reverse.c',
     'samplefmt.c',
     'threadmessage.c',
     'time.c',
     'timecode.c',
     'utils.c',
 ]
 
-if CONFIG['_MSC_VER']:
+if CONFIG['OS_ARCH'] == 'WINNT':
     SOURCES += [
         '../compat/strtod.c'
     ]
     if CONFIG['_MSC_VER'] < '1900':
         SOURCES += [
             '../compat/msvcrt/snprintf.c'
         ]