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
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
Yoann Laissus
wine
Commits
0335095f
Commit
0335095f
authored
24 years ago
by
Eric Pouech
Committed by
Alexandre Julliard
24 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Now prints line number for 'x.dll imported but no symbols used' warning.
parent
cef7c7af
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tools/winebuild/import.c
+15
-8
15 additions, 8 deletions
tools/winebuild/import.c
with
15 additions
and
8 deletions
tools/winebuild/import.c
+
15
−
8
View file @
0335095f
...
...
@@ -19,6 +19,7 @@ struct import
int
nb_exports
;
/* number of exported functions */
char
**
imports
;
/* functions we want to import from this dll */
int
nb_imports
;
/* number of imported functions */
int
lineno
;
/* line in .spec file where import is defined */
};
static
char
**
undef_symbols
;
/* list of undefined symbols */
...
...
@@ -133,6 +134,8 @@ void add_import_dll( const char *name )
imp
->
dll
=
xstrdup
(
name
);
imp
->
imports
=
NULL
;
imp
->
nb_imports
=
0
;
/* GetToken for the file name has swallowed the '\n', hence pointing to next line */
imp
->
lineno
=
current_line
-
1
;
read_exported_symbols
(
name
,
imp
);
...
...
@@ -197,22 +200,26 @@ static void add_extra_undef_symbols(void)
}
/* warn if a given dll is not used, but check forwards first */
static
void
warn_unused
(
const
char
*
dllname
)
static
void
warn_unused
(
const
struct
import
*
imp
)
{
int
i
;
size_t
len
=
strlen
(
dllname
);
const
char
*
p
=
strchr
(
dllname
,
'.'
);
if
(
p
&&
!
strcasecmp
(
p
,
".dll"
))
len
=
p
-
dllname
;
int
i
,
curline
;
size_t
len
=
strlen
(
imp
->
dll
);
const
char
*
p
=
strchr
(
imp
->
dll
,
'.'
);
if
(
p
&&
!
strcasecmp
(
p
,
".dll"
))
len
=
p
-
imp
->
dll
;
for
(
i
=
Base
;
i
<=
Limit
;
i
++
)
{
ORDDEF
*
odp
=
Ordinals
[
i
];
if
(
!
odp
||
odp
->
type
!=
TYPE_FORWARD
)
continue
;
if
(
!
strncasecmp
(
odp
->
u
.
fwd
.
link_name
,
dllname
,
len
)
&&
if
(
!
strncasecmp
(
odp
->
u
.
fwd
.
link_name
,
imp
->
dll
,
len
)
&&
odp
->
u
.
fwd
.
link_name
[
len
]
==
'.'
)
return
;
/* found an import, do not warn */
}
warning
(
"%s imported but no symbols used
\n
"
,
dllname
);
/* switch current_line temporarily to the line of the import declaration */
curline
=
current_line
;
current_line
=
imp
->
lineno
;
warning
(
"%s imported but no symbols used
\n
"
,
imp
->
dll
);
current_line
=
curline
;
}
/* read in the list of undefined symbols */
...
...
@@ -269,7 +276,7 @@ int resolve_imports( FILE *outfile )
else
undef_symbols
[
j
-
off
]
=
undef_symbols
[
j
];
}
nb_undef_symbols
-=
off
;
if
(
!
off
)
warn_unused
(
imp
->
dll
);
if
(
!
off
)
warn_unused
(
imp
);
}
return
1
;
}
...
...
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