Commit f354b828 by Jason Merrill Committed by Danny Smith

winnt.c (ix86_handle_dll_attribute): Set DECL_EXTERN and TREE_PUBLIC for…

winnt.c (ix86_handle_dll_attribute): Set DECL_EXTERN and TREE_PUBLIC for dllimported variables here...

	* config/i386/winnt.c (ix86_handle_dll_attribute): Set
	DECL_EXTERN and TREE_PUBLIC for dllimported variables here...
	(i386_pe_mark_dllimport): Not here.

Co-Authored-By: Danny Smith <dannysmith@users.sourceforge.net>

From-SVN: r57215
parent e46b54a2
2002-09-16 Jason Merrill <jason@redhat.com>
Danny Smith <dannysmith@users.sourceforge.net>
* config/i386/winnt.c (ix86_handle_dll_attribute): Set
DECL_EXTERN and TREE_PUBLIC for dllimported variables here...
(i386_pe_mark_dllimport): Not here.
2002-09-16 Nathan Sidwell <nathan@codesourcery.com> 2002-09-16 Nathan Sidwell <nathan@codesourcery.com>
* c-semantics.c (genrtl_do_stmt): Cope with NULL cond. * c-semantics.c (genrtl_do_stmt): Cope with NULL cond.
......
...@@ -78,6 +78,15 @@ ix86_handle_dll_attribute (node, name, args, flags, no_add_attrs) ...@@ -78,6 +78,15 @@ ix86_handle_dll_attribute (node, name, args, flags, no_add_attrs)
} }
} }
/* `extern' needn't be specified with dllimport.
Specify `extern' now and hope for the best. Sigh. */
else if (TREE_CODE (*node) == VAR_DECL
&& is_attribute_p ("dllimport", name))
{
DECL_EXTERNAL (*node) = 1;
TREE_PUBLIC (*node) = 1;
}
return NULL_TREE; return NULL_TREE;
} }
...@@ -302,16 +311,6 @@ i386_pe_mark_dllimport (decl) ...@@ -302,16 +311,6 @@ i386_pe_mark_dllimport (decl)
return; return;
} }
/* `extern' needn't be specified with dllimport.
Specify `extern' now and hope for the best. Sigh. */
if (TREE_CODE (decl) == VAR_DECL
/* ??? Is this test for vtables needed? */
&& !DECL_VIRTUAL_P (decl))
{
DECL_EXTERNAL (decl) = 1;
TREE_PUBLIC (decl) = 1;
}
newname = alloca (strlen (oldname) + 11); newname = alloca (strlen (oldname) + 11);
sprintf (newname, "@i._imp__%s", oldname); sprintf (newname, "@i._imp__%s", oldname);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment