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
4f12e61c
Commit
4f12e61c
authored
24 years ago
by
Jon Griffiths
Committed by
Alexandre Julliard
24 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Added "ignore" directive for skipping individual symbol resolution.
parent
afee78f3
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/winebuild/build.h
+1
-0
1 addition, 0 deletions
tools/winebuild/build.h
tools/winebuild/import.c
+48
-10
48 additions, 10 deletions
tools/winebuild/import.c
tools/winebuild/parser.c
+24
-0
24 additions, 0 deletions
tools/winebuild/parser.c
with
73 additions
and
10 deletions
tools/winebuild/build.h
+
1
−
0
View file @
4f12e61c
...
...
@@ -146,6 +146,7 @@ extern void warning( const char *msg, ... );
extern
void
dump_bytes
(
FILE
*
outfile
,
const
unsigned
char
*
data
,
int
len
,
const
char
*
label
,
int
constant
);
extern
void
add_import_dll
(
const
char
*
name
);
extern
void
add_ignore_symbol
(
const
char
*
name
);
extern
int
resolve_imports
(
FILE
*
outfile
);
extern
int
output_imports
(
FILE
*
outfile
);
extern
void
load_res32_file
(
const
char
*
name
);
...
...
This diff is collapsed.
Click to expand it.
tools/winebuild/import.c
+
48
−
10
View file @
4f12e61c
...
...
@@ -26,6 +26,10 @@ static char **undef_symbols; /* list of undefined symbols */
static
int
nb_undef_symbols
=
-
1
;
static
int
undef_size
;
static
char
**
ignore_symbols
;
/* list of symbols to ignore */
static
int
nb_ignore_symbols
;
static
int
ignore_size
;
static
struct
import
**
dll_imports
=
NULL
;
static
int
nb_imports
=
0
;
/* number of imported dlls */
static
int
total_imports
=
0
;
/* total number of imported functions */
...
...
@@ -143,6 +147,17 @@ void add_import_dll( const char *name )
dll_imports
[
nb_imports
++
]
=
imp
;
}
/* Add a symbol to the ignored symbol list */
void
add_ignore_symbol
(
const
char
*
name
)
{
if
(
nb_ignore_symbols
==
ignore_size
)
{
ignore_size
+=
32
;
ignore_symbols
=
xrealloc
(
ignore_symbols
,
ignore_size
*
sizeof
(
*
ignore_symbols
)
);
}
ignore_symbols
[
nb_ignore_symbols
++
]
=
xstrdup
(
name
);
}
/* add a function to the list of imports from a given dll */
static
void
add_import_func
(
struct
import
*
imp
,
const
char
*
name
)
{
...
...
@@ -162,6 +177,19 @@ inline static void add_undef_symbol( const char *name )
undef_symbols
[
nb_undef_symbols
++
]
=
xstrdup
(
name
);
}
/* remove all the holes in the undefined symbol list; return the number of removed symbols */
static
int
remove_symbol_holes
(
void
)
{
int
i
,
off
;
for
(
i
=
off
=
0
;
i
<
nb_undef_symbols
;
i
++
)
{
if
(
!
undef_symbols
[
i
])
off
++
;
else
undef_symbols
[
i
-
off
]
=
undef_symbols
[
i
];
}
nb_undef_symbols
-=
off
;
return
off
;
}
/* add the extra undefined symbols that will be contained in the generated spec file itself */
static
void
add_extra_undef_symbols
(
void
)
{
...
...
@@ -245,15 +273,31 @@ void read_undef_symbols( const char *name )
if
((
err
=
pclose
(
f
)))
fatal_error
(
"nm -u %s error %d
\n
"
,
name
,
err
);
}
static
void
remove_ignored_symbols
(
void
)
{
int
i
;
sort_symbols
(
ignore_symbols
,
nb_ignore_symbols
);
for
(
i
=
0
;
i
<
nb_undef_symbols
;
i
++
)
{
if
(
find_symbol
(
undef_symbols
[
i
],
ignore_symbols
,
nb_ignore_symbols
))
{
free
(
undef_symbols
[
i
]
);
undef_symbols
[
i
]
=
NULL
;
}
}
remove_symbol_holes
();
}
/* resolve the imports for a Win32 module */
int
resolve_imports
(
FILE
*
outfile
)
{
int
i
,
j
,
off
;
char
**
p
;
int
i
,
j
;
if
(
nb_undef_symbols
==
-
1
)
return
0
;
/* no symbol file specified */
add_extra_undef_symbols
();
remove_ignored_symbols
();
for
(
i
=
0
;
i
<
nb_imports
;
i
++
)
{
...
...
@@ -265,18 +309,12 @@ int resolve_imports( FILE *outfile )
if
(
res
)
{
add_import_func
(
imp
,
res
);
free
(
undef_symbols
[
j
]
);
undef_symbols
[
j
]
=
NULL
;
}
}
/* remove all the holes in the undef symbols list */
p
=
undef_symbols
;
for
(
j
=
off
=
0
;
j
<
nb_undef_symbols
;
j
++
)
{
if
(
!
undef_symbols
[
j
])
off
++
;
else
undef_symbols
[
j
-
off
]
=
undef_symbols
[
j
];
}
nb_undef_symbols
-=
off
;
if
(
!
off
)
warn_unused
(
imp
);
if
(
!
remove_symbol_holes
())
warn_unused
(
imp
);
}
return
1
;
}
...
...
This diff is collapsed.
Click to expand it.
tools/winebuild/parser.c
+
24
−
0
View file @
4f12e61c
...
...
@@ -143,6 +143,24 @@ static void ParseDebug(void)
}
/*******************************************************************
* ParseIgnore
*
* Parse an 'ignore' definition.
*/
static
void
ParseIgnore
(
void
)
{
char
*
token
=
GetToken
(
0
);
if
(
*
token
!=
'('
)
fatal_error
(
"Expected '(' got '%s'
\n
"
,
token
);
for
(;;)
{
token
=
GetToken
(
0
);
if
(
*
token
==
')'
)
break
;
add_ignore_symbol
(
token
);
}
}
/*******************************************************************
* ParseVariable
*
...
...
@@ -583,6 +601,12 @@ SPEC_TYPE ParseTopLevel( FILE *file )
fatal_error
(
"debug channels only supported for Win32 spec files
\n
"
);
ParseDebug
();
}
else
if
(
strcmp
(
token
,
"ignore"
)
==
0
)
{
if
(
SpecType
!=
SPEC_WIN32
)
fatal_error
(
"'ignore' only supported for Win32 spec files
\n
"
);
ParseIgnore
();
}
else
if
(
strcmp
(
token
,
"@"
)
==
0
)
{
if
(
SpecType
!=
SPEC_WIN32
)
...
...
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