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
22fef333
Commit
22fef333
authored
Jun 05, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegcc: Create a stub main to work around the lack of Unicode support in Mingw.
parent
284438dc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
winegcc.c
tools/winegcc/winegcc.c
+16
-0
No files found.
tools/winegcc/winegcc.c
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
]));
...
...
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