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

Change #if DEF to #if defined(DEF)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4
    • 14
    • None
    • core-libs
    • b11

    Description

      With the fix for JDK-8211146 several C-preprocessor statements of form #elif __linux__ were changed to more accurate #elif defined(__linux__).

      grep found a few more occurrences of the same pattern.

      For example (not a complete list):

      diff --git a/src/java.base/unix/native/libnio/ch/SocketChannelImpl.c b/src/java.base/unix/native/libnio/ch/SocketChannelImpl.c
      --- a/src/java.base/unix/native/libnio/ch/SocketChannelImpl.c
      +++ b/src/java.base/unix/native/libnio/ch/SocketChannelImpl.c
      @@ -31,7 +31,7 @@
       #include <string.h>
       #include <poll.h>
      .
      -#if __linux__
      +#if defined(__linux__)
       #include <netinet/in.h>
       #endif
      .
      diff --git a/src/jdk.sctp/unix/native/libsctp/SctpNet.c b/src/jdk.sctp/unix/native/libsctp/SctpNet.c
      --- a/src/jdk.sctp/unix/native/libsctp/SctpNet.c
      +++ b/src/jdk.sctp/unix/native/libsctp/SctpNet.c
      @@ -400,7 +400,7 @@
           int i, addrCount;
           jobjectArray isaa;
      .
      -#if __solaris__
      +#if defined(__solaris__)
           if ((addrCount = nio_sctp_getpaddrs(fd, id, (void **)&addr_buf)) == -1) {
       #else /* __linux__ */
           if ((addrCount = nio_sctp_getpaddrs(fd, id, (struct sockaddr **)&addr_buf)) == -1) {

      Attachments

        Issue Links

          Activity

            People

              igerasim Ivan Gerasimov
              igerasim Ivan Gerasimov
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: