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
b6077c66
Commit
b6077c66
authored
Jan 03, 2003
by
Patrik Stridvall
Committed by
Alexandre Julliard
Jan 03, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added --include-quotes option that fixes #include to use the correct
of <> and "".
parent
facaee4f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
88 additions
and
8 deletions
+88
-8
winapi_cleanup
tools/winapi/winapi_cleanup
+82
-3
winapi_cleanup_options.pm
tools/winapi/winapi_cleanup_options.pm
+2
-1
nativeapi.pm
tools/winapi_check/nativeapi.pm
+4
-4
No files found.
tools/winapi/winapi_cleanup
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"
);
}
}
tools/winapi/winapi_cleanup_options.pm
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"
},
);
...
...
tools/winapi_check/nativeapi.pm
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
{
...
...
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