1 $NetBSD: patch-ah,v 1.3 2006/02/02 15:03:19 joerg Exp $
3 --- lib/Enum.h.orig 2002-08-10 20:47:05.000000000 +0200
13 @@ -257,7 +258,7 @@ public:
14 * XXX: throw OutOfRangeException ?
16 static E getValueFor(const std::string &s) {
17 - return (E) staticData.stringRep.lookup(s.getCStr());
18 + return (E) staticData.stringRep.lookup(s.c_str());
22 @@ -295,6 +296,20 @@ public:
24 * @author Henner Zeller
26 +#if defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
27 +#define ENUM_DEFINITION(EnumName, initWith) \
29 + * The definition of the static variable holding the static \
30 + * data for this Enumeration wrapper. \
32 +template <EnumName> Enum<EnumName>::sdata Enum<EnumName>::staticData; \
34 + * actual definition of the constructor for the static data. \
35 + * This is called implicitly by the definition above. \
37 +Enum<EnumName>::sdata::sdata() : \
38 +name(#EnumName),defaultValue(initWith)
40 #define ENUM_DEFINITION(EnumName, initWith) \
42 * The definition of the static variable holding the static \
43 @@ -307,6 +322,7 @@ Enum<EnumName>::sdata Enum<EnumName>::st
45 Enum<EnumName>::sdata::sdata() : \
46 name(#EnumName),defaultValue(initWith)
50 * Writes enumeration's string representation.