home *** CD-ROM | disk | FTP | other *** search
/ Programming Win32 Under the API / ProgrammingWin32UnderTheApiPatVillani.iso / patches / gcc-2_95_2-x86-win32-patches.zi / gcc-2.95.2-patches / broken-down / gcc-2.95.2-winnt.diff < prev   
Encoding:
Text File  |  1999-11-08  |  1.9 KB  |  70 lines

  1. Wed Aug 12 18:18:16 1998  Mumit Khan  <khan@xraylith.wisc.edu>
  2.  
  3.     * i386/winnt.c (i386_pe_dllexport_p): Check TREE_TYPE for
  4.     attributes as well for C++ class members.
  5.     (i386_pe_dllimport_p): Likewise.
  6.  
  7. Index: gcc-2.95.2/gcc/config/i386//winnt.c
  8. ===================================================================
  9. RCS file: /homes/khan/src/CVSROOT/gcc-2.95.2/gcc/config/i386/winnt.c,v
  10. retrieving revision 1.1.1.1
  11. diff -u -3 -p -r1.1.1.1 winnt.c
  12. --- gcc-2.95.2/gcc/config/i386/winnt.c    1999/11/05 01:09:55    1.1.1.1
  13. +++ gcc-2.95.2/gcc/config/i386/winnt.c    1999/11/05 05:40:04
  14. @@ -169,6 +169,7 @@ i386_pe_dllexport_p (decl)
  15.       tree decl;
  16.  {
  17.    tree exp;
  18. +  tree context;
  19.  
  20.    if (TREE_CODE (decl) != VAR_DECL
  21.        && TREE_CODE (decl) != FUNCTION_DECL)
  22. @@ -178,12 +179,18 @@ i386_pe_dllexport_p (decl)
  23.      return 1;
  24.  
  25.    /* Class members get the dllexport status of their class.  */
  26. -  if (associated_type (decl))
  27. +  context = associated_type (decl);
  28. +  if (context)
  29.      {
  30.        exp = lookup_attribute ("dllexport",
  31. -                  TYPE_ATTRIBUTES (associated_type (decl)));
  32. +                  TYPE_ATTRIBUTES (context));
  33.        if (exp)
  34.      return 1;
  35. +
  36. +      exp = lookup_attribute ("dllexport",
  37. +                  TREE_TYPE (context));
  38. +      if (exp)
  39. +    return 1;
  40.      }
  41.  
  42.    return 0;
  43. @@ -196,6 +203,7 @@ i386_pe_dllimport_p (decl)
  44.       tree decl;
  45.  {
  46.    tree imp;
  47. +  tree context;
  48.  
  49.    if (TREE_CODE (decl) == FUNCTION_DECL
  50.        && TARGET_NOP_FUN_DLLIMPORT)
  51. @@ -209,10 +217,16 @@ i386_pe_dllimport_p (decl)
  52.      return 1;
  53.  
  54.    /* Class members get the dllimport status of their class.  */
  55. -  if (associated_type (decl))
  56. +  context = associated_type (decl);
  57. +  if (context)
  58.      {
  59. +      imp = lookup_attribute ("dllimport",
  60. +                  TYPE_ATTRIBUTES (context));
  61. +      if (imp)
  62. +    return 1;
  63. +
  64.        imp = lookup_attribute ("dllimport",
  65. -                  TYPE_ATTRIBUTES (associated_type (decl)));
  66. +                  TREE_TYPE (context));
  67.        if (imp)
  68.      return 1;
  69.      }
  70.