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
Michael Bond
wine
Commits
22fef333
Commit
22fef333
authored
15 years ago
by
Alexandre Julliard
Browse files
Options
Downloads
Patches
Plain Diff
winegcc: Create a stub main to work around the lack of Unicode support in Mingw.
parent
284438dc
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tools/winegcc/winegcc.c
+16
-0
16 additions, 0 deletions
tools/winegcc/winegcc.c
with
16 additions
and
0 deletions
tools/winegcc/winegcc.c
+
16
−
0
View file @
22fef333
...
...
@@ -533,6 +533,19 @@ static void add_library( struct options *opts, strarray *lib_dirs, strarray *fil
free
(
fullname
);
}
/* hack a main or WinMain function to work around Mingw's lack of Unicode support */
static
const
char
*
mingw_unicode_hack
(
struct
options
*
opts
)
{
char
*
main_stub
=
get_temp_file
(
opts
->
output_name
,
".c"
);
create_file
(
main_stub
,
0644
,
"#include <stdlib.h>
\n
"
"extern int wmain(int,wchar_t**);
\n
"
"int main( int argc, char *argv[] )
\n
{
\n
"
" return wmain( argc, __wargv );
\n
}
\n
"
);
return
compile_to_object
(
opts
,
main_stub
,
NULL
);
}
static
void
build
(
struct
options
*
opts
)
{
static
const
char
*
stdlibpath
[]
=
{
DLLDIR
,
LIBDIR
,
"/usr/lib"
,
"/usr/local/lib"
,
"/lib"
};
...
...
@@ -691,6 +704,9 @@ static void build(struct options* opts)
if
(
opts
->
image_base
)
strarray_add
(
link_args
,
strmake
(
"-Wl,--image-base,%s"
,
opts
->
image_base
));
if
(
opts
->
unicode_app
&&
!
opts
->
shared
)
strarray_add
(
link_args
,
mingw_unicode_hack
(
opts
));
for
(
j
=
0
;
j
<
lib_dirs
->
size
;
j
++
)
strarray_add
(
link_args
,
strmake
(
"-L%s"
,
lib_dirs
->
base
[
j
]));
...
...
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