Don't override operator new if GDB is built with -fsanitize=address
[deliverable/binutils-gdb.git] / gdb / common / new-op.c
index 5ba4d6e9ca6b88f9d03d6bff82bf24fe050d3c66..f04c5cbbfc0f12fd08258a8a85d79dca7faba6f8 100644 (file)
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
+/* GCC does not understand __has_feature.  */
+#if !defined(__has_feature)
+# define __has_feature(x) 0
+#endif
+
+#if !__has_feature(address_sanitizer) && !defined(__SANITIZE_ADDRESS__)
 #include "common-defs.h"
 #include "host-defs.h"
 #include <new>
@@ -83,3 +89,4 @@ operator new[] (std::size_t sz, const std::nothrow_t&)
 {
   return ::operator new (sz, std::nothrow);
 }
+#endif
This page took 0.023578 seconds and 4 git commands to generate.