[ LUGOS-PROG ] #define in (...)

David Klasinc bigwhale at m42.cx
Thu May 31 14:38:18 CEST 2001


On Wednesday 30 May 2001 15:20, Rok Papež wrote:

> V nekem programu imam en kup
> #ifdef DEBUG
> 	if(debeg > 5)
> 	printf("Neki je slo recimo narobe %d", xy);
> #endif
> #ifdef DEBUG
> 	if (debug > 10)
> 	printf("Blahblah yadayada %s, %d, %s",string1,int1,string2);
> #endif
>
> Kako bi se dalo to nepregledno #ifdef kolobocijo po domace
> receno "likvidirati" ?
> Najraje bi definirial nekaj v smislu:
>
> #ifdef DEBUG
>   printf_debug(level, ...)  if(debug>level) printf(...)
> #else
>   printf_debug(levle, ...)
> #endif

Mogoce recimo tkole:

#ifdef DEBUF
switch (debug)
{
	case 0:
	case 1:
	case 2:
		printf("Whooops, I did it again...\n");

	case 3:
	case 4:
		printf("It wasn't me!\n");
	...
	default:
		printf("General Failure, Sir!\n");
}


#endif



mogoce...


David!




More information about the lugos-prog mailing list