Example #1
0
static inline void maybe_add_dllexport (tree decl) 
{
  if (i386_pe_type_dllexport_p (decl))
    {   
      tree decl_attrs = DECL_ATTRIBUTES (decl);
      if (lookup_attribute ("dllexport", decl_attrs) != NULL_TREE)
	/* Already done.  */
	return;
      DECL_ATTRIBUTES (decl) = tree_cons (get_identifier ("dllexport"),
					  NULL_TREE, decl_attrs);
    }
}
Example #2
0
bool
i386_pe_dllexport_p (tree decl)
{
    if (TREE_CODE (decl) != VAR_DECL
            && TREE_CODE (decl) != FUNCTION_DECL)
        return false;

    if (lookup_attribute ("dllexport", DECL_ATTRIBUTES (decl)))
        return true;

    /* Also mark class members of exported classes with dllexport.  */
    if (associated_type (decl)
            && lookup_attribute ("dllexport",
                                 TYPE_ATTRIBUTES (associated_type (decl))))
        return i386_pe_type_dllexport_p (decl);

    return false;
}
Example #3
0
int
i386_pe_dllexport_p (tree decl)
{
  if (TREE_CODE (decl) != VAR_DECL
      && TREE_CODE (decl) != FUNCTION_DECL)
    return 0;

  /* APPLE LOCAL begin mainline 2005-10-12 */
  if (lookup_attribute ("dllexport", DECL_ATTRIBUTES (decl)))
    return 1;

  /* Also mark class members of exported classes with dllexport.  */
  if (associated_type (decl)
      && lookup_attribute ("dllexport",
                           TYPE_ATTRIBUTES (associated_type (decl))))
    return i386_pe_type_dllexport_p (decl);
  /* APPLE LOCAL end mainline 2005-10-12 */
  
  return 0;
}