www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - C++ _declspec(selectany) CApp* theApp=0;

reply BLS <nanali nospam-wanadoo.fr> writes:
_declspec(selectany) CApp* theApp=0;
I guess it is just a global var .... in D probabely simply :

CApp theApp = null;

I don't know. Some ideas ?
Bjoern
Sep 27 2007
parent Nathan Reed <nathaniel.reed gmail.com> writes:
BLS wrote:
 _declspec(selectany) CApp* theApp=0;
 I guess it is just a global var .... in D probabely simply :
 
 CApp theApp = null;
 
 I don't know. Some ideas ?
 Bjoern
In C++, declspec(selectany) is a directive to the linker to ignore multiple definitions of a symbol, and just pick one arbitrarily at link time. In D, there is no equivalent, but then you shouldn't need one, as you can define the variable in some module and import the module in all other modules that need it. Thanks, Nathan Reed
Sep 27 2007