pike.git/
lib/
master.pike.in
Branch:
Tag:
Non-build tags
All tags
No tags
2010-12-23
2010-12-23 21:06:20 by Henrik Grubbström (Grubba) <grubba@grubba.org>
0e26166a1f0abe5872fd0118ef863104c0acf1a0 (
53
lines) (+
49
/-
4
)
[
Show
|
Annotate
]
Branch:
7.9
Added compatibility mode for Pike 7.8.
871:
/* No missing symbols. */ }
+
//! Pike 7.8 master compatibility interface.
+
//!
+
//! Most of the interface is implemented via mixin,
+
//! or overloading by more recent masters.
+
//!
+
//! This interface is used for compatibility with
+
//! Pike 7.7 and 7.8.
+
//!
+
//! @deprecated predef::MasterObject
+
//!
+
//! @seealso
+
//! @[get_compat_master()], @[master()], @[predef::MasterObject]
+
protected class Pike_7_8_master
+
{
+
inherit Pike_7_6_master;
+
+
local protected object Pike_7_8_compat_handler;
+
local mixed resolv_or_error(string identifier, string|void current_file,
+
void|object current_handler)
+
{
+
if (!Pike_7_8_compat_handler) {
+
Pike_7_8_compat_handler = global::get_compilation_handler(7, 8);
+
}
+
return Pike_7_8_compat_handler->resolv_or_error(identifier, current_file,
+
current_handler);
+
}
+
local mixed resolv(string identifier, string|void current_file)
+
{
+
if (!Pike_7_8_compat_handler) {
+
Pike_7_8_compat_handler = global::get_compilation_handler(7, 8);
+
}
+
return Pike_7_8_compat_handler->resolv(identifier, current_file);
+
}
+
object get_compat_master(int major, int minor)
+
{
+
if ((major < 7) || ((major == 7) && (minor < 7)))
+
return Pike_7_6_master::get_compat_master(major, minor);
+
// 7.5 & 7.6
+
if ((major == 7) && (minor < 9))
+
return this_program::this;
+
return get_compat_master(major, minor);
+
}
+
}
+
//! Namespaces for compat masters. //! //! This inherit is used to provide compatibility namespaces
878:
//! //! @seealso //! @[get_compat_master()]
-
protected inherit Pike_7_
6
_master;
+
protected inherit Pike_7_
8
_master;
//! @appears error //! Throws an error. A more readable version of the code
5851:
//! @[get_compilation_handler()], @[master()] object get_compat_master(int major, int minor) {
-
if ((major < 7) || ((major == 7) && (minor <
7
)))
-
return Pike_7_
6
_master::get_compat_master(major, minor);
-
// 7.
7
and later.
+
if ((major < 7) || ((major == 7) && (minor <
9
)))
+
return Pike_7_
8
_master::get_compat_master(major, minor);
+
// 7.
9
and later.
return this; }