Login
Username:

Password:


Lost Password?

Register now!
Main Menu
Who's Online
24 user(s) are online (17 user(s) are browsing Forum)

Members: 1
Guests: 23

coolcat2012, more...

Browsing this Thread:   1 Anonymous Users





Need AROS headers without macros (for PortablE)
Just can't stay away
Joined:
2008/3/15 3:10
From England
Group:
Registered Users
Posts: 83
Level : 8
HP : 0 / 176
MP : 27 / 1225
EXP : 6
Offline
I am hoping to port PortablE (my implementation of the E language) to AROS. But I have hit a big problem:

To allow OS calls to be used, I need to tell PortablE about them. I have written a crude tool which semi-automatically converts C headers into the form PortablE needs, and that has worked well for both OS3.9 & OS4. Unfortunately, it appears that AROS's procedure declarations use some funky macros, like this:

AROS_LP2(struct TagItem *, FindTagItem,
AROS_LPA(Tag, tagValue, D0),
AROS_LPA(const struct TagItem *, tagList, A0),
LIBBASETYPEPTR, UtilityBase, 5, Utility
);

That's completely useless to me, as I need it to look something like this for my tool to work:

struct TagItem *FindTagItem( Tag tagVal, CONST struct TagItem *tagList );


While I suppose it ought to be possible to modify my tool to handle AROS's esoteric declarations, it would be so much easier if either (a) someone told me where to find AROS's headers without macros, or (b) told me how to preprocess the header files (under Windows) to remove the macros.

Posted on: 2008/3/15 3:42
_________________
ChrisH
--
Author of the PortablE programming language.
Create PDF from Post Print


Re: Need AROS headers without macros (for PortablE)
Home away from home
Joined:
2004/4/12 13:07
Group:
Registered Users
Posts: 233
Level : 14
HP : 0 / 331
MP : 77 / 6100
EXP : 26
Offline
Quote:

PortablE wrote:

(a) someone told me where to find AROS's headers without macros


AFAIK we don't have those.

Quote:
(b) told me how to preprocess the header files (under Windows) to remove the macros.


The macros are defined in aros/libcall.h. You could start from this file to adapt the macros to output what you want.

greets,
Staf.

Posted on: 2008/3/15 4:18
Create PDF from Post Print


Re: Need AROS headers without macros (for PortablE)
Just can't stay away
Joined:
2008/3/15 3:10
From England
Group:
Registered Users
Posts: 83
Level : 8
HP : 0 / 176
MP : 27 / 1225
EXP : 6
Offline
Quote:

Fats wrote:
Quote:
(b) told me how to preprocess the header files (under Windows) to remove the macros.


The macros are defined in aros/libcall.h. You could start from this file to adapt the macros to output what you want.

I was hoping that this could be done automatically, otherwise I might as well try parsing the AROS format directly

I would have thought that it ought to be possible, since originally the C preprocessor would have been a separate program, but I have no idea where to look, or whether it might be possible to even get GCC to do the job for me...

Posted on: 2008/3/15 4:33
_________________
ChrisH
--
Author of the PortablE programming language.
Create PDF from Post Print


Re: Need AROS headers without macros (for PortablE)
Home away from home
Joined:
2005/1/13 2:59
From AU
Group:
Registered Users
Posts: 179
Level : 12
HP : 0 / 285
MP : 59 / 4628
EXP : 43
Offline
gcc -E will give you the raw output from the preprocessor that would normally be passed to the compiler. You could process this output to get what you need.

Posted on: 2008/3/15 4:44
Create PDF from Post Print


Re: Need AROS headers without macros (for PortablE)
Home away from home
Joined:
2004/4/12 13:07
Group:
Registered Users
Posts: 233
Level : 14
HP : 0 / 331
MP : 77 / 6100
EXP : 26
Offline
Quote:

PortablE wrote:
Quote:

Fats wrote:
Quote:
(b) told me how to preprocess the header files (under Windows) to remove the macros.


The macros are defined in aros/libcall.h. You could start from this file to adapt the macros to output what you want.

I was hoping that this could be done automatically, otherwise I might as well try parsing the AROS format directly


Another possibility I am now thinking of is to parse the .conf files in the AROS source. Every library has a .conf file (e.g. exec library has rom/exec/exec.conf) where the functions are listed. I think the format in these files resembles more what you want.

greets,
Staf.

Posted on: 2008/3/15 7:30
Create PDF from Post Print


Re: Need AROS headers without macros (for PortablE)
Just can't stay away
Joined:
2008/3/15 3:10
From England
Group:
Registered Users
Posts: 83
Level : 8
HP : 0 / 176
MP : 27 / 1225
EXP : 6
Offline
@rob
Great, that sounds like just want I want - I think!

@Fats
Thanks for that suggestion - AmiDevCpp does not seem to contain those *.conf files, so I will download the 50MB of AROS source to (presumably) find those files.

Posted on: 2008/3/15 9:49
_________________
ChrisH
--
Author of the PortablE programming language.
Create PDF from Post Print


Re: Need AROS headers without macros (for PortablE)
Home away from home
Joined:
2004/3/30 23:19
From Clausthal-Zellerfeld, Germany
Group:
Registered Users
Posts: 315
Level : 16
HP : 0 / 389
MP : 105 / 7210
EXP : 59
Offline
You may also try to make stub functions. Such solution would work well on all amiga-like platforms.

Posted on: 2008/3/16 1:24
_________________
Open in new window
Create PDF from Post Print







Post Reply
Account*
Name   Password   Login 
Message:*


You cannot start a new topic.
You can view topic.
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.

[Advanced Search]


Search
Top Posters
1
paolone
2085
2
damocles
1690
3
nikolaos
1611
4
mazze
1263
5
clusteruk
1256
6
deadwood
1061
7
JLF65
1009
8
Manu
931
9
Kalamatee
860
10
Holley
706