Drawterm (Plan9 console) on IRIX

IRIX/Nekoware development, porting and related topics.
Forum rules
Any posts concerning pirated software or offering to buy/sell/trade commercial software are subject to removal.
User avatar
jirka
Donor
Donor
Posts: 218
Joined: Tue May 04, 2004 7:55 am
Location: Czech Republic
Contact:

Drawterm (Plan9 console) on IRIX

Unread postby jirka » Fri Nov 13, 2015 1:48 pm

Hello,

I tried to compile the Drawterm (a graphical terminal for Plan9 sessions https://swtch.com/drawterm/) on the IRIX 6.5 and it ends with something like that:

Code: Select all

cc-1029 cc: ERROR File = eipfmt.c, Line = 12
  An expression is expected at this point.

  [0x00] 0 | Isprefix,


The code in the drawterm/libip/eipfmt.c is:

Code: Select all

uchar prefixvals[256] =
{
[0x00] 0 | Isprefix,
[0x80] 1 | Isprefix,
[0xC0] 2 | Isprefix,
[0xE0] 3 | Isprefix,
[0xF0] 4 | Isprefix,
[0xF8] 5 | Isprefix,
[0xFC] 6 | Isprefix,
[0xFE] 7 | Isprefix,
[0xFF] 8 | Isprefix,
};


Honestly, I don't have idea whut can be wrong.
:O2: :O2: :1600SW: :1600SW: :Indy: :Indy: :Indigo: :Indigo:

robespierre
Posts: 1578
Joined: Mon Sep 12, 2011 2:28 pm
Location: Boston

Re: Drawterm (Plan9 console) on IRIX

Unread postby robespierre » Fri Nov 13, 2015 1:55 pm

Is that really supposed to be C? Plan9 used some idiosyncratic languages and tools like ATOM that are not compatible with anything else.
In C, the square brackets [] are only allowed in subscript expressions (binary expressions consisting of a pointer type and an integer type, as in p[i] or i[p]).
:PI: :O2: :Indigo2IMP: :Indigo2IMP:

User avatar
jirka
Donor
Donor
Posts: 218
Joined: Tue May 04, 2004 7:55 am
Location: Czech Republic
Contact:

Re: Drawterm (Plan9 console) on IRIX

Unread postby jirka » Fri Nov 13, 2015 2:09 pm

It have to be - it isn't a Plan9 program but a client for normal operating systems (Linux/Solaris/Windows). The IRIX us declared to be supported, too. And there is even a special makefile for the IRIX. Only it doesn't work..

robespierre
Posts: 1578
Joined: Mon Sep 12, 2011 2:28 pm
Location: Boston

Re: Drawterm (Plan9 console) on IRIX

Unread postby robespierre » Fri Nov 13, 2015 2:55 pm

In ISO C99 you can give the elements in any order, specifying the array indices or structure field names they apply to, and GNU C allows this as an extension in C89 mode as well.

To specify an array index, write [index] = before the element value. For example,

int a[6] = { [4] = 29, [2] = 15 };
An alternative syntax for this which has been obsolete since GCC 2.5 but GCC still accepts is to write [index] before the element value, with no =.


Fix this GCC-ism and it should compile under c99 (which you request with the -c99 argument to MIPSPro 7.4.x)
:PI: :O2: :Indigo2IMP: :Indigo2IMP:

User avatar
jirka
Donor
Donor
Posts: 218
Joined: Tue May 04, 2004 7:55 am
Location: Czech Republic
Contact:

Re: Drawterm (Plan9 console) on IRIX

Unread postby jirka » Sat Nov 14, 2015 10:25 am

robespierre wrote:Fix this GCC-ism and it should compile


Many thanks - just fixed it (hopefully in a correct way). Also had to fix the getcallerpc function type and it even starts. Just the colours are bit incorrect (green-blue instead of yellow). You can see it on the screenshot.
Attachments
dterm-irix.patch
Patch to compile Drawterm on irix (current source from https://swtch.com/drawterm/)
(24.57 KiB) Downloaded 16 times
plan9-irix-native.png
Native Drawterm on IRIX
drawterm.gz
Drawterm MIPS binary.
(294.01 KiB) Downloaded 16 times
:O2: :O2: :1600SW: :1600SW: :Indy: :Indy: :Indigo: :Indigo:


Return to “SGI: Development”

Who is online

Users browsing this forum: No registered users and 2 guests