Add support for win32's stdcall functions.

From-SVN: r9588
This commit is contained in:
Richard Kenner 1995-05-07 17:28:23 -04:00
parent 53fd9c9a74
commit b377f1cdae
1 changed files with 54 additions and 0 deletions

View File

@ -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