www.digitalmars.com         C & C++   DMDScript  

c++ - some more __declspec issues

reply Christof Meerwald <cmeerw web.de> writes:
All four classes look quite similar, but DM only generates the same code for
C and D. And I guess that the STLport library expects that all four cases
are identical (and generate the same code as C and D).


struct A
{
  __declspec(dllimport) static int a;
};

int A::a;


struct B
{
  __declspec(dllimport) static int b;
};


struct C
{
  __declspec(dllimport) static int c;
};

__declspec(dllimport) int C::c;


struct D
{
  __declspec(dllimport) static int d;
};


int main()
{
  A a;
  B b;
  C c;
  D d;

  return a.a + b.b + c.c + d.d;
}


int B::b;


bye, Christof

-- 
http://cmeerw.org                                 JID: cmeerw jabber.at
mailto cmeerw at web.de

...and what have you contributed to the Net?
Jul 29 2002
parent "Walter" <walter digitalmars.com> writes:
Fixed and posted as 8.29.20 beta. -Walter

"Christof Meerwald" <cmeerw web.de> wrote in message
news:ai4500$dfj$1 digitaldaemon.com...
 All four classes look quite similar, but DM only generates the same code

 C and D. And I guess that the STLport library expects that all four cases
 are identical (and generate the same code as C and D).


 struct A
 {
   __declspec(dllimport) static int a;
 };

 int A::a;


 struct B
 {
   __declspec(dllimport) static int b;
 };


 struct C
 {
   __declspec(dllimport) static int c;
 };

 __declspec(dllimport) int C::c;


 struct D
 {
   __declspec(dllimport) static int d;
 };


 int main()
 {
   A a;
   B b;
   C c;
   D d;

   return a.a + b.b + c.c + d.d;
 }


 int B::b;


 bye, Christof

 --
 http://cmeerw.org                                 JID: cmeerw jabber.at
 mailto cmeerw at web.de

 ...and what have you contributed to the Net?

Jul 29 2002