This commit is contained in:
Ivan Bondarev 2021-12-19 12:13:59 +01:00
parent 5f8aa5332b
commit 24a40ea8c0
7 changed files with 15 additions and 6 deletions

View file

@ -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?

View file

@ -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)

View file

@ -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;

Binary file not shown.

View file

@ -0,0 +1,4 @@
unit u_lib1;
{$reference ClassLibrary1.dll}
var r: ClassLibrary1.Rec1;
end.

Binary file not shown.

View file

@ -0,0 +1 @@
uses u_lib1; begin end.