Mail Archives: djgpp/1998/11/25/21:00:32
How can a C++ program which has its own start-up code invokes
the constructos for global objects?
I found the following code which may be helpful; however,
the symbol __CTOR_LIST__ will not be defined by g++?
#define DO_GLOBAL_CTORS_BODY \
do { \
unsigned long nptrs = (unsigned long) __CTOR_LIST__[0]; \
unsigned i; \
if (nptrs == -1) \
for (nptrs = 0; __CTOR_LIST__[nptrs + 1] != 0; nptrs++); \
for (i = nptrs; i >= 1; i--) \
__CTOR_LIST__[i] ();
} while (0)
#endif
--
³o¬O¤@Ó±Mªù°Q½× programming ©M computer science ªº BBS
³o¸Ì¦³¤H¤u´¼¼z,Ãþ¯«¸gºô¸ô,§Y®É§@·~¨t²Î,¦U¦¡Windows programmingªº±Mª©
¦b cszone.cc.ntu.edu.tw , login:bbs , port 3001~3005
´Á«Ý§Aªº¥[¤J, Â×´I³o¸Ìªº¶é¦a
--
¡° Origin: µ{¦¡³]p¼Ö¶é ¡» From: titan.ee.ntu.edu.tw
- Raw text -