From 082d494605d0249847e6df944991928ea5857210 Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Fri, 13 Nov 2009 14:43:54 +1300 Subject: [PATCH] Compat: __FUNCTION__ not available on SunStudio --- compat/os/solaris.h | 7 ++++++- src/Debug.h | 7 +------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/compat/os/solaris.h b/compat/os/solaris.h index b77db6de67..b88a4d2faa 100644 --- a/compat/os/solaris.h +++ b/compat/os/solaris.h @@ -48,11 +48,16 @@ SQUIDCEXTERN int gethostname(char *, int); /* * SunPro CC handles extern inline as inline, PLUS extern symbols. */ - #if !defined(_SQUID_EXTERNNEW_) && defined(__SUNPRO_CC) #define _SQUID_EXTERNNEW_ extern #endif +/* + * SunStudio CC does not define C++ portability API __FUNCTION__ + */ +#if defined(__SUNPRO_CC) && !defined(__FUNCTION__) +#define __FUNCTION__ __func__ +#endif #endif /* _SQUID_SOLARIS_ */ #endif /* SQUID_OS_SOALRIS_H */ diff --git a/src/Debug.h b/src/Debug.h index 1cce7073ea..1a30f17c9a 100644 --- a/src/Debug.h +++ b/src/Debug.h @@ -117,12 +117,7 @@ const char * SkipBuildPrefix(const char* path); * * debugs(1,2, HERE << "some message"); */ -#ifdef __FUNCTION__ -#define _SQUID__FUNCTION__ __FUNCTION__ -#else -#define _SQUID__FUNCTION__ "" -#endif -#define HERE SkipBuildPrefix(__FILE__)<<"("<<__LINE__<<") "<<_SQUID__FUNCTION__<<": " +#define HERE SkipBuildPrefix(__FILE__)<<"("<<__LINE__<<") "<<__FUNCTION__<<": " /* * MYNAME is for use at debug levels 0 and 1 where HERE is too messy. -- 2.47.2