version and debug statements

Derek Parnell derek at psych.ward
Thu May 11 18:56:15 PDT 2006


On Thu, 11 May 2006 18:24:17 -0700, Walter Bright wrote:

> James Pelcis wrote:
>> If you are writing a program that will only work on Windows, it would be 
>> necessary to use this...
>> 
>> version (Windows)
>> else
>> {
>>     static assert (0);
>> }
> 
> Instead of:
> 
> 	... windows code ...
> 	version (Windows)
> 	else
> 		static assert(0);
> 
> I suggest:
> 
> 	version (Windows)
> 		... windows code ...
> 	else
> 		static assert(0);

However, the important thing is to convey information to code maintainers.
And the most direct and simplest way is to have this at the TOP of your
source code ...

  version (Windows)
  else {
        pragma(msg, "Only compilable in Windows environment.");
	static assert(0);
  }

  ... windows code ...

-- 
Derek
(skype: derek.j.parnell)
Melbourne, Australia
"Down with mediocracy!"
12/05/2006 11:53:48 AM



More information about the Digitalmars-d mailing list