Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2006-12

Valid macpas syntax ?

5 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Marc Weustink

Hi,

While using lazarus's finddeclaration I ran in to following "errors", and I wonder if it is a valid syntax. Since I'm not that deep into macpas syntax, I ask it here.

1) using out as parametername

[FPCMacOSAll:16450]
type
  CGFunctionEvaluateCallback = procedure( info: UnivPtr; inp: {const}
Float32Ptr; out: Float32Ptr );

2) the * behind msgb (and what does it mean ?)

[FPCMacOSAll:80638]
type

  msgbPtr = ^msgb;
  msgb = record
    b_next: struct msgb *;  { next message on queue }
    b_prev: struct msgb *;  { previous message on queue }
    b_cont: struct msgb *;  { next message block of message }

Marc

Reply by email

Marco van de Voort
to Marc Weustink
Show quoted text 23 lines
While using lazarus's finddeclaration I ran in to following "errors", and I wonder if it is a valid syntax. Since I'm not that deep into macpas syntax, I ask it here. 1) using out as parametername [FPCMacOSAll:16450] type CGFunctionEvaluateCallback = procedure( info: UnivPtr; inp: {const} Float32Ptr; out: Float32Ptr ); 2) the * behind msgb (and what does it mean ?) [FPCMacOSAll:80638] type msgbPtr = ^msgb; msgb = record b_next: struct msgb *; { next message on queue } b_prev: struct msgb *; { previous message on queue } b_cont: struct msgb *; { next message block of message }

Looks like a goof up of some header translator. 10:1 that all three fields should be msgbptr. Maybe the code was under ifdef and not used till now?

Reply by email

Jonas Maebe
to Marc Weustink: While using lazarus's finddeclaration I ran in to following "errors", and I wonder if it…
Marc Weustink wrote
1) using out as parametername

"out" is not a reserved word in macpas mode, just like in tp/fpc modes.

Show quoted text 9 lines
2) the * behind msgb (and what does it mean ?) [FPCMacOSAll:80638] type msgbPtr = ^msgb; msgb = record b_next: struct msgb *; { next message on queue } b_prev: struct msgb *; { previous message on queue } b_cont: struct msgb *; { next message block of message }

It means that this code isn't compiled, otherwise you'd get a parser error. It's between {$ifc CALL_NOT_IN_CARBON}, and CALL_NOT_IN_CARBON is defined as false at the start of the file (since we do not support non-Carbon Mac OS 9 in the Mac OS interfaces). That's probably why no one ever noticed this error.

Jonas

Reply by email

Mattias Gaertner
to Jonas Maebe
Show quoted text 7 lines
On 03 Dec 2006, at 18:05, Marc Weustink wrote: > 1) using out as parametername "out" is not a reserved word in macpas mode, just like in tp/fpc modes.

Thanks. I updated the codetools.

Show quoted text 15 lines
> 2) the * behind msgb (and what does it mean ?) > > [FPCMacOSAll:80638] > type > msgbPtr = ^msgb; > msgb = record > b_next: struct msgb *; { next message on queue } > b_prev: struct msgb *; { previous message on queue } > b_cont: struct msgb *; { next message block of message } It means that this code isn't compiled, otherwise you'd get a parser error. It's between {$ifc CALL_NOT_IN_CARBON}, and CALL_NOT_IN_CARBON is defined as false at the start of the file (since we do not support non-Carbon Mac OS 9 in the Mac OS interfaces). That's probably why no one ever noticed this error.

I implemented $IFC, $ELSEC, $SETC, $ELIFC, $ENDC, defined identifier, undefined identifier, 'out' and 'property' as parameter names, 'false' and 'true' as special $SETC values in the codetools. Now FPCMacOSAll is parsed without errors.

Can someone explain the meaning of

{$ifc defined __ppc__ and __ppc__}

?

Mattias

Reply by email

Jonas Maebe
to Mattias Gaertner
Mattias Gaertner wrote 5 lines
Can someone explain the meaning of {$ifc defined __ppc__ and __ppc__} ?

Semantically, it means {$if defined(__ppc__) and (__ppc__ = true) }

You cannot check the value of undefined symbols (at least not in FPC, I believe in GPC and MetroWerks they automatically evaluate to false).

Jonas

Reply by email