Unified · Split
| @@ -20,9 +20,15 @@ · 19 unmodified lines | |||
| 20 | #include <stdarg.h> | 20 | #include <stdarg.h> |
| 21 | #include <stdio.h> | 21 | #include <stdio.h> |
| 22 | #include <stdlib.h> | 22 | #include <stdlib.h> |
| 23 | #include <unistd.h> | ||
| 24 | #include <string.h> | 23 | #include <string.h> |
| 25 | 24 | ||
| 25 | #ifdef _WIN32 | ||
| 26 | #include <sys/types.h> | ||
| 27 | #include <io.h> | ||
| 28 | #else | ||
| 29 | #include <unistd.h> | ||
| 30 | #endif | ||
| 31 | |||
| 26 | // Stolen from osdep/compiler.h | 32 | // Stolen from osdep/compiler.h |
| 27 | #ifdef __GNUC__ | 33 | #ifdef __GNUC__ |
| 28 | #define PRINTF_ATTRIBUTE(a1, a2) __attribute__ ((format(printf, a1, a2))) | 34 | #define PRINTF_ATTRIBUTE(a1, a2) __attribute__ ((format(printf, a1, a2))) |
| @@ -97,6 +103,8 @@ static void check_output(int fd) · 68 unmodified lines | |||
| 97 | puts("output file ok"); | 103 | puts("output file ok"); |
| 98 | } | 104 | } |
| 99 | 105 | ||
| 106 | int mp_mkostemps(char *template, int suffixlen, int flags); | ||
| 107 | |||
| 100 | int main(int argc, char *argv[]) | 108 | int main(int argc, char *argv[]) |
| 101 | { | 109 | { |
| 102 | atexit(exit_cleanup); | 110 | atexit(exit_cleanup); |
| @@ -108,7 +116,7 @@ int main(int argc, char *argv[]) · 5 unmodified lines | |||
| 108 | int fd; | 116 | int fd; |
| 109 | { | 117 | { |
| 110 | char path[] = "./testout.XXXXXX"; | 118 | char path[] = "./testout.XXXXXX"; |
| 111 | fd = mkstemp(path); | 119 | fd = mp_mkostemps(path, 0, 0); |
| 112 | if (fd == -1) | 120 | if (fd == -1) |
| 113 | fail("mkstemp failed"); | 121 | fail("mkstemp failed"); |
| 114 | out_path = strdup(path); | 122 | out_path = strdup(path); |
| @@ -15,6 +15,7 @@ test_utils_files = [ · 14 unmodified lines | |||
| 15 | 'common/common.c', | 15 | 'common/common.c', |
| 16 | 'misc/bstr.c', | 16 | 'misc/bstr.c', |
| 17 | 'misc/dispatch.c', | 17 | 'misc/dispatch.c', |
| 18 | 'misc/io_utils.c', | ||
| 18 | 'misc/json.c', | 19 | 'misc/json.c', |
| 19 | 'misc/node.c', | 20 | 'misc/node.c', |
| 20 | 'misc/path_utils.c', | 21 | 'misc/path_utils.c', |
| @@ -124,7 +125,7 @@ if get_option('libmpv') · 103 unmodified lines | |||
| 124 | test('libmpv', exe, args: file, timeout: 60) | 125 | test('libmpv', exe, args: file, timeout: 60) |
| 125 | 126 | ||
| 126 | exe = executable('libmpv-encode', 'libmpv_encode.c', | 127 | exe = executable('libmpv-encode', 'libmpv_encode.c', |
| 127 | include_directories: incdir, link_with: libmpv) | 128 | include_directories: incdir, link_with: [libmpv, test_utils]) |
| 128 | test('libmpv-encode', exe, timeout: 30) | 129 | test('libmpv-encode', exe, timeout: 30) |
| 129 | endif | 130 | endif |
| 130 | 131 | ||