Branch: Tag:

2000-09-26

2000-09-26 22:19:03 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

basic 0.6 compatibility implemented

Rev: lib/0.6/modules/Array.pmod:1.1
Rev: lib/0.6/modules/__default.pmod:1.1
Rev: lib/0.6/modules/readline.pmod:1.1
Rev: lib/master.pike.in:1.133
Rev: src/docode.c:1.83
Rev: src/language.yacc:1.214
Rev: src/las.c:1.216

1:   /* -*- Pike -*-    * -  * $Id: master.pike.in,v 1.132 2000/09/26 18:58:56 hubbe Exp $ +  * $Id: master.pike.in,v 1.133 2000/09/26 22:19:00 hubbe Exp $    *    * Master-file for Pike.    *
948:    mixed resolv_base(string identifier, string|void current_file)    {    array(mixed) tmp = ({}); +  string dir=current_file ? dirname(current_file) : "/";    foreach(pike_module_path, string path)    { -  string file=combine_path(path,identifier); +  string file=combine_path(dir ,path,identifier);    if(mixed ret=findmodule(file)) {    if ((objectp(ret)) &&    (ret->is_resolv_dirnode || ret->is_resolv_joinnode)) {
993:    if( !zero_type (ret = resolv_cache[id]) )    return ret == ZERO_TYPE ? UNDEFINED : resolv_cache[id];    array(string) tmp=identifier/"."; -  ret=resolv_base(tmp[0]); +  ret=resolv_base(tmp[0],current_file);    foreach(tmp[1..],string index) ret=ret[index];    resolv_cache[id] = zero_type (ret) ? ZERO_TYPE : ret;    return ret;
1966:    minor=min;    }    - #define CMP(X) (major - (X)->major) || (minor - (X)->minor) + #define CMP(X) ((major - (X)->major) || (minor - (X)->minor))       int `<(Version v) { return CMP(v) < 0; }    int `>(Version v) { return CMP(v) > 0; }
2049:   #endif       ret=CompatResolver(v); -  if( v < Version(0,6)) -  ret->pike_module_path+=({"."}); +  /* Add default paths */ +  ret->pike_module_path=pike_module_path; +  ret->pike_include_path=pike_include_path;    -  foreach(available, Version v) +  foreach(reverse(available), Version tmp)    {    string base;   #if "¤lib_prefix¤"[0]!='¤' -  base=combine_path("¤lib_prefix¤",sprintf("%s",v)); +  base=combine_path("¤lib_prefix¤",sprintf("%s",tmp));    ret->add_module_path(combine_path(base,"modules"));    ret->add_include_path(combine_path(base,"include"));   #endif      #if "¤share_prefix¤"[0]!='¤' -  base=combine_path("¤share_prefix¤",sprintf("%s",v)); +  base=combine_path("¤share_prefix¤",sprintf("%s",tmp));    ret->add_module_path(combine_path(base,"modules"));    ret->add_include_path(combine_path(base,"include"));   #endif    }    -  /* Add default paths */ -  map(pike_module_path,ret->add_module_path); -  map(pike_include_path,ret->add_include_path); +  if( v <= Version(0,6)) +  ret->pike_module_path+=({"."});       compat_handler_cache[v] = ret;