Add macro checks for enable code for old gcc version (< 40800)

main/yubo-dev
Nuno 3 years ago
parent ab4aa7487c
commit 7129a8fa5f

@ -412,8 +412,13 @@ public:
Exception();
Exception(const std::string &reason);
Exception(const char *format, ...);
#if defined(NL_COMP_GCC) && (GCC_VERSION < 40800)
virtual ~Exception() throw() {}
virtual const char *what() const throw();
#else
virtual ~Exception() NL_OVERRIDE {}
virtual const char *what() const throw() NL_OVERRIDE;
#endif
};

@ -41,8 +41,11 @@ struct EFile : public EStream
EFile (const std::string& filename) : EStream( "Unknown file error in '"+filename+"'" ), Filename(filename) {}
EFile (const std::string& filename, const std::string& text, bool ) : EStream( text ), Filename(filename) {}
#if defined(NL_COMP_GCC) && (GCC_VERSION < 40800)
virtual ~EFile() throw() {}
#else
virtual ~EFile() NL_OVERRIDE {}
#endif
std::string Filename;
};

@ -81,7 +81,12 @@ struct EStream : public Exception
EStream( const IStream &f, const std::string& str );
#if defined(NL_COMP_GCC) && (GCC_VERSION < 40800)
virtual ~EStream() throw() {}
#else
virtual ~EStream() NL_OVERRIDE {}
#endif
// May Not be Filled...
std::string StreamName;

@ -290,8 +290,11 @@ class CObjectNumber : public CObject
public:
explicit CObjectNumber(double value);
explicit CObjectNumber(sint64 value);
double getNumberValue() const { return m_IsInteger ? m_Value.Integer : m_Value.Number; }
sint64 getIntegerValue() const { return m_IsInteger ? m_Value.Integer : m_Value.Number; }
virtual const char *getTypeAsString() const NL_OVERRIDE;
#if defined(NL_COMP_GCC) && (GCC_VERSION < 40800)
virtual const char *getTypeAsString() const;
virtual bool set(const std::string& key, sint64 value) NL_OVERRIDE;
virtual bool set(const std::string& key, double value) NL_OVERRIDE;
@ -301,14 +304,44 @@ public:
virtual CObject* clone() const NL_OVERRIDE;
double getNumberValue() const { return m_IsInteger ? m_Value.Integer : m_Value.Number; }
sint64 getIntegerValue() const { return m_IsInteger ? m_Value.Integer : m_Value.Number; }
virtual void dump(const std::string prefix = "", uint depth = 0) const;
virtual bool equal(const CObject* other) const;
#else
virtual const char *getTypeAsString() const NL_OVERRIDE;
virtual bool set(const std::string& key, sint64 value) NL_OVERRIDE;
virtual bool set(const std::string& key, double value) NL_OVERRIDE;
virtual bool set(const std::string& key, const std::string&value) NL_OVERRIDE;
virtual bool setObject(const std::string& key, CObject* value) NL_OVERRIDE;
virtual CObject* clone() const NL_OVERRIDE;
virtual void dump(const std::string prefix = "", uint depth = 0) const NL_OVERRIDE;
virtual bool equal(const CObject* other) const NL_OVERRIDE;
#endif
protected:
#if defined(NL_COMP_GCC) && (GCC_VERSION < 40800)
virtual void doSerialize(std::string& out, CSerializeContext& context) const;
virtual bool doIsNumber() const NL_OVERRIDE;
virtual double doToNumber() const NL_OVERRIDE;
virtual bool doIsInteger() const NL_OVERRIDE;
virtual sint64 doToInteger() const NL_OVERRIDE;
virtual std::string doToString() const NL_OVERRIDE;
virtual void inPlaceCopyTo(CObject &dest) const NL_OVERRIDE;
virtual void inPlaceCopy(const CObjectNumber &src) NL_OVERRIDE;
virtual void visitInternal(IObjectVisitor &visitor);
#else
virtual void doSerialize(std::string& out, CSerializeContext& context) const NL_OVERRIDE;
virtual bool doIsNumber() const NL_OVERRIDE;
@ -325,6 +358,7 @@ protected:
virtual void inPlaceCopy(const CObjectNumber &src) NL_OVERRIDE;
virtual void visitInternal(IObjectVisitor &visitor) NL_OVERRIDE;
#endif
private:
bool m_IsInteger;

Loading…
Cancel
Save