Mercurial > ecos-v2_0-branch
view packages/services/gfx/mw/current/src/nanox/elkspatch.pl @ 823:19a153ac403c default tip
* Added execute permissions to files missed in conversion from CVS
| author | alexs |
|---|---|
| date | Thu, 08 May 2003 17:42:17 +0000 |
| parents | e0c0827131d1 |
| children |
line wrap: on
line source
#!/usr/bin/perl # elkspatch.pl # # Perl script to hack AllocReq macros for ELKS bcc compiler # # This script rewrites the AllocReq macro which uses ANSI C's '##' # token pasting operator to an input compatible with the bcc compiler # # This is only required if desiring to build client/server Nano-X for ELKS # To run: # mv client.c client.dist # ./elkspatch.pl < client.dist > client.c # while (<>) { if (/^(.*)AllocReq\(([A-Za-z]+)\)(.*)$/) { print("#if ELKS /* KLUDGE */\n"); printf("%s((nx%sReq *)nxAllocReq(GrNum%s,(long)sizeof(nx%sReq), 0L))%s /* KLUDGE */\n", $1, $2, $2, $2, $3); print("#else /* KLUDGE */\n"); print; print("#endif /* KLUDGE */\n"); } elsif (/^(.*)AllocReqExtra\(([A-Za-z]+) *, *(.*)\)(;)$/) { print("#if ELKS /* KLUDGE */\n"); printf("%s((nx%sReq *)nxAllocReq(GrNum%s,(long)sizeof(nx%sReq), (long)%s))%s /* KLUDGE */\n", $1, $2, $2, $2, $3, $4); print("#else /* KLUDGE */\n"); print; print("#endif /* KLUDGE */\n"); } else { print; } }
