From 5b11a240c1f5a607b031cc7a2feb4a6af34c8282 Mon Sep 17 00:00:00 2001 From: weidai Date: Thu, 31 Jul 2003 01:56:19 +0000 Subject: workaround alpha build problem git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@122 57ff6487-cd31-0410-9ec3-f628ee90f5f0 --- cryptlib.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'cryptlib.cpp') diff --git a/cryptlib.cpp b/cryptlib.cpp index a4f972e..8cf68fb 100644 --- a/cryptlib.cpp +++ b/cryptlib.cpp @@ -145,16 +145,16 @@ void RandomNumberGenerator::DiscardBytes(unsigned int n) GenerateByte(); } -RandomNumberGenerator & NullRNG() +class ClassNullRNG : public RandomNumberGenerator { - class NullRNG : public RandomNumberGenerator - { - public: - std::string AlgorithmName() const {return "NullRNG";} - byte GenerateByte() {throw NotImplemented("NullRNG: NullRNG should only be passed to functions that don't need to generate random bytes");} - }; +public: + std::string AlgorithmName() const {return "NullRNG";} + byte GenerateByte() {throw NotImplemented("NullRNG: NullRNG should only be passed to functions that don't need to generate random bytes");} +}; - static NullRNG s_nullRNG; +RandomNumberGenerator & NullRNG() +{ + static ClassNullRNG s_nullRNG; return s_nullRNG; } -- cgit v1.2.1