From c4d86b2455ba0dad12de2f7e35a67c91279385b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20=C3=96sterlund?= Date: Tue, 6 Jun 2017 13:31:34 -0400 Subject: [PATCH] 8161145: The min/max macros make hotspot tests fail to build with GCC 6 Change min/max macros to expand (once) to self. Reviewed-by: sgehwolf, pliden, andrew --- hotspot/src/share/vm/utilities/globalDefinitions.hpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/hotspot/src/share/vm/utilities/globalDefinitions.hpp b/hotspot/src/share/vm/utilities/globalDefinitions.hpp index e07ed31678d..dbb080ef6e3 100644 --- a/hotspot/src/share/vm/utilities/globalDefinitions.hpp +++ b/hotspot/src/share/vm/utilities/globalDefinitions.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, 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 @@ -1095,8 +1095,11 @@ inline intptr_t bitfield(intptr_t x, int start_bit_no, int field_length) { #undef min #endif -#define max(a,b) Do_not_use_max_use_MAX2_instead -#define min(a,b) Do_not_use_min_use_MIN2_instead +// The following defines serve the purpose of preventing use of accidentally +// included min max macros from compiling, while continuing to allow innocent +// min and max identifiers in the code to compile as intended. +#define max max +#define min min // It is necessary to use templates here. Having normal overloaded // functions does not work because it is necessary to provide both 32-