Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Common problems when converting C header files

5 views
Skip to first unread message

kris1980

unread,
Aug 26, 2009, 6:50:47 AM8/26/09
to
Hy, I am converting GTK+ C hearders to IBM PL/I for Windows

I have a problem with a macro G_TYPE_MAKE_FUNDAMENTAL
Can anybody help me?


Source code:

%dcl #__GTYPE_CPY__ char ext;
%if #__GTYPE_CPY__ = '' %then %do;
%#__GTYPE_CPY__ = 'Y';

/* .... */

%G_TYPE_MAKE_FUNDAMENTAL: proc(x) returns(char);
dcl x char;
return("ISLL("||x||", G_TYPE_FUNDAMENTAL_SHIFT)");
%end G_TYPE_MAKE_FUNDAMENTAL;
%activate G_TYPE_MAKE_FUNDAMENTAL;

/* .... */

%end; /* %if #__GTYPE_CPY__ = '' %then %do; */

Compiler command line:
PLI MainWindow.pli (NOLIBS, SOURCE, SYSTEM(WINDOWS, PENTIUM), NOLOGO)

Compiler message:
gtk+\include\gtype.cpy(59:1) : IBM3916I S The procedure
G_TYPE_MAKE_FUNDAMENTAL has already been defined.


Merci d'avance....
Christophe

John W Kennedy

unread,
Aug 26, 2009, 2:53:37 PM8/26/09
to

PL/I macro code is not linearly interpreted; it is "compiled" before it
is run. Therefore, you can't say:

%IF ... %THEN %DO;
% x: PROCEDURE....
%END;
%END;
%ELSE %DO;
% x: PROCEDURE....
%END;
%END;

in macro PL/I any more than you could do the equivalent in regular PL/I.
You have to write a single G_TYPE_MAKE_FUNDAMENTAL and put the IF inside it.

robin

unread,
Aug 27, 2009, 1:38:05 AM8/27/09
to
"kris1980" <christoph...@gmail.com> wrote in message
news:c3bb4563-6b0c-474f...@k6g2000yqn.googlegroups.com...

The procedure has already been defined. That means that you have introduced
it before.


0 new messages