From 44e22417bf7eb1f317de5392e74349c56dda1679 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Wed, 15 Jan 2020 01:33:36 +0300 Subject: mingw builds: implement proper unused parameter macro The UNREFERENCED_PARAMETER macro distributed with MinGW-w64 is stupid (`(x) = (x)`, really?) --- include/pdb/handle.hpp | 4 +++- include/pdb/workarounds.hpp | 8 ++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 include/pdb/workarounds.hpp diff --git a/include/pdb/handle.hpp b/include/pdb/handle.hpp index 7c0cc40..511ef90 100644 --- a/include/pdb/handle.hpp +++ b/include/pdb/handle.hpp @@ -5,6 +5,8 @@ #pragma once +#include "workarounds.hpp" + #include #include @@ -18,7 +20,7 @@ struct CloseHandle { return; const auto ret = ::CloseHandle(raw); assert(ret); - UNREFERENCED_PARAMETER(ret); + PDB_UNUSED_PARAMETER(ret); } }; diff --git a/include/pdb/workarounds.hpp b/include/pdb/workarounds.hpp new file mode 100644 index 0000000..00bd5c5 --- /dev/null +++ b/include/pdb/workarounds.hpp @@ -0,0 +1,8 @@ +// Copyright (c) 2020 Egor Tensin +// This file is part of the "PDB repository" project. +// For details, see https://github.com/egor-tensin/pdb-repo. +// Distributed under the MIT License. + +#pragma once + +#define PDB_UNUSED_PARAMETER(...) (void)(__VA_ARGS__) -- cgit v1.2.3