From 3c92144280867e5086fd4697c0b60ecaa5301abd Mon Sep 17 00:00:00 2001 From: Johann Date: Thu, 17 Dec 2015 16:51:59 -0800 Subject: [PATCH 1/2] Remove unused stdint.h check https://bugs.chromium.org/p/webm/issues/detail?id=1119 Change-Id: I88891d9f0be29ac6f845d2b470e5735dad16e693 --- configure | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/configure b/configure index f12779c7a..4feb12069 100755 --- a/configure +++ b/configure @@ -260,7 +260,6 @@ ARCH_EXT_LIST=" HAVE_LIST=" ${ARCH_EXT_LIST} vpx_ports - stdint_h pthread_h sys_mman_h unistd_h @@ -545,14 +544,11 @@ process_detect() { # Specialize windows and POSIX environments. case $toolchain in *-win*-*) - case $header-$toolchain in - stdint*-gcc) true;; - *) false;; - esac && enable_feature $var - ;; + # Don't check for any headers in Windows builds. + false + ;; *) case $header in - stdint.h) true;; pthread.h) true;; sys/mman.h) true;; unistd.h) true;; @@ -570,7 +566,6 @@ process_detect() { int main(void) {return 0;} EOF # check system headers - check_header stdint.h check_header pthread.h check_header sys/mman.h check_header unistd.h # for sysconf(3) and friends. From 91c75c5c2390d8703c96bb8a7886a905ce26f12d Mon Sep 17 00:00:00 2001 From: Johann Date: Thu, 17 Dec 2015 17:04:11 -0800 Subject: [PATCH 2/2] Remove unused POSIX_MMAP references Change-Id: I6998e15f9ed2849a270033217c02e27c79ee8343 --- configure | 3 --- examples/vp8_multi_resolution_encoder.c | 7 ------- vpxstats.c | 16 ---------------- 3 files changed, 26 deletions(-) diff --git a/configure b/configure index 4feb12069..428fba343 100755 --- a/configure +++ b/configure @@ -261,7 +261,6 @@ HAVE_LIST=" ${ARCH_EXT_LIST} vpx_ports pthread_h - sys_mman_h unistd_h " EXPERIMENT_LIST=" @@ -550,7 +549,6 @@ process_detect() { *) case $header in pthread.h) true;; - sys/mman.h) true;; unistd.h) true;; *) false;; esac && enable_feature $var @@ -567,7 +565,6 @@ int main(void) {return 0;} EOF # check system headers check_header pthread.h - check_header sys/mman.h check_header unistd.h # for sysconf(3) and friends. check_header vpx/vpx_integer.h -I${source_path} && enable_feature vpx_ports diff --git a/examples/vp8_multi_resolution_encoder.c b/examples/vp8_multi_resolution_encoder.c index 2b032049c..0248edede 100644 --- a/examples/vp8_multi_resolution_encoder.c +++ b/examples/vp8_multi_resolution_encoder.c @@ -29,13 +29,6 @@ #include #include #include -#if USE_POSIX_MMAP -#include -#include -#include -#include -#include -#endif #include "vpx_ports/vpx_timer.h" #include "vpx/vpx_encoder.h" #include "vpx/vp8cx.h" diff --git a/vpxstats.c b/vpxstats.c index 172d8937c..16728ce09 100644 --- a/vpxstats.c +++ b/vpxstats.c @@ -26,17 +26,6 @@ int stats_open_file(stats_io_t *stats, const char *fpf, int pass) { stats->buf.buf = NULL; res = (stats->file != NULL); } else { -#if USE_POSIX_MMAP - struct stat stat_buf; - int fd; - - fd = open(fpf, O_RDONLY); - stats->file = fdopen(fd, "rb"); - fstat(fd, &stat_buf); - stats->buf.sz = stat_buf.st_size; - stats->buf.buf = mmap(NULL, stats->buf.sz, PROT_READ, MAP_PRIVATE, fd, 0); - res = (stats->buf.buf != NULL); -#else size_t nbytes; stats->file = fopen(fpf, "rb"); @@ -58,7 +47,6 @@ int stats_open_file(stats_io_t *stats, const char *fpf, int pass) { nbytes = fread(stats->buf.buf, 1, stats->buf.sz, stats->file); res = (nbytes == stats->buf.sz); -#endif /* USE_POSIX_MMAP */ } return res; @@ -82,11 +70,7 @@ int stats_open_mem(stats_io_t *stats, int pass) { void stats_close(stats_io_t *stats, int last_pass) { if (stats->file) { if (stats->pass == last_pass) { -#if USE_POSIX_MMAP - munmap(stats->buf.buf, stats->buf.sz); -#else free(stats->buf.buf); -#endif /* USE_POSIX_MMAP */ } fclose(stats->file);