Talk:Trinity in Trouble

From Freepascal Amiga wiki
Jump to navigation Jump to search

untyped Pointer in structures

Notice to: "structure TWindow field WScreen" and all the others of this kind: You will find dozens of this kind in any kind of structures. The reason are recursive type definitions which does work little bit strange in Pascal. Forwarding of types only within the same Block. So this works:

type
  PScreen = ^TScreen;
  PWindow = ^TWindow;

  TWindow = record
    WScreen: PScreen
  end;
  
  TScreen = record
    FirstWindow: PWindow;   
  end;
const
  IDCMP_NEWSIZE = 1 shl 1;

and this does not work:

type
  PScreen = ^TScreen;
  PWindow = ^TWindow;

  TWindow = record
    WScreen: PScreen
  end;

const
  IDCMP_NEWSIZE = 1 shl 1;   

type
  TScreen = record
    FirstWindow: PWindow;   
  end;

So a complete Rewrite/Resort of the complete unit is needed, as I did for AROS. I will not do that for MorphOS/Amiga again. --ALB42 (talk) 13:03, 27 September 2015 (CEST)

re: untyped Pointer in structures

Hi ALB42,

Yups, i am aware this is indeed the case.

Please forgive me for just adding things as i go along and run into them, as it should perhaps be easier to just check the individual units one at a time.

My goal is just to list everything i encounter, and at a later point in time start doing something about it. Hopefully it will also point out that writing source for multi-platform is a pita.

ATM and imho there are bigger fish to fry to make things a bit more multi-platform compatible, such as the auto opening of libraries in general and intuition for MorphOS in particular. the different varargs implementations are also a pita to work with.

I would be happy if the procedures/functions are getting a bit more compatible and on same par as well as remove/fix some of the most obvious and most encountered incompatibilities.

Most things i can 'solve' temporary with using unit trinity, but some things can't be fixed that way (or very difficult).


Thanks for paying attention, which i presume means it's not all in vain :-)

--Molly (talk) 14:55, 27 September 2015 (CEST)