diff --git a/src/fs_base_fadvise.cpp b/src/fs_base_fadvise.cpp index 31d77537..8b5248d9 100644 --- a/src/fs_base_fadvise.cpp +++ b/src/fs_base_fadvise.cpp @@ -22,6 +22,30 @@ # include "fs_base_fadvise_unsupported.icpp" #endif +#ifndef POSIX_FADV_NORMAL +# define POSIX_FADV_NORMAL 0 +#endif + +#ifndef POSIX_FADV_RANDOM +# define POSIX_FADV_RANDOM 1 +#endif + +#ifndef POSIX_FADV_SEQUENTIAL +# define POSIX_FADV_SEQUENTIAL 2 +#endif + +#ifndef POSIX_FADV_WILLNEED +# define POSIX_FADV_WILLNEED 3 +#endif + +#ifndef POSIX_FADV_DONTNEED +# define POSIX_FADV_DONTNEED 4 +#endif + +#ifndef POSIX_FADV_NOREUSE +# define POSIX_FADV_NOREUSE 5 +#endif + namespace fs { int diff --git a/src/fs_base_fadvise.hpp b/src/fs_base_fadvise.hpp index 4d6910a1..ce9fc605 100644 --- a/src/fs_base_fadvise.hpp +++ b/src/fs_base_fadvise.hpp @@ -14,41 +14,11 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#ifndef __FS_FADVISE_HPP__ -#define __FS_FADVISE_HPP__ - -#ifndef POSIX_FADV_NORMAL -# define POSIX_FADV_NORMAL 0 -#endif - -#ifndef POSIX_FADV_RANDOM -# define POSIX_FADV_RANDOM 1 -#endif - -#ifndef POSIX_FADV_SEQUENTIAL -# define POSIX_FADV_SEQUENTIAL 2 -#endif - -#ifndef POSIX_FADV_WILLNEED -# define POSIX_FADV_WILLNEED 3 -#endif - -#ifndef POSIX_FADV_DONTNEED -# define POSIX_FADV_DONTNEED 4 -#endif - -#ifndef POSIX_FADV_NOREUSE -# define POSIX_FADV_NOREUSE 5 -#endif +#ifndef __FS_BASE_FADVISE_HPP__ +#define __FS_BASE_FADVISE_HPP__ namespace fs { - int - fadvise(const int fd, - const off_t offset, - const off_t len, - const int advice); - int fadvise_dontneed(const int fd, const off_t offset = 0, diff --git a/src/fs_base_fadvise_posix.icpp b/src/fs_base_fadvise_posix.icpp index 1475285d..d1b115eb 100644 --- a/src/fs_base_fadvise_posix.icpp +++ b/src/fs_base_fadvise_posix.icpp @@ -20,6 +20,7 @@ namespace fs { + static int fadvise(const int fd, const off_t offset, diff --git a/src/fs_base_fadvise_unsupported.icpp b/src/fs_base_fadvise_unsupported.icpp index 50701842..544cbd3a 100644 --- a/src/fs_base_fadvise_unsupported.icpp +++ b/src/fs_base_fadvise_unsupported.icpp @@ -18,6 +18,7 @@ namespace fs { + static int fadvise(const int fd, const off_t offset,