Re: [fpc-devel] procedure ... message(); in Linux

2010-02-25 Thread Mattias Gärtner

Zitat von Michael Schnell mschn...@lumino.de:


Can't anyone answer the question if in Linux the legal and compilable
construct

procedure... message;

either

is not supposed to be working

or

how I can have such a procedure be executed (e.g. by posting a message
from a thread or another application, what I successfully did in Windows.


Maybe if you provide a more complete example, some Linux users can help you.

Mattias



___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] procedure ... message(); in Linux

2010-02-25 Thread Nikolai Zhubr

25.02.2010 19:59, Michael Schnell:

Can't anyone answer the question if in Linux the legal and compilable
construct

procedure... message;

either

is not supposed to be working

Is is working fine on linux, see my example below.


or

how I can have such a procedure be executed (e.g. by posting a message
from a thread or another application, what I successfully did in Windows.

Some sort of IPC is necessary as a ground for that.
On windows, PostMessage/GetMessage mechanism is always available and it 
does not require any additional libraries (as it is an integral part of 
the system), so it is used most of the time.
On linux, there is no such global default (AFAICS), but you are free 
to choose some existing library or create your specific implementation 
based on OS functionality directly (like my favourite pipes or whatever).


Nikolai






-- cut ---
{$mode delphi}
{$ifdef win32 }{$apptype console }{$endif }
const
  const_my_msg = $7FFF;

type
  TMyMessage = record
Msg: Cardinal;
SomeData1: byte;
  end;

  TSomeTestObj = class
procedure msg_my_msg_proc(var Msg: TMyMessage); message const_my_msg;
  end;

procedure TSomeTestObj.msg_my_msg_proc(var Msg: TMyMessage);
begin
  writeln('I got called! SomeData1 = ', Msg.SomeData1);
end;

var
  o: TSomeTestObj;
  m: TMyMessage;
begin
  m.Msg := const_my_msg;
  m.SomeData1 := 1;
  o := TSomeTestObj.Create;
  o.Dispatch(m);
  o.Free;
end.
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


[fpc-devel] Native compilers for non-x86

2010-02-25 Thread Mark Morgan Lloyd
I'm having another of my periodic attempts at getting various systems 
up-to-date here, and I wonder if I could ask for help with build problems.


First machine is an ARM-based Linksys NSLU2 Slug, running Debian 
Squeeze i.e. little-endian EABI. I've previously managed to build for 
this using (I think) 2.5.1. I experimentally reverted to 2.4.0 but an 
attempt at building gave me


/bin/mkdir -p arm/units/arm-linux
/usr/local/bin/ppcarm -Ur -Xs -O2 -n -Fuarm -Fusystems 
-Fu/usr/local/src/fpc/fpcbuild-2.4.0/fpcsrc/rtl/units/arm-linux -Fiarm 
-FE. -FUarm/units/arm-linux -dRELEASE -O- -gl -vt -darm -dGDB 
-dBROWSERLOG  pp.pas

Using assembler: /usr/bin/as
cgobj.pas(3384,38) Warning: range check error while evaluating constants
pstatmnt.pas(547,39) Error: Call by var for arg no. 1 has to match 
exactly: Got ttempcreatenode expected tnode

pstatmnt.pas(1236) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
make[5]: *** [ppcarm] Error 1

Using trunk downloaded last night progresses further but eventually 
fails with


make -C pasjpeg smart
make[4]: Entering directory 
`/usr/local/src/fpc/fpcbuild/fpcsrc/packages/pasjpeg'

make all LINKSMART=1 CREATESMART=1
make[5]: Entering directory 
`/usr/local/src/fpc/fpcbuild/fpcsrc/packages/pasjpeg'

/bin/mkdir -p units/arm-linux
/usr/local/src/fpc/fpcbuild/fpcsrc/compiler/ppcarm -XX -CX -Ur -Xs -O2 
-n -Fu/usr/local/src/fpc/fpcbuild/fpcsrc/rtl/units/arm-linux -FE. 
-FUunits/arm-linux -O- -gl -vt -darm -dRELEASE src/buildpasjpeg.pp

Using assembler: /usr/bin/as
jdmarker.pas(17,2)  StaAn unhandled exception occurred at $000B6118 :
EAccessViolation : Access violation
  $000B6118  TSCANNERFILE__READCHAR,  line 2745 of scanner.pas
  $000B6CAC  TSCANNERFILE__SKIPSPACE,  line 3074 of scanner.pas
  $000B75FC  TSCANNERFILE__READTOKEN,  line 3398 of scanner.pas
  $001462B8  CONSUME,  line 133 of pbase.pas
  $0019557C  PROC_UNIT,  line 1301 of pmodules.pas
  $0017A3AC  COMPILE,  line 395 of parser.pas
  $001891C8  TPPUMODULE__LOADPPU,  line 1630 of fppu.pas
  $00193E3C  LOADUNITS,  line 767 of pmodules.pas
  $00194ED0  PROC_UNIT,  line 1135 of pmodules.pas
  $0017A3AC  COMPILE,  line 395 of parser.pas
  $001891C8  TPPUMODULE__LOADPPU,  line 1630 of fppu.pas
  $00193E3C  LOADUNITS,  line 767 of pmodules.pas
  $00194ED0  PROC_UNIT,  line 1135 of pmort reading includefile 
src/jconfig.inc

Fatal: Compilation aborted
dules.pas
  $0017A3AC  COMPILE,  line 395 of parser.pas
  $0002D414  COMPILE,  line 249 of compiler.pas
  $8314  main,  line 223 of pp.pas

make[5]: *** [buildpasjpeg.ppu] Error 217

In both cases the commandline I'm using is

make 'NOGDB=1' 'OPT=-O- -gl -vt' 'EXTDEBUG=1' all

I've added extdebug in an attempt to enable -an for listings although so 
far I don't think it's working (when looked at on other platforms)- is 
this the right way of doing it?


Can anybody point me at a fix, or suggest a specific version I should be 
using?


--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel