Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
6b11a3c3
Commit
6b11a3c3
authored
Apr 07, 2010
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winapi: Add some support for handling ifdefs, particularly ifdef _WIN64.
parent
701dd239
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
4 deletions
+28
-4
c_type.pm
tools/winapi/c_type.pm
+5
-0
winapi_test
tools/winapi/winapi_test
+23
-4
No files found.
tools/winapi/c_type.pm
View file @
6b11a3c3
...
...
@@ -330,30 +330,35 @@ sub new($$$)
sub
align
($)
{
my
(
$self
)
=
@_
;
return
undef
unless
defined
$self
->
{
TYPE
}
->
field_aligns
();
return
$self
->
{
TYPE
}
->
field_aligns
()
->
[
$self
->
{
NUMBER
}];
}
sub
base_size
($)
{
my
(
$self
)
=
@_
;
return
undef
unless
defined
$self
->
{
TYPE
}
->
field_base_sizes
();
return
$self
->
{
TYPE
}
->
field_base_sizes
()
->
[
$self
->
{
NUMBER
}];
}
sub
name
($)
{
my
(
$self
)
=
@_
;
return
undef
unless
defined
$self
->
{
TYPE
}
->
field_names
();
return
$self
->
{
TYPE
}
->
field_names
()
->
[
$self
->
{
NUMBER
}];
}
sub
offset
($)
{
my
(
$self
)
=
@_
;
return
undef
unless
defined
$self
->
{
TYPE
}
->
field_offsets
();
return
$self
->
{
TYPE
}
->
field_offsets
()
->
[
$self
->
{
NUMBER
}];
}
sub
size
($)
{
my
(
$self
)
=
@_
;
return
undef
unless
defined
$self
->
{
TYPE
}
->
field_sizes
();
return
$self
->
{
TYPE
}
->
field_sizes
()
->
[
$self
->
{
NUMBER
}];
}
...
...
tools/winapi/winapi_test
View file @
6b11a3c3
...
...
@@ -352,6 +352,7 @@ foreach my $file (@files) {
my
$line
;
my
$type
;
my
@packs
=
(
4
);
my
@ifdefs
=
();
my
$update_output
=
sub
{
my
$progress
=
""
;
...
...
@@ -384,19 +385,37 @@ foreach my $file (@files) {
#print "found_preprocessor: $begin_line: [$_]\n";
if
(
$preprocessor
=~
/^\#\s*include\s+[\"<]pshpack(\d+)\.h[\">]$/
)
{
push
@packs
,
$1
;
push
@packs
,
$1
unless
@ifdefs
&&
!
$ifdefs
[
$#ifdefs
]
;
#print "found pack $1 on line $begin_line\n";
}
elsif
(
$preprocessor
=~
/^\#\s*include\s+[\"<]poppack\.h[\">]$/
)
{
pop
@packs
;
pop
@packs
unless
@ifdefs
&&
!
$ifdefs
[
$#ifdefs
]
;
#print "found poppack on line $begin_line\n";
}
}
elsif
(
$preprocessor
=~
/^\#\s*ifdef\s+_WIN64/
)
{
push
@ifdefs
,
0
;
}
elsif
(
$preprocessor
=~
/^\#\s*ifndef\s+_WIN64/
)
{
push
@ifdefs
,
1
;
}
elsif
(
$preprocessor
=~
/^\#\s*elif\s+defined(_WIN64)/
)
{
$ifdefs
[
$#ifdefs
]
=
0
;
}
elsif
(
$preprocessor
=~
/^\#\s*ifdef\s/
)
{
push
@ifdefs
,
2
;
}
elsif
(
$preprocessor
=~
/^\#\s*ifndef\s/
)
{
push
@ifdefs
,
2
;
}
elsif
(
$preprocessor
=~
/^\#\s*if/
)
{
push
@ifdefs
,
2
;
}
elsif
(
$preprocessor
=~
/^\#\s*else/
)
{
$ifdefs
[
$#ifdefs
]
=
$ifdefs
[
$#ifdefs
]
^
1
;
}
elsif
(
$preprocessor
=~
/^\#\s*elif/
)
{
$ifdefs
[
$#ifdefs
]
=
2
;
}
elsif
(
$preprocessor
=~
/^\#\s*endif/
)
{
pop
@ifdefs
;
}
return
1
;
};
$parser
->
set_found_preprocessor_callback
(
$found_preprocessor
);
my
$found_type
=
sub
{
$type
=
shift
;
return
if
@ifdefs
&&
!
$ifdefs
[
$#ifdefs
];
&
$update_output
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment