Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/cxong/tinydir.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndargor <dejan@lofts.net>2016-03-03 06:15:39 +0300
committerAndargor <dejan@lofts.net>2016-03-03 06:15:39 +0300
commitecff93ee398fea033d2aa96c2b2df76e5f7893c1 (patch)
tree80210296502450da3ae47daabb00b28afa36633e
parent095f7a485afe56918efcfb4e333707a0218c13e1 (diff)
Fix for failed checks on unused parameters
-rwxr-xr-xtinydir.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/tinydir.h b/tinydir.h
index 4e1f827..1644da1 100755
--- a/tinydir.h
+++ b/tinydir.h
@@ -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);