diff --git a/include/libtorrent/file.hpp b/include/libtorrent/file.hpp index 36e6529ce..828d2d954 100644 --- a/include/libtorrent/file.hpp +++ b/include/libtorrent/file.hpp @@ -147,8 +147,8 @@ namespace libtorrent #else int m_fd; #endif -#if defined TORRENT_WINDOWS || defined TORRENT_DEBUG - void init_file(); +#if defined TORRENT_WINDOWS || defined TORRENT_LINUX || defined TORRENT_DEBUG + static void init_file(); static int m_page_size; #endif int m_open_mode; diff --git a/src/file.cpp b/src/file.cpp index 8606cec5d..c57dc4b4d 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -234,7 +234,7 @@ namespace libtorrent // defined in storage.cpp int bufs_size(file::iovec_t const* bufs, int num_bufs); -#if defined TORRENT_WINDOWS || defined TORRENT_DEBUG +#if defined TORRENT_WINDOWS || defined TORRENT_LINUX || defined TORRENT_DEBUG int file::m_page_size = 0; @@ -260,7 +260,7 @@ namespace libtorrent TORRENT_ASSERT(num_bufs > 0); TORRENT_ASSERT(is_open()); -#if defined TORRENT_WINDOWS || defined TORRENT_DEBUG +#if defined TORRENT_WINDOWS || defined TORRENT_LINUX || defined TORRENT_DEBUG // make sure m_page_size is initialized init_file(); #endif @@ -417,7 +417,7 @@ namespace libtorrent TORRENT_ASSERT(num_bufs > 0); TORRENT_ASSERT(is_open()); -#if defined TORRENT_WINDOWS || defined TORRENT_DEBUG +#if defined TORRENT_WINDOWS || defined TORRENT_LINUX || defined TORRENT_DEBUG // make sure m_page_size is initialized init_file(); #endif