+Version::Version()
+{
+ major = 0;
+ minor = 0;
+}
+
+Version::Version(unsigned short a, unsigned short i)
+{
+ major = a;
+ minor = i;
+}
+
+Version::Version(const string &s)
+{
+ vector<string> parts = split(s, '.');
+ major = lexical_cast<unsigned>(parts[0]);
+ minor = lexical_cast<unsigned>(parts[1]);
+}
+
+bool Version::operator>=(const Version &other) const
+{
+ return major>other.major || (major==other.major && minor>=other.minor);
+}
+
+
+Extension::Extension(const char *n, InitFunc f):
+ name(n),
+ init_func(f),
+ init_done(false),
+ support(UNSUPPORTED)
+{ }
+
+Extension::operator bool() const
+{
+ if(!init_done)
+ {
+ support = init_func();
+ init_done = true;
+ }
+
+ return support>UNSUPPORTED;
+}
+
+
+Require::Require(const Extension &ext)
+{
+ if(!ext)
+ throw unsupported_extension(ext.get_name());
+}
+
+