Fix builds with mingw x86 and x86_64.

- Deal with tmpnam_s() preproc issues in file_util.cc
  when building with mingw-w64..
- Add stdint.h include in mkvmuxer.cc.

Change-Id: I819a27e6d805d772a6e1863982a2eeafd27b2a0d
This commit is contained in:
Tom Finegan 2017-09-17 19:33:22 -07:00
parent 22de626018
commit 27eb0b9002
2 changed files with 7 additions and 0 deletions

View File

@ -41,7 +41,12 @@ std::string GetTempFileName() {
return temp_file_name;
#else
char tmp_file_name[_MAX_PATH];
#if defined _MSC_VER || defined MINGW_HAS_SECURE_API
errno_t err = tmpnam_s(tmp_file_name);
#else
char* fname_pointer = tmpnam(tmp_file_name);
errno_t err = (fname_pointer == &tmp_file_name[0]) ? 0 : -1;
#endif
if (err == 0) {
return std::string(tmp_file_name);
}

View File

@ -8,6 +8,8 @@
#include "mkvmuxer/mkvmuxer.h"
#include <stdint.h>
#include <cfloat>
#include <climits>
#include <cstdio>