[HEIMDAL-646] malloc(0) checks for AIX
[heimdal.git] / lib / roken / roken.awk
blob4d263a5a80405c1d0b645931d36e628770ad4eb6
1 # $Id$
3 BEGIN {
4 print "#include <config.h>"
5 print "#include <stdio.h>"
6 print ""
7 print "int main(int argc, char **argv)"
8 print "{"
9 print "puts(\"/* This is an OS dependent, generated file */\");"
10 print "puts(\"\\n\");"
11 print "puts(\"#ifndef __ROKEN_H__\");"
12 print "puts(\"#define __ROKEN_H__\");"
13 print "puts(\"\");"
16 $1 == "#ifdef" || $1 == "#ifndef" || $1 == "#if" || $1 == "#else" || $1 == "#elif" || $1 == "#endif" {
17 print $0;
18 next
22 s = ""
23 for(i = 1; i <= length; i++){
24 x = substr($0, i, 1)
25 if(x == "\"" || x == "\\")
26 s = s "\\";
27 s = s x;
29 print "puts(\"" s "\");"
32 END {
33 print "puts(\"\");"
34 print "puts(\"#endif /* __ROKEN_H__ */\");"
35 print "return 0;"
36 print "}"