test_align.cpp fails to build on Windows without precompiled headers

XMLWordPrintable

    • Type: Bug
    • Resolution: Duplicate
    • Priority: P4
    • 11
    • Affects Version/s: 11
    • Component/s: hotspot
    • None

      I get the following compile error on Windows when compiling without precompiled headers:
      t:/workspace/open/test/hotspot/gtest/utilities/test_align.cpp(37) : warning C4003: not enough actual parameters for macro ‘max’

      The likely started to happen after this change:

      changeset: 49262:6e9e88d82781
      user: gziemski
      date: Mon Mar 19 13:57:08 2018 -0500
      summary: 8199356: Fix hotspot to allow stdlib to use libc++ and to allow changing the deployment target to 10.9

      diff --git a/src/hotspot/share/utilities/globalDefinitions.hpp b/src/hotspot/share/utilities/globalDefinitions.hpp
      --- a/src/hotspot/share/utilities/globalDefinitions.hpp
      +++ b/src/hotspot/share/utilities/globalDefinitions.hpp
      @@ -1012,12 +1012,6 @@
       #undef min
       #endif

      -// 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

      This fails on lines containing:
      std::numeric_limits<T>::max()

            Assignee:
            Stefan Karlsson
            Reporter:
            Stefan Karlsson
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: