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

Should consider replacing IS_WIN_* macros with a function

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P5 P5
    • None
    • 1.4.1
    • client-libs
    • None
    • Fix Understood
    • x86
    • windows_nt

      Using macros to figure out which os was in use was okay when we were only supporting win95 and winnt, but it's getting pretty gross and inefficient now.

      The macros are currently in awt.h
      ./awt.h(114): #define IS_NT (IS_WIN32 && !(::GetVersion() & 0x80000000))
      ./awt.h(115): #define IS_WIN2000 (IS_NT && LOBYTE(LOWORD(::GetVersion())) >= 5)
      ./awt.h(116): #define IS_WINXP (IS_WIN2000 && HIBYTE(LOWORD(::GetVersion())) >= 1)
      ./awt.h(117): #define IS_WIN32S (IS_WIN32 && !IS_NT && LOBYTE(LOWORD(::GetVersion())) < 4)
      ./awt.h(118): #define IS_WIN95 (IS_WIN32 && !IS_NT && LOBYTE(LOWORD(::GetVersion())) >= 4)
      ./awt.h(119): #define IS_WIN98 (IS_WIN95 && HIBYTE(LOWORD(::GetVersion())) >= 10)
      ./awt.h(120): #define IS_WINME (IS_WIN95 && HIBYTE(LOWORD(::GetVersion())) >= 90)
      ./awt.h(121): #define IS_WIN4X (IS_WIN32 && LOBYTE(::GetVersion()) >= 4)
      ./awt.h(122): #define IS_WINVER_ATLEAST(maj, min)

      I suggest using a method, perhaps in awt_Component.cpp, or possibly we should
      come up with a more appropriate place for this functionality. Perhaps we
      should add an awt_util.cpp file, analogous to the awt_util.c file we have for
      the unix side.

      We should include other client groups in this discussion, since it affects
      their code as well. They use the existing macros sometimes, and use their
      own methodology other times.

            Unassigned Unassigned
            ehawkessunw Eric Hawkes (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: