summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/error.h
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2010-02-17 22:40:05 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2010-02-17 22:40:05 +0100
commit9fcbe2047293f8ef703439264ed3d35701f51638 (patch)
tree5669db5c2fd2caf7274ff751f9e6a22311f09273 /apt-pkg/contrib/error.h
parent424d785b672f80a0f1a5b6ab4a858c48f4c49bfd (diff)
parent762d7367f5f74f877ec75986e19fc9d46eef5164 (diff)
merged from the mvo branch
Diffstat (limited to 'apt-pkg/contrib/error.h')
-rw-r--r--apt-pkg/contrib/error.h28
1 files changed, 7 insertions, 21 deletions
diff --git a/apt-pkg/contrib/error.h b/apt-pkg/contrib/error.h
index a3be6a575..90747ff7e 100644
--- a/apt-pkg/contrib/error.h
+++ b/apt-pkg/contrib/error.h
@@ -40,26 +40,15 @@
#ifndef PKGLIB_ERROR_H
#define PKGLIB_ERROR_H
+#include <apt-pkg/macros.h>
-
-#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 <string>
-using std::string;
-
class GlobalError
{
struct Item
{
- string Text;
+ std::string Text;
bool Error;
Item *Next;
};
@@ -71,18 +60,18 @@ class GlobalError
public:
// Call to generate an error from a library call.
- bool Errno(const char *Function,const char *Description,...) APT_MFORMAT2;
- bool WarningE(const char *Function,const char *Description,...) APT_MFORMAT2;
+ bool Errno(const char *Function,const char *Description,...) __like_printf_2 __cold;
+ bool WarningE(const char *Function,const char *Description,...) __like_printf_2 __cold;
/* A warning should be considered less severe than an error, and may be
ignored by the client. */
- bool Error(const char *Description,...) APT_MFORMAT1;
- bool Warning(const char *Description,...) APT_MFORMAT1;
+ bool Error(const char *Description,...) __like_printf_1 __cold;
+ bool Warning(const char *Description,...) __like_printf_1 __cold;
// Simple accessors
inline bool PendingError() {return PendingFlag;};
inline bool empty() {return List == 0;};
- bool PopMessage(string &Text);
+ bool PopMessage(std::string &Text);
void Discard();
// Usefull routine to dump to cerr
@@ -95,7 +84,4 @@ class GlobalError
GlobalError *_GetErrorObj();
#define _error _GetErrorObj()
-#undef APT_MFORMAT1
-#undef APT_MFORMAT2
-
#endif