Re: #if BOCHS_DEBUG_HACK

Michael Pfeiffer <[email protected]>
Newsgroups gmane.os.openbeos.kernel.devel
Message-ID <[email protected]>
>
> http://cvs.sourceforge.net/viewcvs.py/*checkout*/open-beos/current/ 
> src/kernel/core/arch/x86/arch_dbg_console.c?rev=1.12
>
> "The BOCHS_DEBUG_HACK definition now only enables support for the bochs
> debug output - to activate it, you now have to enable it in the kernel
> settings file ("bochs_debug_output true")."
> [snip]
>
> There's one #ifdef BOCHS_DEBUG_HACK and a couple of #if.
> The latter appear not to be working without the true/false setting.
>
To avoid a compiler error, if BOCHS_DEBUG_HACK = 0,
the #ifdef should be changed to #if.

> From the IRC channel (#Haiku):
>
> <mmu_man> #if FOO is legal only if FOO is always defined and has a
> value
>
> Jack Burton suggested uncommenting the line
> // #define BOCHS_DEBUG_HACK 0
>
> If the kernel settings file** is always part of the build,
> bochs_debug_output can be set to false as default.

It does not matter. If the file or the property does not exist it  
defaults to false anyway.

> If not, I think #ifdefs would be the better choice.

This would change the meaning of the macro. Do not know if this is  
desired?
To be on the safe side and to keep the semantics as it is, I suggest to  
add somewhere before the #ifs:
#ifndef BOCHS_DEBUG_HACK
#define BOCHS_DEBUG_HACK 0 // disabled by default
#endif

Regards
Michael



-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.