Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
tintin++ ogg sound player script for linux
Author: Robert Smith
Submitted by: Vladaar
6Dragons ogg Soundpack
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.4
Author: Vladaar
Submitted by: Vladaar
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
Users Online
CommonCrawl, Yandex, DotBot, Sogou, Bing

Members: 0
Guests: 4
Stats
Files
Topics
Posts
Members
Newest Member
481
3,740
19,396
629
DarrenPayn
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » General » Coding » #ifdef
Forum Rules | Mark all | Recent Posts

#ifdef
< Newer Topic :: Older Topic > Can code control them?

Pages:<< prev 1 next >>
Post is unread #1 Nov 12, 2003, 11:37 pm
Go to the top of the page
Go to the bottom of the page

Greven
Magician
GroupMembers
Posts204
JoinedMar 5, 2005

Since I can't seem to get valgrind working for me, I am attempting to find other ways of hunting down memory leaks. One way that I am trying is with the memory code from this website. Now, using it requires that DEBUG either be defined with the compilation, or somewhere in the code, via #define DEBUG. But, since I LOVE to make whatever I can OLC, I'd like to be able to turn it on and off via cset. I know I can make it check sysdata->DEBUG, but if checks will only work inside functions, and therefore I can't make it define anything outside of it. I also don't think that I can, from withing a functions, define something with an if check, like:
 if ( sys->DEBUG ){#define DEBUG}else{#undef DEBUG}
If I'm totally wrong, I'd like to know, or if anyone can shed some light on this, I'm semi-self taught, no books or classes, so I'm not sure about this. Thanks for the help.
       
Post is unread #2 Nov 13, 2003, 9:58 am
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,644
JoinedJan 1, 2002

That's not going to work for something they want done as a compiler flag. Easiest way to handle something of this nature is to add it to the Makefile and compile from that. On your C_FLAGS line in the Makefile add a -DDEBUG and then make clean. You'll get what you wanted that way.
       
Post is unread #3 Nov 13, 2003, 12:04 pm
Go to the top of the page
Go to the bottom of the page

Greven
Magician
GroupMembers
Posts204
JoinedMar 5, 2005

Thats what I have been doing, I was just trying to see if I could control it without shell access, I'm only at home about 50% of my mud time, and it would be nice to be able to do the work without editing my makefile everytime. It exports 2.5 meg log files, so I don't always want it on.
       
Pages:<< prev 1 next >>