@Mlehto
Quote:
#define __USE_SYSBASE 1 is brobably SAS/C-only. Wjhat it does and what it needs on new gcc env?
That tells the SAS/C code to get the address of ExecBase from a global variable called SysBase, instead of getting it by reading address 4. GCC always uses SysBase, so this definition is not needed (but it does no harm if present).
Quote:
setpri.c:98:26: error: 'struct Library' has no member named 'TaskWait'
tasklist[0] = &SysBase->TaskWait;
^~
By default the OS4 includes define SysBase as a generic pointer to struct Library, rather than what it actually is, a pointer to struct ExecBase. That allows calls like OpenLibrary() and CloseLibrary() to work without needing to cast to and from a pointer to whatever that library's base is called.
But of course struct Library has no TaskWait and TaskReady fields, so you get errors. One way to fix this is to cast SysBase to a pointer to ExecBase before referencing those fields. Another way is to add the definition
#define __USE_BASETYPE__
before including anything; that causes SysBase to be defined as pointing to struct ExecBase, which will let the code reference ExecBase fields like TaskWait and TaskReady without a cast.
Note that those two fields of ExecBase are marked as obsolete, so they may not do anything useful even after you get the code to compile. There are enough differences between OS4 and OS3 that OS3 code that pokes around in ExecBase is unlikely to work properly under OS4.
Quote:
Reading general c-manual is bit like eat dry wood or something.
Some people feel that same way about writing code.