diff options
author | Nick Mathewson <nickm@torproject.org> | 2016-11-22 18:29:50 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-11-22 18:29:50 -0500 |
commit | 4614f8e6816d559f8fbe9ae0f42d751d3fb95c77 (patch) | |
tree | f463cbcd67ae3350a9142eb81b0da3d7f87eb140 /src/common/compat.c | |
parent | c35d481f56284ebeafc2860eed27c9833d631983 (diff) | |
parent | 8f465808a06c739d8f81d04f6ed07fad40cacc76 (diff) | |
download | tor-4614f8e6816d559f8fbe9ae0f42d751d3fb95c77.tar.gz tor-4614f8e6816d559f8fbe9ae0f42d751d3fb95c77.zip |
Merge remote-tracking branch 'teor/fix-mingw-pagesize'
Diffstat (limited to 'src/common/compat.c')
-rw-r--r-- | src/common/compat.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/common/compat.c b/src/common/compat.c index 8d6a491c42..ebf05f59e1 100644 --- a/src/common/compat.c +++ b/src/common/compat.c @@ -204,7 +204,15 @@ tor_rename(const char *path_old, const char *path_new) sandbox_intern_string(path_new)); } -#if defined(HAVE_SYS_MMAN_H) || defined(RUNNING_DOXYGEN) +/* Some MinGW builds have sys/mman.h, but not the corresponding symbols. + * Other configs rename the symbols using macros (including getpagesize). + * So check for sys/mman.h and unistd.h, and a getpagesize declaration. */ +#if (defined(HAVE_SYS_MMAN_H) && defined(HAVE_UNISTD_H) && \ + defined(HAVE_DECL_GETPAGESIZE)) +#define COMPAT_HAS_MMAN_AND_PAGESIZE +#endif + +#if defined(COMPAT_HAS_MMAN_AND_PAGESIZE) || defined(RUNNING_DOXYGEN) /** Try to create a memory mapping for <b>filename</b> and return it. On * failure, return NULL. Sets errno properly, using ERANGE to mean * "empty file". */ |