aboutsummaryrefslogtreecommitdiffstats
path: root/src/x509stat.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2006-09-10 03:18:35 +0000
committerlloyd <[email protected]>2006-09-10 03:18:35 +0000
commit3af61dd588df052eb100e0c581860edfc1cb09c3 (patch)
tree1d9466c23241e8963f9be567496716348887ab5a /src/x509stat.cpp
parent9e26ffdb32e39ed58b99ab5f0a4f4dc2496127fc (diff)
Hack around some Visual Studio bugs that I can't seem to find good solutions
for.
Diffstat (limited to 'src/x509stat.cpp')
-rw-r--r--src/x509stat.cpp26
1 files changed, 15 insertions, 11 deletions
diff --git a/src/x509stat.cpp b/src/x509stat.cpp
index 3ea431962..059e43414 100644
--- a/src/x509stat.cpp
+++ b/src/x509stat.cpp
@@ -34,17 +34,21 @@ Certificate_Extension* X509_GlobalState::get_extension(const OID& oid) const
*************************************************/
X509_GlobalState::X509_GlobalState()
{
-#define CREATE_PROTOTYPE(NAME, TYPE) \
- struct TYPE ## _Prototype : public Extension_Prototype \
- { \
- Certificate_Extension* make(const OID& oid) \
- { \
- if(oid == OIDS::lookup(NAME)) \
- return new Cert_Extension::TYPE(); \
- return 0; \
- } \
- }; \
- add(new TYPE ## _Prototype);
+
+#define CREATE_PROTOTYPE(NAME, TYPE) \
+ do { \
+ struct TYPE ## _Prototype : public Extension_Prototype \
+ { \
+ Certificate_Extension* make(const OID& oid) \
+ { \
+ if(OIDS::name_of(oid, NAME)) \
+ return new Cert_Extension::TYPE(); \
+ return 0; \
+ } \
+ }; \
+ \
+ add(new TYPE ## _Prototype); \
+ } while(0);
CREATE_PROTOTYPE("X509v3.KeyUsage", Key_Usage);
CREATE_PROTOTYPE("X509v3.BasicConstraints", Basic_Constraints);