Commit b377f1cd by Richard Kenner

Add support for win32's stdcall functions.

From-SVN: r9588
parent 53fd9c9a
......@@ -9,6 +9,60 @@
#include "i386/gas.h"
/* Value is the number of bytes of arguments automatically
popped when returning from a subroutine call.
FUNDECL is the declaration node of the function (as a tree),
FUNTYPE is the data type of the function (as a tree),
or for a library call it is an identifier node for the subroutine name.
SIZE is the number of bytes of arguments passed on the stack.
This only happens if the function declaration has the STDCALL attribute and
the number of arguments is not variable */
#undef RETURN_POPS_ARGS
#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) \
( \
TREE_CODE (FUNTYPE) == IDENTIFIER_NODE \
? \
0 \
: \
( \
((FUNDECL && (TREE_CODE_CLASS (TREE_CODE (FUNDECL)) == 'd') \
? \
lookup_attribute ("stdcall", \
DECL_MACHINE_ATTRIBUTES (FUNDECL)) != NULL_TREE \
: 0 \
) \
) \
&& \
( \
TYPE_ARG_TYPES (FUNTYPE) == 0 \
|| \
TREE_VALUE (tree_last (TYPE_ARG_TYPES (FUNTYPE))) \
== void_type_node \
) \
) \
? \
(SIZE) \
: \
(aggregate_value_p (TREE_TYPE (FUNTYPE))) \
? \
GET_MODE_SIZE (Pmode) \
: \
0 \
)
/* Value is 1 if the declaration has either of the attributes: CDECL or
STDCALL and 0 otherwise */
#define VALID_MACHINE_DECL_ATTRIBUTE(DECL, ATTR, NAME, ARGS) \
(((TREE_CODE(DECL) == FUNCTION_DECL) \
|| (TREE_CODE(DECL) == FIELD_DECL) \
|| (TREE_CODE(DECL) == TYPE_DECL)) \
&& (is_attribute_p ("stdcall", (NAME)) \
|| is_attribute_p ("cdecl", (NAME))) \
&& (ARGS) == NULL)
#ifdef CPP_PREDEFINES
#undef CPP_PREDEFINES
#endif
......
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