Skip to content

Commit

Permalink
add #warning to make it more obvious what versions of functions are used
Browse files Browse the repository at this point in the history
  • Loading branch information
trapexit committed Aug 18, 2020
1 parent 2fe20b8 commit 7fd629e
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 18 deletions.
6 changes: 4 additions & 2 deletions src/fs_attr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
*/

#ifdef __linux__
# include "fs_attr_linux.icpp"
#warning "using fs_attr_linux.icpp"
#include "fs_attr_linux.icpp"
#else
# include "fs_attr_unsupported.icpp"
#warning "using fs_attr_unsupported.icpp"
#include "fs_attr_unsupported.icpp"
#endif
6 changes: 4 additions & 2 deletions src/fs_copy_file_range.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
*/

#ifdef __linux__
# include "fs_copy_file_range_linux.icpp"
#warning "using fs_copy_file_range_linux.icpp"
#include "fs_copy_file_range_linux.icpp"
#else
# include "fs_copy_file_range_unsupported.icpp"
#warning "using fs_copy_file_range_unsupported.icpp"
#include "fs_copy_file_range_unsupported.icpp"
#endif
6 changes: 4 additions & 2 deletions src/fs_fadvise.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@
#include <fcntl.h>

#if _XOPEN_SOURCE >= 600 || _POSIX_C_SOURCE >= 200112L
# include "fs_fadvise_posix.icpp"
#warning "using fs_fadvise_posix.icpp"
#include "fs_fadvise_posix.icpp"
#else
# include "fs_fadvise_unsupported.icpp"
#warning "using fs_fadvise_unsupported.icpp"
#include "fs_fadvise_unsupported.icpp"
#endif

#ifndef POSIX_FADV_NORMAL
Expand Down
6 changes: 4 additions & 2 deletions src/fs_ficlone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
*/

#ifdef __linux__
# include "fs_ficlone_linux.icpp"
#warning "using fs_ficlone_linux.icpp"
#include "fs_ficlone_linux.icpp"
#else
# include "fs_ficlone_unsupported.icpp"
#warning "using fs_ficlone_unsupported.icpp"
#include "fs_ficlone_unsupported.icpp"
#endif
9 changes: 6 additions & 3 deletions src/fs_futimens.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,14 @@
#include <sys/stat.h>

#ifdef __linux__
# include "fs_futimens_linux.hpp"
#warning "using fs_futimens_linux.hpp"
#include "fs_futimens_linux.hpp"
#elif __FreeBSD__ >= 11
# include "fs_futimens_freebsd_11.hpp"
#warning "using fs_futimens_freebsd_11.hpp"
#include "fs_futimens_freebsd_11.hpp"
#else
# include "fs_futimens_generic.hpp"
#warning "using fs_futimens_generic.hpp"
#include "fs_futimens_generic.hpp"
#endif

namespace fs
Expand Down
6 changes: 4 additions & 2 deletions src/fs_futimesat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
*/

#if __APPLE__
# include "fs_futimesat_osx.icpp"
#warning "using fs_futimesat_osx.icpp"
#include "fs_futimesat_osx.icpp"
#else
# include "fs_futimesat_generic.icpp"
#warning "using fs_futimesat_generic.icpp"
#include "fs_futimesat_generic.icpp"
#endif
6 changes: 4 additions & 2 deletions src/fs_sendfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
*/

#ifdef __linux__
# include "fs_sendfile_linux.icpp"
#warning "using fs_sendfile_linux.icpp"
#include "fs_sendfile_linux.icpp"
#else
# include "fs_sendfile_unsupported.icpp"
#warning "using fs_sendfile_unsupported.icpp"
#include "fs_sendfile_unsupported.icpp"
#endif
9 changes: 6 additions & 3 deletions src/fs_utimensat.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@
#pragma once

#ifdef __linux__
# include "fs_utimensat_linux.hpp"
#warning "using fs_utimensat_linux.hpp"
#include "fs_utimensat_linux.hpp"
#elif __FreeBSD__
# include "fs_utimensat_freebsd.hpp"
#warning "using fs_utimensat_freebsd.hpp"
#include "fs_utimensat_freebsd.hpp"
#else
# include "fs_utimensat_generic.hpp"
#warning "using fs_utimensat_generic.hpp"
#include "fs_utimensat_generic.hpp"
#endif
2 changes: 2 additions & 0 deletions src/ugid.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ namespace ugid
}

#if defined __linux__ and UGID_USE_RWLOCK == 0
#warning "using ugid_linux.hpp"
#include "ugid_linux.hpp"
#else
#warning "using ugid_rwlock.hpp"
#include "ugid_rwlock.hpp"
#endif

0 comments on commit 7fd629e

Please sign in to comment.