-#if !defined(HAVE_PARTIAL_SPECIALIZATION) || !defined(HAVE_TEMPLATE_OVERLOAD_RESOLUTION)
- #define USE_ONLY_STATIC_WEAKREF
-#endif
+#if !defined(HAVE_PARTIAL_SPECIALIZATION) || \
+ !defined(HAVE_TEMPLATE_OVERLOAD_RESOLUTION) || \
+ (defined(__GNUC__) && !wxCHECK_GCC_VERSION(3, 3))
+ #define USE_ONLY_STATIC_WEAKREF
+#endif