Skip to content

Commit

Permalink
Added support for gcc attribute
Browse files Browse the repository at this point in the history
Ignoring __attribute__
  • Loading branch information
Hadatko committed Dec 19, 2019
1 parent 16ea409 commit a0f2e07
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dissect/cstruct/cstruct.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ def _enums(self, data):
def _structs(self, data):
compiler = Compiler(self.cstruct)
r = re.finditer(
r'(#(?P<flags>(?:compile))\s+)?((?P<typedef>typedef)\s+)?(?P<type>[^\s]+)\s+(?P<name>[^\s]+)?(?P<fields>\s*\{[^}]+\}(?P<defs>\s+[^;\n]+)?)?\s*;',
r'(#(?P<flags>(?:compile))\s+)?((?P<typedef>typedef)\s+)?(?P<type>[^\s]+)\s+(__attribute__\(\([^)]+\)\)\s*)?(?P<name>[^\s]+)?(?P<fields>\s*\{[^}]+\}(?P<defs>\s+[^;\n]+)?)?\s*;',
data,
)
for t in r:
Expand Down

0 comments on commit a0f2e07

Please sign in to comment.