From 798444e4fd1a02ca9fa8999121370391a36a6124 Mon Sep 17 00:00:00 2001 From: Raymond Date: Fri, 22 Jan 2010 19:11:17 +0000 Subject: [PATCH] Added compiler directives for Ansi-string, fixed use of PChar to behave accordingly. git-svn-id: http://www.villavu.com/repositories/merlijn/mufasa@450 3f818213-9676-44b0-a9b4-5e4c4e03d09d --- trunk/Units/MMLCore/iomanager.pas | 5 +++-- trunk/Units/MMLCore/libloader.pas | 2 +- trunk/Units/MMLCore/os_linux.pas | 2 +- trunk/Units/MMLCore/os_windows.pas | 1 + 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/trunk/Units/MMLCore/iomanager.pas b/trunk/Units/MMLCore/iomanager.pas index ecee64b..c6ec16e 100644 --- a/trunk/Units/MMLCore/iomanager.pas +++ b/trunk/Units/MMLCore/iomanager.pas @@ -21,6 +21,7 @@ Input/Output manager for Mufasa Macro Library } +{$mode objfpc}{$H+} unit IOManager; interface @@ -370,7 +371,7 @@ implementation procedure TIOManager_Abstract.KeyUp(key: Word); begin keymouse.ReleaseKey(key) end; procedure TIOManager_Abstract.KeyDown(key: Word); begin keymouse.HoldKey(key) end; procedure TIOManager_Abstract.PressKey(key: Word); begin keyup(key); keydown(key); end; - procedure TIOManager_Abstract.SendText(text: string); begin keymouse.SendString(PChar(@text[1])); end; + procedure TIOManager_Abstract.SendText(text: string); begin keymouse.SendString(text); end; function TIOManager_Abstract.isKeyDown(key: Word): Boolean; begin result:= keymouse.IsKeyHeld(key); end; //***implementation*** TTarget @@ -479,7 +480,7 @@ implementation procedure TEIOS_Target.SendString(str: string); begin if Pointer(client.SendString) <> nil then - client.SendString(target,PChar(@str[1])) + client.SendString(target,PChar(str)) else inherited SendString(str); end; diff --git a/trunk/Units/MMLCore/libloader.pas b/trunk/Units/MMLCore/libloader.pas index ef580af..0867139 100644 --- a/trunk/Units/MMLCore/libloader.pas +++ b/trunk/Units/MMLCore/libloader.pas @@ -132,7 +132,7 @@ implementation SetLength(Loaded,PluginLen + 1); Writeln(Format('Loading plugin %s at %s',[PluginName,PluginDirs.Strings[ii]])); Loaded[PluginLen].filename:= PluginDirs.Strings[ii] + Pluginname + PlugExt; - Loaded[PluginLen].handle:= LoadLibrary(PChar(@Loaded[PluginLen].filename[1])); + Loaded[PluginLen].handle:= LoadLibrary(Loaded[PluginLen].filename); if Loaded[PluginLen].handle = 0 then Raise Exception.CreateFMT('Error loading plugin %s',[Loaded[PluginLen].filename]); if InitPlugin(Loaded[PluginLen].handle) then diff --git a/trunk/Units/MMLCore/os_linux.pas b/trunk/Units/MMLCore/os_linux.pas index ae61e4f..8dc94e3 100644 --- a/trunk/Units/MMLCore/os_linux.pas +++ b/trunk/Units/MMLCore/os_linux.pas @@ -20,7 +20,7 @@ Linux OS specific implemetation for Mufasa Macro Library } - +{$mode objfpc}{$H+} unit os_linux; interface diff --git a/trunk/Units/MMLCore/os_windows.pas b/trunk/Units/MMLCore/os_windows.pas index 4289744..b748f4f 100644 --- a/trunk/Units/MMLCore/os_windows.pas +++ b/trunk/Units/MMLCore/os_windows.pas @@ -21,6 +21,7 @@ Windows OS specific implementation for Mufasa Macro Library } +{$mode objfpc}{$H+} unit os_windows; interface