diff options
-rw-r--r-- | src/common.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/common.h b/src/common.h index a6e4ca3e..31e67b90 100644 --- a/src/common.h +++ b/src/common.h @@ -39,13 +39,18 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #ifndef _INTEL_COMMON_H_ #define _INTEL_COMMON_H_ -#ifdef __GNUC__ +/* Provide substitutes for gcc's __FUNCTION__ on other compilers */ +#ifndef __GNUC__ +# if defined(__STDC__) && (__STDC_VERSION__>=199901L) /* C99 */ +# define __FUNCTION__ __func__ +# else +# define __FUNCTION__ "" +# endif +#endif + + #define PFX __FILE__,__LINE__,__FUNCTION__ #define FUNCTION_NAME __FUNCTION__ -#else -#define PFX __FILE__,__LINE__,"" -#define FUNCTION_NAME "" -#endif #ifdef I830DEBUG #define MARKER() ErrorF("\n### %s:%d: >>> %s <<< ###\n\n", \ |