From 17de69834e9f8f8484d6f551903c2754f9398249 Mon Sep 17 00:00:00 2001 From: Maarten Billemont Date: Wed, 30 Aug 2017 13:27:59 -0400 Subject: [PATCH] Declare __unused if not declared by compiler. --- core/c/mpw-algorithm_v0.c | 2 +- core/c/mpw-types.h | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/core/c/mpw-algorithm_v0.c b/core/c/mpw-algorithm_v0.c index b98b474f..5dc7708b 100644 --- a/core/c/mpw-algorithm_v0.c +++ b/core/c/mpw-algorithm_v0.c @@ -126,7 +126,7 @@ static MPSiteKey mpw_siteKey_v0( } static const char *mpw_sitePasswordFromTemplate_v0( - MPMasterKey __unused masterKey, MPSiteKey siteKey, MPResultType resultType, const char __unused *resultParam) { + MPMasterKey __unused masterKey, MPSiteKey siteKey, MPResultType resultType, const char __unused *resultParam) { const char *_siteKey = (const char *)siteKey; diff --git a/core/c/mpw-types.h b/core/c/mpw-types.h index 0318b3a7..990e6fef 100644 --- a/core/c/mpw-types.h +++ b/core/c/mpw-types.h @@ -29,6 +29,10 @@ #define mpw_enum(_type, _name) _type _name; enum #endif +#ifndef __unused +#define __unused __attribute__((unused)) +#endif + //// Types. #define MPMasterKeySize 64 /* bytes */