Skip to main content
gamedev.net
🔒 Locked

ToDo Makro

Started by Austrian Coder Feb 3, 2004 at 4:11 PM 4 replies 550+ views
Original Post
Austrian Coder
Austrian Coder
Hey people. I want to make a makro called ToDo(".....") e.g.: ToDo("Check if this IF is ok") -> compiling... ... ... n_tools.cpp <-> ToDo: Check if this IF is ok - Line 35 Now i know how i put a massage at the compiling process #pragma message ("Message") but is there a way to add " <-> ToDo: " in front of the message and the " - Line n" at the end of it? It would be nice if someone could gibe me some hints. Christian
UltimaX
UltimaX
Sure, try something like this:

#define ToDo(TASK) /
{ /
char OutputResult[512]; /
sprintf(OutputResult, "<-> ToDo: %s - Line %d", TASK, __LINE__);/
#pragma message(OutputResult) /
}


I didn't test it, but it should work.

-UltimaX-
Ariel Productions

"You wished for a white christmas... Now go shovel your wishes!"

[edited by - UltimaX on February 3, 2004 5:29:20 PM]
Oluseyi
Oluseyi
Look up __FILE__, __LINE__.
Mattias Welander
Mattias Welander
I think UltimaX must have been joking...

Here''s some working and tested code instead:

#define __TOSTR2__(x) #x
#define __TOSTR__(x) __TOSTR2__(x)
#define __STRLINE__ __TOSTR__(__LINE__)
#define TODO(Task) message (" <-> ToDo: " #Task " - Line " __STRLINE__)


void ArbitraryFunction()
{
#pragma TODO(Something)
}

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.