On Mon, 12 Mar 2001, Alexander Mai stated:
> cc: Error: RowColumn.c, line 1648: In this statement, "__FUNCTION__" is not declared.
>     DEBUGOUT(XdbDebug("EMACS", realpar, "%s:%s(%d) - GRAB %i %i\n", __FILE__, 
>__FUNCTION__, __LINE__,
> ----^
> 
> Please use gcc extensions only within some #ifdef gcc or whatever appropriate.
> (__GNUC__ ?)

An arguably more elegant way is to say

#ifndef __GNUC__
#define __FUNCTION__ "(not known)"
#endif

and then just use __FUNCTION__. It won't work quite the same with
non-GCC compilers as with GCC, but it will, at least, compile with both.

(you can also #define __attribute__() to nothing in there, too, and that sort of 
thing.)

-- 
`I wish the garbage collection service for my apartment was half as aggressive
 as the one in GNU ld.' --- Phil Edwards

Reply via email to