From 3976184d34be50a1051a1018cb961b19ad61092f Mon Sep 17 00:00:00 2001 From: "gtm.daemon" Date: Thu, 2 Sep 2010 21:06:38 +0000 Subject: [Author: dmaclach] Add a GTM_UNUSED macro to deal with issue on the mailing lists. R=thomasvl DELTA=7 (7 added, 0 deleted, 0 changed) --- Foundation/GTMObjectSingleton.h | 5 +++-- GTMDefines.h | 6 ++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Foundation/GTMObjectSingleton.h b/Foundation/GTMObjectSingleton.h index 4763b68..e6ef28e 100644 --- a/Foundation/GTMObjectSingleton.h +++ b/Foundation/GTMObjectSingleton.h @@ -7,9 +7,9 @@ // Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance with the License. You may obtain a copy // of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -66,6 +66,7 @@ static _object_name_ *z##_shared_obj_name_ = nil; \ return self; \ } \ - (id)copyWithZone:(NSZone *)zone { \ + GTM_UNUSED(zone); \ return self; \ } \ diff --git a/GTMDefines.h b/GTMDefines.h index c8685d9..c033d6f 100644 --- a/GTMDefines.h +++ b/GTMDefines.h @@ -98,6 +98,12 @@ #define GTM_EXPORT __attribute__((visibility("default"))) #endif +// Give ourselves a consistent way of declaring something as unused. This +// doesn't use __unused because that is only supported in gcc 4.2 and greater. +#if !defined (GTM_UNUSED) +#define GTM_UNUSED(x) ((void)(x)) +#endif + // _GTMDevLog & _GTMDevAssert // // _GTMDevLog & _GTMDevAssert are meant to be a very lightweight shell for -- cgit v1.2.3