File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 12
12
my $VAR_NAME = " r_lib_heap" ;
13
13
my $HEADER = " include/api/libheap.h" ;
14
14
15
+ if (! -d ' api/lib' ) {
16
+ mkdir (' api/lib' , 0755) || die $@ ;
17
+ }
15
18
16
19
my $len = dump_file($LIBHEAP , $FILE_OUT , $VAR_NAME );
17
20
print " GEN $FILE_OUT \n " ;
@@ -31,13 +34,13 @@ sub dump_file {
31
34
32
35
my $len = 0;
33
36
my $buf ;
34
-
37
+
35
38
while (read IN, $buf , 1) {
36
-
39
+
37
40
if ($len % 16 == 0) {
38
41
print OUT " \n " ;
39
42
}
40
-
43
+
41
44
printf OUT " 0x%.2x" , ord ($buf );
42
45
print OUT " , " if (!eof (IN));
43
46
@@ -60,7 +63,7 @@ sub write_header {
60
63
print OUT " /* File generated by script $0 , do not edit */\n\n " ;
61
64
print OUT " #ifndef DEF_API_LIBHEAP_H\n " ;
62
65
print OUT " #define DEF_API_LIBHEAP_H\n\n " ;
63
-
66
+
64
67
foreach my $n (@names ) {
65
68
print OUT " extern unsigned char " . $n . " [$len ];\n " ;
66
69
}
You can’t perform that action at this time.
0 commit comments