From b2e465d6d32d2dc884f58b94acb7e35f671a87fe Mon Sep 17 00:00:00 2001 From: Arch Librarian Date: Mon, 20 Sep 2004 16:56:32 +0000 Subject: Join with aliencode Author: jgg Date: 2001-02-20 07:03:16 GMT Join with aliencode --- apt-pkg/contrib/error.h | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'apt-pkg/contrib/error.h') diff --git a/apt-pkg/contrib/error.h b/apt-pkg/contrib/error.h index bb42e73ba..0dc57927a 100644 --- a/apt-pkg/contrib/error.h +++ b/apt-pkg/contrib/error.h @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: error.h,v 1.6 1999/01/18 06:20:08 jgg Exp $ +// $Id: error.h,v 1.7 2001/02/20 07:03:17 jgg Exp $ /* ###################################################################### Global Erorr Class - Global error mechanism @@ -44,6 +44,15 @@ #pragma interface "apt-pkg/error.h" #endif +#ifdef __GNUG__ +// Methods have a hidden this parameter that is visible to this attribute +#define APT_MFORMAT1 __attribute__ ((format (printf, 2, 3))) +#define APT_MFORMAT2 __attribute__ ((format (printf, 3, 4))) +#else +#define APT_MFORMAT1 +#define APT_MFORMAT2 +#endif + #include class GlobalError @@ -62,13 +71,13 @@ class GlobalError public: // Call to generate an error from a library call. - bool Errno(const char *Function,const char *Description,...); - bool WarningE(const char *Function,const char *Description,...); + bool Errno(const char *Function,const char *Description,...) APT_MFORMAT2; + bool WarningE(const char *Function,const char *Description,...) APT_MFORMAT2; /* A warning should be considered less severe than an error, and may be ignored by the client. */ - bool Error(const char *Description,...); - bool Warning(const char *Description,...); + bool Error(const char *Description,...) APT_MFORMAT1; + bool Warning(const char *Description,...) APT_MFORMAT1; // Simple accessors inline bool PendingError() {return PendingFlag;}; @@ -86,4 +95,7 @@ class GlobalError GlobalError *_GetErrorObj(); #define _error _GetErrorObj() +#undef APT_MFORMAT1 +#undef APT_MFORMAT2 + #endif -- cgit v1.2.3