|
-
February 20th, 2011, 08:04 AM
#9
Re: how to disable __FILE__ ?
 Originally Posted by sinclaire
MSVC++ 2008. I can see the full filepaths in my hex editor. I'm compiling a dynamic library (.dll) if that matters.
I thought I just ask to see if there's an easy way to get rid of them,
The easy way is to create your own define, and then do a global search and replace.
Code:
#ifdef SHOW_FILE_LINE
#define MY_FILE_MACRO __FILE__
#define MY_LINE_MACRO __LINE__
#else
#define MY_FILE_MACRO
#define MY_LINE_MACRO
#endif
And then replace __FILE_ with MY_FILE_MACRO, and __LINE__ with MY_LINE_MACRO.
Typically, I see most people use a #define switch and set them to empty values,
I have never seen this used. Who are these "most people"?
You can't undefine a compiler preprocessor symbol such as __FILE__ and __LINE__ without invoking undefined behaviour. The __FILE__ and __LINE__ macros are not only compiler macros, they are mandated by the ANSI C++ rules to perform as described -- you can't change them.
Regards,
Paul McKenzie
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|