diff options
author | Andargor <dejan@lofts.net> | 2016-03-03 06:15:39 +0300 |
---|---|---|
committer | Andargor <dejan@lofts.net> | 2016-03-03 06:15:39 +0300 |
commit | ecff93ee398fea033d2aa96c2b2df76e5f7893c1 (patch) | |
tree | 80210296502450da3ae47daabb00b28afa36633e | |
parent | 095f7a485afe56918efcfb4e333707a0218c13e1 (diff) |
Fix for failed checks on unused parameters
-rwxr-xr-x | tinydir.h | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -75,6 +75,16 @@ extern "C" { #define _TINYDIR_FREE(_ptr) free(_ptr) #endif //!defined(_TINYDIR_MALLOC) +/* avoid warnings due to unused variables or parameters */ +#ifndef _MSC_VER + #if !defined(_TINYDIR_UNUSED) + #ifdef __GNUC__ + #define _TINYDIR_UNUSED(x) _TINYDIR_UNUSED_ ## x __attribute__((__unused__)) + #else + #define _TINYDIR_UNUSED(x) _TINYDIR_UNUSED_ ## x + #endif + #endif +#endif #ifndef _MSC_VER /* @@ -93,10 +103,11 @@ extern "C" { * AC_CHECK_FUNCS list. Otherwise use some other method to detect * * and use them where available. */ -static size_t dirent_buf_size(DIR *dirp) +static size_t dirent_buf_size(DIR * _TINYDIR_UNUSED(dirp)) { long name_max; size_t name_end; + # if defined(HAVE_FPATHCONF) && defined(HAVE_DIRFD) \ && defined(_PC_NAME_MAX) name_max = fpathconf(dirfd(dirp), _PC_NAME_MAX); |