From efd9e987f52e33d83ef1da5c70bedcf13a8f96b0 Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Tue, 4 Aug 2015 18:53:18 +0200 Subject: [PATCH 1/2] windows fixes --- include/pybind/pybind.h | 2 +- tools/mkdoc.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/pybind/pybind.h b/include/pybind/pybind.h index de496fbd..55a5d6db 100644 --- a/include/pybind/pybind.h +++ b/include/pybind/pybind.h @@ -103,7 +103,7 @@ private: PyObject *pyArgs, PyObject *kwargs, bool is_method, detail::index_sequence) { int index = is_method ? 1 : 0; int unused[] = { 0, (process_extra(std::get(args), index, pyArgs, kwargs), 0)... }; - (void) unused; + (void) unused; (void) index; } static void process_extra(const char *doc, function_entry *entry, const char **, const char **) { entry->doc = doc; } diff --git a/tools/mkdoc.py b/tools/mkdoc.py index d1b61c9b..09c09cfb 100644 --- a/tools/mkdoc.py +++ b/tools/mkdoc.py @@ -203,8 +203,9 @@ if __name__ == '__main__': Do not edit! These were automatically extracted by mkdoc.py */ +#define __EXPAND(x) x #define __COUNT(_1, _2, _3, _4, _5, COUNT, ...) COUNT -#define __VA_SIZE(...) __COUNT(__VA_ARGS__, 5, 4, 3, 2, 1) +#define __VA_SIZE(...) __EXPAND(__COUNT(__VA_ARGS__, 5, 4, 3, 2, 1)) #define __CAT1(a, b) a ## b #define __CAT2(a, b) __CAT1(a, b) #define __DOC1(n1) __doc_##n1 @@ -212,7 +213,7 @@ if __name__ == '__main__': #define __DOC3(n1, n2, n3) __doc_##n1##_##n2##_##n3 #define __DOC4(n1, n2, n3, n4) __doc_##n1##_##n2##_##n3##_##n4 #define __DOC5(n1, n2, n3, n4, n5) __doc_##n1##_##n2##_##n3##_##n4_##n5 -#define DOC(...) __CAT2(__DOC, __VA_SIZE(__VA_ARGS__))(__VA_ARGS__) +#define DOC(...) __EXPAND(__EXPAND(__CAT2(__DOC, __VA_SIZE(__VA_ARGS__)))(__VA_ARGS__)) #if defined(__GNUG__) #pragma GCC diagnostic push From d85215c18de1bc3355d76477d57d71457bee349c Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Tue, 4 Aug 2015 19:03:53 +0200 Subject: [PATCH 2/2] quench clang warnings --- include/pybind/pybind.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/pybind/pybind.h b/include/pybind/pybind.h index de496fbd..ecf06dbd 100644 --- a/include/pybind/pybind.h +++ b/include/pybind/pybind.h @@ -16,7 +16,7 @@ #pragma warning(disable: 4996) // warning C4996: The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name #pragma warning(disable: 4100) // warning C4100: Unreferenced formal parameter #pragma warning(disable: 4512) // warning C4512: Assignment operator was implicitly defined as deleted -#elif defined(__GNUG__) +#elif defined(__GNUG__) and !defined(__clang__) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-but-set-parameter" #pragma GCC diagnostic ignored "-Wunused-but-set-variable" @@ -818,7 +818,7 @@ NAMESPACE_END(pybind) #if defined(_MSC_VER) #pragma warning(pop) -#elif defined(__GNUG__) +#elif defined(__GNUG__) and !defined(__clang__) #pragma GCC diagnostic pop #endif