8145740: Visual Studio pragmas should be guarded by ifdef _MSC_VER
Reviewed-by: simonis, dholmes
Contributed-by: Matthias Baesken <matthias.baesken@sap.com>
--- a/hotspot/src/share/vm/utilities/growableArray.hpp Tue Jan 26 17:13:18 2016 +0100
+++ b/hotspot/src/share/vm/utilities/growableArray.hpp Tue Jan 26 21:18:08 2016 -0500
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -169,7 +169,9 @@
: GenericGrowableArray(initial_size, 0, C_heap, F) {
_data = (E*)raw_allocate(sizeof(E));
// Needed for Visual Studio 2012 and older
+#ifdef _MSC_VER
#pragma warning(suppress: 4345)
+#endif
for (int i = 0; i < _max; i++) ::new ((void*)&_data[i]) E();
}
@@ -422,7 +424,9 @@
int i = 0;
for ( ; i < _len; i++) ::new ((void*)&newData[i]) E(_data[i]);
// Needed for Visual Studio 2012 and older
+#ifdef _MSC_VER
#pragma warning(suppress: 4345)
+#endif
for ( ; i < _max; i++) ::new ((void*)&newData[i]) E();
for (i = 0; i < old_max; i++) _data[i].~E();
if (on_C_heap() && _data != NULL) {