Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8363885

[Windows] Define for _USE_MATH_DEFINES is misplaced

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • None
    • hotspot
    • windows

      globalDefinitions_visCPP.hpp #includes <math.h> after first defining the macro _USE_MATH_DEFINES. This is to make <math.h> provide macros like M_PI. But this is potentially too late. Due to include ordering, <math.h> might already have been included in the current translation unit without that macro being in place. Macros like this one really ought to be provided by the build system. (See, for example, _CRT_SECURE_NO_WARNINGS or __STDC_CONSTANT_MACROS.)

      Note, however, that it appears there are currently no uses of the relevant math macros in HotSpot. So it might be we should just remove the macro, and re-implement it properly if/when someone needs any of those math macros.

            Unassigned Unassigned
            kbarrett Kim Barrett
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: