| www.delorie.com/archives/browse.cgi | search |
| From: | Philosopher DOT bbs AT cszone DOT cc DOT ntu DOT edu DOT tw (¦â¤£²§ªÅ|ªÅ¤£²§¦â) |
| Newsgroups: | comp.os.msdos.djgpp |
| Subject: | call constructors for global objects? |
| Date: | 26 Nov 1998 01:43:15 GMT |
| Organization: | µ{¦¡³]p¼Ö¶é(CSZone) |
| Lines: | 28 |
| Message-ID: | <3RciX4$Q4x@cszone.cc.ntu.edu.tw> |
| NNTP-Posting-Host: | cszone.cc.ntu.edu.tw |
| X-Filename: | n.djgpp/M.912044596.A |
| To: | djgpp AT delorie DOT com |
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
| Reply-To: | djgpp AT delorie DOT com |
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
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |