From f546e7a1aa6e61c5dea49b760caa7b064a4e07d4 Mon Sep 17 00:00:00 2001 From: Stefan `Sec` Zehl Date: Wed, 3 Aug 2011 19:13:20 +0200 Subject: [PATCH] Fix mktable regexp --- firmware/l0dable/mktable.pl | 4 ++-- firmware/l0dable/system-include-hack.h | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 firmware/l0dable/system-include-hack.h diff --git a/firmware/l0dable/mktable.pl b/firmware/l0dable/mktable.pl index 38cf043..ad54420 100755 --- a/firmware/l0dable/mktable.pl +++ b/firmware/l0dable/mktable.pl @@ -56,11 +56,11 @@ sub wanted { s!//.*!!; $types{$id}="*($_)"; $files{$id}=$File::Find::name; - }elsif (m!^\s*extern\s[^(]* ([\w]+)\s*(\[\w*\]\s*)?;\s*(//.*)?(/\*[^/]*\*/)?$!){ + }elsif (m!^\s*extern\s[^(]* ([\w]+)\s*(\[[^]]*\]\s*)?;\s*(//.*)?(/\*[^/]*\*/)?$!){ $id=$1; s/extern //; my $star="*"; - if( s/\[\w*\]//){ + if( s/\[.*\]//){ $star=""; }; s/$id/*/; diff --git a/firmware/l0dable/system-include-hack.h b/firmware/l0dable/system-include-hack.h new file mode 100644 index 0000000..4f8f217 --- /dev/null +++ b/firmware/l0dable/system-include-hack.h @@ -0,0 +1,3 @@ +size_t strlen(const char *s); +char * strcpy(char * restrict dst, const char * restrict src); +void * memcpy(void *dst, const void *src, size_t len);