Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
75c3c37b
Commit
75c3c37b
authored
Jul 15, 2004
by
Pierre d'Herbemont
Committed by
Alexandre Julliard
Jul 15, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Darwin/Mac OS X Weak import workaround.
parent
c5cbf715
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
spec32.c
tools/winebuild/spec32.c
+11
-11
No files found.
tools/winebuild/spec32.c
View file @
75c3c37b
...
...
@@ -76,16 +76,18 @@ static const char *make_internal_name( const ORDDEF *odp, DLLSPEC *spec, const c
*
* Output a prototype for a weak function.
*/
static
void
declare_weak_function
(
FILE
*
outfile
,
const
char
*
name
,
const
char
*
prototype
)
static
void
declare_weak_function
(
FILE
*
outfile
,
const
char
*
ret_type
,
const
char
*
name
,
const
char
*
params
)
{
fprintf
(
outfile
,
"#ifdef __GNUC__
\n
"
);
fprintf
(
outfile
,
"# ifdef __APPLE__
\n
"
);
fprintf
(
outfile
,
"extern %s __attribute__((weak_import));
\n
"
,
prototype
);
fprintf
(
outfile
,
"extern %s %s(%s) __attribute__((weak_import));
\n
"
,
ret_type
,
name
,
params
);
fprintf
(
outfile
,
"static %s (*__wine_spec_weak_%s)(%s) = %s;
\n
"
,
ret_type
,
name
,
params
,
name
);
fprintf
(
outfile
,
"#define %s __wine_spec_weak_%s
\n
"
,
name
,
name
);
fprintf
(
outfile
,
"# else
\n
"
);
fprintf
(
outfile
,
"extern %s
__attribute__((weak));
\n
"
,
prototype
);
fprintf
(
outfile
,
"extern %s
%s(%s) __attribute__((weak));
\n
"
,
ret_type
,
name
,
params
);
fprintf
(
outfile
,
"# endif
\n
"
);
fprintf
(
outfile
,
"#else
\n
"
);
fprintf
(
outfile
,
"extern %s
;
\n
"
,
prototype
);
fprintf
(
outfile
,
"extern %s
%s(%s);
\n
"
,
ret_type
,
name
,
params
);
fprintf
(
outfile
,
"static void __asm__dummy_%s(void)"
,
name
);
fprintf
(
outfile
,
" { asm(
\"
.weak "
__ASM_NAME
(
"%s"
)
"
\"
); }
\n
"
,
name
);
fprintf
(
outfile
,
"#endif
\n\n
"
);
...
...
@@ -600,8 +602,7 @@ void BuildSpec32File( FILE *outfile, DLLSPEC *spec )
fprintf
(
outfile
,
"extern int __stdcall %s( void*, unsigned int, void* );
\n\n
"
,
init_func
);
else
{
declare_weak_function
(
outfile
,
"DllMain"
,
"int __stdcall DllMain( void*, unsigned int, void* )"
);
declare_weak_function
(
outfile
,
"int __stdcall"
,
"DllMain"
,
"void*, unsigned int, void*"
);
init_func
=
"DllMain"
;
}
fprintf
(
outfile
,
...
...
@@ -624,8 +625,7 @@ void BuildSpec32File( FILE *outfile, DLLSPEC *spec )
fprintf
(
outfile
,
"extern int __stdcall %s( void*, void* );
\n\n
"
,
init_func
);
else
{
declare_weak_function
(
outfile
,
"DriverEntry"
,
"int __stdcall DriverEntry( void*, void* )"
);
declare_weak_function
(
outfile
,
"int __stdcall"
,
"DriverEntry"
,
"void*, void*"
);
init_func
=
"DriverEntry"
;
}
fprintf
(
outfile
,
...
...
@@ -647,9 +647,9 @@ void BuildSpec32File( FILE *outfile, DLLSPEC *spec )
fprintf
(
outfile
,
"extern int %s( int argc, char *argv[] );
\n
"
,
init_func
);
else
{
declare_weak_function
(
outfile
,
"
main"
,
"int main( int argc, char *argv[] )
"
);
declare_weak_function
(
outfile
,
"
wmain"
,
"int wmain( int argc, unsigned short *argv[] )
"
);
declare_weak_function
(
outfile
,
"
WinMain"
,
"int __stdcall WinMain(void *,void *,char *,int)
"
);
declare_weak_function
(
outfile
,
"
int"
,
"main"
,
"int argc, char *argv[]
"
);
declare_weak_function
(
outfile
,
"
int"
,
"wmain"
,
"int argc, unsigned short *argv[]
"
);
declare_weak_function
(
outfile
,
"
int __stdcall"
,
"WinMain"
,
"void *,void *,char *,int
"
);
}
fprintf
(
outfile
,
"
\n
typedef struct {
\n
"
...
...
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