Disable 'variable' in Win32 spec files.
Added support for forwarded 'extern' ordinals.
diff --git a/tools/winebuild/parser.c b/tools/winebuild/parser.c
index 4ba6506..37a1824 100644
--- a/tools/winebuild/parser.c
+++ b/tools/winebuild/parser.c
@@ -136,8 +136,12 @@
int *value_array;
int n_values;
int value_array_size;
+ const char *token;
- const char *token = GetToken(0);
+ if (SpecType == SPEC_WIN32)
+ fatal_error( "'variable' not supported in Win32, use 'extern' instead\n" );
+
+ token = GetToken(0);
if (*token != '(') fatal_error( "Expected '(' got '%s'\n", token );
n_values = 0;
@@ -290,8 +294,10 @@
*/
static void ParseExtern( ORDDEF *odp )
{
- if (SpecType == SPEC_WIN16) fatal_error( "'extern' not supported for Win16\n" );
+ if (SpecType == SPEC_WIN16)
+ fatal_error( "'extern' not supported for Win16, use 'variable' instead\n" );
odp->link_name = xstrdup( GetToken(0) );
+ if (strchr( odp->link_name, '.' )) odp->flags |= FLAG_FORWARD;
}
diff --git a/tools/winebuild/spec32.c b/tools/winebuild/spec32.c
index 444603a..6c7228a 100644
--- a/tools/winebuild/spec32.c
+++ b/tools/winebuild/spec32.c
@@ -168,8 +168,12 @@
else switch(odp->type)
{
case TYPE_EXTERN:
- fprintf( outfile, " \"\\t.long " __ASM_NAME("%s") "\\n\"\n", odp->link_name );
- break;
+ if (!(odp->flags & FLAG_FORWARD))
+ {
+ fprintf( outfile, " \"\\t.long " __ASM_NAME("%s") "\\n\"\n", odp->link_name );
+ break;
+ }
+ /* else fall through */
case TYPE_STDCALL:
case TYPE_VARARGS:
case TYPE_CDECL:
@@ -187,9 +191,6 @@
case TYPE_STUB:
fprintf( outfile, " \"\\t.long " __ASM_NAME("%s") "\\n\"\n", make_internal_name( odp, "stub" ) );
break;
- case TYPE_VARIABLE:
- fprintf( outfile, " \"\\t.long " __ASM_NAME("%s") "\\n\"\n", make_internal_name( odp, "var" ) );
- break;
default:
assert(0);
}
@@ -299,25 +300,6 @@
}
}
- /* output variables */
-
- for (i = 0; i < nb_entry_points; i++)
- {
- ORDDEF *odp = EntryPoints[i];
- if (odp->type == TYPE_VARIABLE)
- {
- int j;
- fprintf( outfile, " \"%s:\\n\"\n", make_internal_name( odp, "var" ) );
- fprintf( outfile, " \"\\t.long " );
- for (j = 0; j < odp->u.var.n_values; j++)
- {
- fprintf( outfile, "0x%08x", odp->u.var.values[j] );
- if (j < odp->u.var.n_values-1) fputc( ',', outfile );
- }
- fprintf( outfile, "\\n\"\n" );
- }
- }
-
fprintf( outfile, " \"\\t.text\\n\"\n" );
fprintf( outfile, " \"\\t.align %d\\n\"\n", get_alignment(4) );
fprintf( outfile, ");\n\n" );
@@ -850,7 +832,6 @@
switch(odp->type)
{
case TYPE_EXTERN:
- case TYPE_VARIABLE:
is_data = 1;
/* fall through */
case TYPE_VARARGS:
diff --git a/tools/winebuild/winebuild.man.in b/tools/winebuild/winebuild.man.in
index dbb1a9b..e317dc7 100644
--- a/tools/winebuild/winebuild.man.in
+++ b/tools/winebuild/winebuild.man.in
@@ -196,15 +196,15 @@
.IB ordinal\ variable
.RI [ flags ]\ exportname \ \fB(\fR\ [ data... ] \ \fB)
.br
+.IB ordinal\ extern
+.RI [ flags ]\ exportname\ symbolname
+.br
.IB ordinal\ stub
.RI [ flags ]\ exportname
.br
.IB ordinal\ equate
.RI [ flags ]\ exportname\ data
.br
-.IB ordinal\ extern
-.RI [ flags ]\ exportname\ symbolname
-.br
.IB ordinal\ forward
.RI [ flags ]\ exportname\ forwardname
.br
@@ -351,6 +351,28 @@
containing 4 ints:
.IP
2 variable VariableA(-1 0xff 0 0)
+.PP
+This declaration only works in Win16 spec files. In Win32 you should
+use
+.B extern
+instead (see below).
+.SS "Extern ordinals"
+Syntax:
+.br
+.IB ordinal\ extern
+.RI [ flags ]\ exportname\ symbolname
+.PP
+This declaration defines an entry that simply maps to a C symbol
+(variable or function). It only works in Win32 spec files.
+.I exportname
+will point to the symbol
+.I symbolname
+that must be defined in the C code. Alternatively, it can be of the
+form
+.IB dllname . symbolname
+to define a forwarded symbol (one whose implementation is in another
+dll).
+
.SS "Stub ordinals"
Syntax:
.br
@@ -371,19 +393,6 @@
will be the name available for dynamic linking.
.I data
can be a decimal number or a hex number preceeded by "0x".
-.SS "Extern ordinals"
-Syntax:
-.br
-.IB ordinal\ extern
-.RI [ flags ]\ exportname\ symbolname
-.PP
-This declaration defines an entry that simply maps to a C symbol
-(variable or function).
-.I exportname
-will point to the symbol
-.I symbolname
-that must be defined in C code. This declaration only works in Win32
-spec files.
.SS "Forwarded ordinals"
Syntax:
.br