Skip to content

Commit c719926

Browse files
committed
Create api/lib if it not exists (scripts/dumplibheap.pl)
1 parent c791fe0 commit c719926

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

scripts/dumplibheap.pl

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
my $VAR_NAME = "r_lib_heap";
1313
my $HEADER = "include/api/libheap.h";
1414

15+
if(! -d 'api/lib') {
16+
mkdir('api/lib', 0755) || die $@;
17+
}
1518

1619
my $len = dump_file($LIBHEAP, $FILE_OUT, $VAR_NAME);
1720
print " GEN $FILE_OUT\n";
@@ -31,13 +34,13 @@ sub dump_file {
3134

3235
my $len = 0;
3336
my $buf;
34-
37+
3538
while(read IN, $buf, 1) {
36-
39+
3740
if($len % 16 == 0) {
3841
print OUT "\n ";
3942
}
40-
43+
4144
printf OUT "0x%.2x", ord($buf);
4245
print OUT ", " if(!eof(IN));
4346

@@ -60,7 +63,7 @@ sub write_header {
6063
print OUT "/* File generated by script $0, do not edit */\n\n";
6164
print OUT "#ifndef DEF_API_LIBHEAP_H\n";
6265
print OUT "#define DEF_API_LIBHEAP_H\n\n";
63-
66+
6467
foreach my $n(@names) {
6568
print OUT "extern unsigned char " . $n . "[$len];\n";
6669
}

0 commit comments

Comments
 (0)