Mercurial > hg > CbC > CbC_gcc
view CbC-examples/tmp2.c @ 155:da32f4b04d38
fix __code name conflict
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 25 May 2020 17:51:46 +0900 |
parents | fe568345ddd5 |
children |
line wrap: on
line source
#define __environment _CbC_environment #define __return _CbC_return #include "stdio.h" int main0(int ac,char *av[]); __code code0(char *av[],__code (*ret)(int, void*),void *retenv); __code code1(char *av[],__code (*ret)(int, void*),void *retenv); int main(ac,av) int ac; char *av[]; { int i; i=main0(ac,av); fprintf(stdout,"#0012:1: %s %d\n",av[0],i); return 0; } int main0(ac,av) int ac; char *av[]; { fprintf(stdout,"#0021:2: %s\n",av[0]); goto code0(av,_CbC_return,_CbC_environment); } __code code0(av,ret,retenv) char *av[]; __code (*ret)(int, void*); void *retenv; { char *p; p = av[0]; fprintf(stdout,"#0032:3: %s\n",p); goto code1(av,ret,retenv); } __code code1(av,ret,retenv) char *av[]; __code (*ret)(int, void*); void *retenv; { fprintf(stdout,"#0041:4: %s\n",av[0]); goto (*ret)(1234,retenv); }