=== modified file 'compat/os/sgi.h'
--- compat/os/sgi.h	2009-02-07 13:59:04 +0000
+++ compat/os/sgi.h	2009-10-02 00:39:28 +0000
@@ -21,6 +21,14 @@
 #define _ABI_SOURCE
 #endif /* USE_ASYNC_IO */
 
+/*
+ * The gcc compiler treats extern inline functions as being extern,
+ * while the SGI MIPSpro compilers treat them as inline. To get equivalent
+ * behavior, we must remove the inline keyword.
+ */
+#if defined(__cplusplus) && !defined(_GNUC_) && !defined(_SQUID_EXTERNNEW_)
+#define _SQUID_EXTERNNEW_ extern
+#endif
 
 #endif /* _SQUID_SGI_ */
 #endif /* SQUID_OS_SGI_H */

=== modified file 'configure.in'
--- configure.in	2009-09-25 04:13:50 +0000
+++ configure.in	2009-10-02 00:36:43 +0000
@@ -2409,6 +2409,7 @@
 	netinet/in.h \
 	netinet/in_systm.h \
 	netinet/ip_fil_compat.h \
+	new \
 	openssl/err.h \
 	openssl/md5.h \
 	openssl/ssl.h \

=== modified file 'include/SquidNew.h'
--- include/SquidNew.h	2009-01-21 03:47:47 +0000
+++ include/SquidNew.h	2009-10-02 00:36:10 +0000
@@ -33,15 +33,38 @@
 #ifndef SQUID_NEW_H
 #define SQUID_NEW_H
 
+/* for compatibility overloads */
+#include "config.h"
+
+/* for xmalloc and xfree functions */
 #include "util.h"
 
+#if defined(__cplusplus)
+/*
+ * Any code using libstdc++ must have externally resolvable overloads
+ * for void * operator new - which means in the .o for the binary,
+ * or in a shared library. static libs don't propogate the symbol
+ * so, look in the translation unit containing main() in squid
+ * for the extern version in squid
+ */
+
+// Assume inline unless the macro is already defined...
+#ifndef _SQUID_EXTERNNEW_
+#ifdef __GNUC_STDC_INLINE__
+#define _SQUID_EXTERNNEW_ extern inline __attribute__((gnu_inline))
+#else
+#define _SQUID_EXTERNNEW_ extern inline
+#endif
+
 /* Any code using libstdc++ must have externally resolvable overloads
  * for void * operator new - which means in the .o for the binary,
  * or in a shared library. static libs don't propogate the symbol
  * so, look in the translation unit containing main() in squid
  * for the extern version in squid
  */
+#HAVE_NEW
 #include <new>
+#endif
 
 _SQUID_EXTERNNEW_ void *operator new(size_t size) throw (std::bad_alloc)
 {
@@ -60,4 +83,6 @@
     xfree (address);
 }
 
+#endif /* not __cplusplus  */
+
 #endif /* SQUID_NEW_H */

=== modified file 'include/util.h'
--- include/util.h	2009-03-06 13:26:57 +0000
+++ include/util.h	2009-10-02 00:29:43 +0000
@@ -72,32 +72,8 @@
 SQUIDCEXTERN void Tolower(char *);
 SQUIDCEXTERN void xfree(void *);
 SQUIDCEXTERN void xxfree(const void *);
-#ifdef __cplusplus
-/*
- * Any code using libstdc++ must have externally resolvable overloads
- * for void * operator new - which means in the .o for the binary,
- * or in a shared library. static libs don't propogate the symbol
- * so, look in the translation unit containing main() in squid
- * for the extern version in squid
- */
-#ifndef _SQUID_EXTERNNEW_
-#if defined(_SQUID_SGI_) && !defined(_GNUC_)
-/*
- * The gcc compiler treats extern inline functions as being extern,
- * while the SGI MIPSpro compilers treat them as inline. To get equivalent
- * behavior, remove the inline keyword.
- */
-#define _SQUID_EXTERNNEW_ extern
-#else
-#ifdef __GNUC_STDC_INLINE__
-#define _SQUID_EXTERNNEW_ extern inline __attribute__((gnu_inline))
-#else
-#define _SQUID_EXTERNNEW_ extern inline
-#endif
-#endif
-#endif
+
 #include "SquidNew.h"
-#endif
 
 /* rfc1738.c */
 SQUIDCEXTERN char *rfc1738_escape(const char *);


