Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Johnny Cai
wine
Commits
b6077c66
Commit
b6077c66
authored
22 years ago
by
Patrik Stridvall
Committed by
Alexandre Julliard
22 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Added --include-quotes option that fixes #include to use the correct
of <> and "".
parent
facaee4f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
tools/winapi/winapi_cleanup
+82
-3
82 additions, 3 deletions
tools/winapi/winapi_cleanup
tools/winapi/winapi_cleanup_options.pm
+2
-1
2 additions, 1 deletion
tools/winapi/winapi_cleanup_options.pm
tools/winapi_check/nativeapi.pm
+4
-4
4 additions, 4 deletions
tools/winapi_check/nativeapi.pm
with
88 additions
and
8 deletions
tools/winapi/winapi_cleanup
+
82
−
3
View file @
b6077c66
...
...
@@ -24,10 +24,11 @@ BEGIN {
require
"
$1/winapi/setup.pm
";
}
use
config
qw($current_dir $wine_dir)
;
use
config
qw($current_dir $wine_dir
file_absolutize file_directory
)
;
use
output
qw($output)
;
use
winapi_cleanup_options
qw($options)
;
use
nativeapi
qw($nativeapi)
;
use
util
qw(edit_file)
;
if
(
$options
->
progress
)
{
...
...
@@ -43,6 +44,13 @@ sub cleanup_file {
local
*IN
=
shift
;
local
*OUT
=
shift
;
my
$file
=
shift
;
my
$dir
=
do
{
my
$file2
=
file_absolutize
(
$file
);
my
$dir
=
file_directory
(
$file2
);
"
$wine_dir
/
$dir
";
};
my
$indent
;
my
@comments
=
();
my
$format_comments
=
sub
{
...
...
@@ -117,6 +125,75 @@ sub cleanup_file {
}
}
if
(
$options
->
include_quotes
)
{
my
$module
=
"";
if
(
$dir
=~
m%^$wine_dir/(?:controls|windows)$%
)
{
$module
=
"
user
";
}
elsif
(
$dir
=~
m%^$wine_dir/(?:graphics)$%
)
{
$module
=
"
gdi
";
}
elsif
(
$dir
=~
m%^$wine_dir/(?:graphics|windows)/x11drv$%
)
{
$module
=
"
x11drv
";
}
elsif
(
$dir
=~
m%^$wine_dir/dlls/(.*?)/.*?$%
)
{
$module
=
$
1
;
}
if
(
/^(\s*\#\s*include\s+)(?:<(.*?)>|\"(.*?)\")(.*?)\s*$/
)
{
my
$prefix
=
$
1
;
my
$header
=
$
2
||
$
3
;
my
$local
=
!
defined
(
$
2
)
&&
defined
(
$
3
);
my
$suffix
=
$
4
;
my
$exists_system
=
0
;
{
my
@system_paths
=
qw(/usr/include /usr/local/include /usr/X11R6/include)
;
foreach
my
$path
(
@system_paths
)
{
$exists_system
||=
(
-
e
"
$path
/
$header
"
||
0
);
}
$exists_system
||=
$nativeapi
->
is_conditional_header
(
$header
);
}
my
$exists_windows
=
0
;
{
if
(
$header
!~
m%^wine/%
&&
$header
ne
"
config.h
")
{
$exists_windows
||=
(
-
e
"
$wine_dir
/include/
$header
"
||
0
);
}
}
my
$exists_wine
=
0
;
{
$exists_wine
||=
(
$header
eq
"
config.h
");
if
(
$header
=~
m%^wine/%
)
{
$exists_wine
||=
(
-
e
"
$wine_dir
/include/
$header
"
||
0
);
}
}
my
$exists_local
=
0
;
{
$exists_local
||=
(
$header
eq
"
y.tab.h
");
my
@local_paths
=
();
push
@local_paths
,
"
$dir
"
if
$dir
!~
m%^$wine_dir/include%
;
push
@local_paths
,
"
$wine_dir
/dlls/
$module
"
if
$module
;
foreach
my
$path
(
@local_paths
)
{
$exists_local
||=
(
-
e
"
$path
/
$header
"
||
0
);
}
}
if
(
!
$exists_system
&&
!
$exists_windows
&&
!
$exists_wine
&&
!
$exists_local
)
{
$output
->
write
("
warning: header '
$header
': doesn't exist
\n
");
}
elsif
((
$exists_system
+
$exists_windows
+
$exists_wine
+
$exists_local
)
>
1
)
{
if
(
$header
!~
/^(?:async\.h|comcat\.h|sql(?:ext|types)?\.h|thread\.h|user\.h)$/
)
{
$output
->
write
("
warning: header '
$header
': more than one possibillity
\n
");
}
}
if
(
!
$local
&&
$exists_local
)
{
$_
=
"
$prefix
\"
$header
\"
$suffix
";
$modified
=
1
;
}
elsif
(
$local
&&
!
$exists_local
&&
(
$exists_system
||
$exists_windows
||
$exists_wine
))
{
$_
=
"
$prefix
<
$header
>
$suffix
";
$modified
=
1
;
}
}
}
print
OUT
"
$_
\n
";
}
...
...
@@ -142,8 +219,9 @@ my $progress_max = scalar(@h_files) + scalar(@c_files);
foreach
my
$file
(
@h_files
)
{
$progress_current
++
;
$output
->
progress
("
$file
(file
$progress_current
of
$progress_max
)
");
$output
->
prefix
("
$file
:
");
if
(
edit_file
(
$file
,
\
&cleanup_file
,
@
_
))
{
if
(
edit_file
(
$file
,
\
&cleanup_file
,
@
_
,
$file
))
{
$output
->
write
("
$file
: modified
\n
");
}
}
...
...
@@ -151,8 +229,9 @@ foreach my $file (@h_files) {
foreach
my
$file
(
@c_files
)
{
$progress_current
++
;
$output
->
progress
("
$file
(file
$progress_current
of
$progress_max
)
");
$output
->
prefix
("
$file
:
");
if
(
edit_file
(
$file
,
\
&cleanup_file
,
@
_
))
{
if
(
edit_file
(
$file
,
\
&cleanup_file
,
$file
))
{
$output
->
write
("
$file
: modified
\n
");
}
}
This diff is collapsed.
Click to expand it.
tools/winapi/winapi_cleanup_options.pm
+
2
−
1
View file @
b6077c66
...
...
@@ -37,7 +37,8 @@ my %options_long = (
"
progress
"
=>
{
default
=>
1
,
description
=>
"
show progress
"
},
"
cpp-comments
"
=>
{
default
=>
1
,
description
=>
"
converts C++ comments to C comments
"
},
"
cpp-comments
"
=>
{
default
=>
1
,
description
=>
"
convert C++ comments to C comments
"
},
"
include-quotes
"
=>
{
default
=>
0
,
description
=>
"
convert #include
\"\"
to <> or the reverse where appropriate
"
},
"
trailing-whitespace
"
=>
{
default
=>
0
,
description
=>
"
remove trailing whitespace
"
},
);
...
...
This diff is collapsed.
Click to expand it.
tools/winapi_check/nativeapi.pm
+
4
−
4
View file @
b6077c66
...
...
@@ -144,7 +144,7 @@ sub is_function {
my
$name
=
shift
;
return
$$functions
{
$name
};
return
(
$$functions
{
$name
}
||
0
)
;
}
sub
is_conditional
{
...
...
@@ -153,7 +153,7 @@ sub is_conditional {
my
$name
=
shift
;
return
$$conditionals
{
$name
};
return
(
$$conditionals
{
$name
}
||
0
)
;
}
sub
found_conditional
{
...
...
@@ -171,7 +171,7 @@ sub is_conditional_header {
my
$name
=
shift
;
return
$$conditional_headers
{
$name
};
return
(
$$conditional_headers
{
$name
}
||
0
)
;
}
sub
is_conditional_function
{
...
...
@@ -180,7 +180,7 @@ sub is_conditional_function {
my
$name
=
shift
;
return
$$conditional_functions
{
$name
};
return
(
$$conditional_functions
{
$name
}
||
0
)
;
}
sub
global_report
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment