fix #2576
This commit is contained in:
parent
5f8aa5332b
commit
24a40ea8c0
|
|
@ -2619,12 +2619,13 @@ namespace PascalABCCompiler
|
|||
return null;
|
||||
}
|
||||
|
||||
public static string GetReferenceFileName(string FileName)
|
||||
public static string GetReferenceFileName(string FileName, string curr_path=null)
|
||||
{
|
||||
// Вначале - кешированные стандартные dll
|
||||
if (standart_assembly_dict.ContainsKey(FileName))
|
||||
return standart_assembly_dict[FileName];
|
||||
|
||||
if (curr_path != null && System.IO.File.Exists(Path.Combine(curr_path, FileName)))
|
||||
return Path.Combine(curr_path, FileName);
|
||||
if (System.IO.File.Exists(FileName))
|
||||
{
|
||||
return FileName;//.ToLower();//? а надо ли tolover?
|
||||
|
|
|
|||
|
|
@ -666,7 +666,7 @@ namespace PascalABCCompiler.PCU
|
|||
string tmp = s.Substring(0, s.IndexOf(','));
|
||||
//if (tmp != "mscorlib")
|
||||
//{
|
||||
string name_with_path = Compiler.GetReferenceFileName(tmp + ".dll");
|
||||
string name_with_path = Compiler.GetReferenceFileName(tmp + ".dll", Path.GetDirectoryName(this.FileName));
|
||||
//Assembly a = Assembly.LoadFrom(name_with_path);
|
||||
/*if (pcu_file.compiler_directives != null)
|
||||
foreach (compiler_directive cd in pcu_file.compiler_directives)
|
||||
|
|
|
|||
|
|
@ -10988,7 +10988,7 @@ begin
|
|||
end;
|
||||
end;
|
||||
|
||||
/// Есть ли элемент в матрице
|
||||
/// Равны ли матрицы
|
||||
function MatrEqual<T>(Self,b: array[,] of T): boolean; extensionmethod := MatrEqual(Self,b);
|
||||
|
||||
/// Вывод двумерного массива, w - ширина поля вывода
|
||||
|
|
@ -14122,12 +14122,15 @@ procedure __InitModule;
|
|||
begin
|
||||
try
|
||||
DefaultEncoding := Encoding.GetEncoding(1251);
|
||||
if (System.Environment.OSVersion.Version.Major >= 6) and (System.Environment.OSVersion.Version.Minor >= 2) then
|
||||
System.Console.OutputEncoding := Encoding.UTF8;
|
||||
except
|
||||
//DefaultEncoding := Encoding.UTF8;
|
||||
DefaultEncoding := new System.Text.UTF8Encoding(false)
|
||||
end;
|
||||
try
|
||||
if (System.Environment.OSVersion.Version.Major >= 6) and (System.Environment.OSVersion.Version.Minor >= 2) then
|
||||
System.Console.OutputEncoding := Encoding.UTF8;
|
||||
except
|
||||
end;
|
||||
rnd := new System.Random;
|
||||
|
||||
CurrentIOSystem := new IOStandardSystem;
|
||||
|
|
|
|||
BIN
TestSuite/units/ClassLibrary1.dll
Normal file
BIN
TestSuite/units/ClassLibrary1.dll
Normal file
Binary file not shown.
4
TestSuite/units/u_lib1.pas
Normal file
4
TestSuite/units/u_lib1.pas
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
unit u_lib1;
|
||||
{$reference ClassLibrary1.dll}
|
||||
var r: ClassLibrary1.Rec1;
|
||||
end.
|
||||
BIN
TestSuite/usesunits/ClassLibrary1.dll
Normal file
BIN
TestSuite/usesunits/ClassLibrary1.dll
Normal file
Binary file not shown.
1
TestSuite/usesunits/use_lib1.pas
Normal file
1
TestSuite/usesunits/use_lib1.pas
Normal file
|
|
@ -0,0 +1 @@
|
|||
uses u_lib1; begin end.
|
||||
Loading…
Reference in a new issue