Bug 974845 - Fixed compilation on mingw with secure APIs enabled by default. r=Jan
new file mode 100644
--- /dev/null
+++ b/media/libvpx/mingw.patch
@@ -0,0 +1,30 @@
+diff --git a/media/libvpx/vpx/src/svc_encodeframe.c b/media/libvpx/vpx/src/svc_encodeframe.c
+index 57d21dc..2514ad3 100644
+--- a/media/libvpx/vpx/src/svc_encodeframe.c
++++ b/media/libvpx/vpx/src/svc_encodeframe.c
+@@ -18,21 +18,23 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #define VPX_DISABLE_CTRL_TYPECHECKS 1
+ #define VPX_CODEC_DISABLE_COMPAT 1
+ #include "vpx/svc_context.h"
+ #include "vpx/vp8cx.h"
+ #include "vpx/vpx_encoder.h"
+
+-#if defined(__MINGW32__) && !defined(MINGW_HAS_SECURE_API)
++#ifdef __MINGW32__
+ #define strtok_r strtok_s
++#ifndef MINGW_HAS_SECURE_API
+ // proto from /usr/x86_64-w64-mingw32/include/sec_api/string_s.h
+ _CRTIMP char *__cdecl strtok_s(char *str, const char *delim, char **context);
+-#endif
++#endif /* MINGW_HAS_SECURE_API */
++#endif /* __MINGW32__ */
+
+ #ifdef _MSC_VER
+ #define strdup _strdup
+ #define strtok_r strtok_s
+ #endif
+
+ #define SVC_REFERENCE_FRAMES 8
+ #define SUPERFRAME_SLOTS (8)
--- a/media/libvpx/update.py
+++ b/media/libvpx/update.py
@@ -447,16 +447,17 @@ def update_and_remove_files(prefix, libv
for f in removed_files:
os.unlink(f)
print ' ', f
def apply_patches():
# Patch to permit vpx users to specify their own <stdint.h> types.
os.system("patch -p3 < stdint.patch")
os.system("patch -p3 < unified.patch")
+ os.system("patch -p3 < mingw.patch")
def update_readme(commit):
with open('README_MOZILLA') as f:
readme = f.read()
if 'The git commit ID used was' in readme:
new_readme = re.sub('The git commit ID used was [a-f0-9]+',
'The git commit ID used was %s' % commit, readme)
--- a/media/libvpx/vpx/src/svc_encodeframe.c
+++ b/media/libvpx/vpx/src/svc_encodeframe.c
@@ -18,21 +18,23 @@
#include <stdlib.h>
#include <string.h>
#define VPX_DISABLE_CTRL_TYPECHECKS 1
#define VPX_CODEC_DISABLE_COMPAT 1
#include "vpx/svc_context.h"
#include "vpx/vp8cx.h"
#include "vpx/vpx_encoder.h"
-#if defined(__MINGW32__) && !defined(MINGW_HAS_SECURE_API)
+#ifdef __MINGW32__
#define strtok_r strtok_s
+#ifndef MINGW_HAS_SECURE_API
// proto from /usr/x86_64-w64-mingw32/include/sec_api/string_s.h
_CRTIMP char *__cdecl strtok_s(char *str, const char *delim, char **context);
-#endif
+#endif /* MINGW_HAS_SECURE_API */
+#endif /* __MINGW32__ */
#ifdef _MSC_VER
#define strdup _strdup
#define strtok_r strtok_s
#endif
#define SVC_REFERENCE_FRAMES 8
#define SUPERFRAME_SLOTS (8)