8211360: Change #if DEF to #if defined(DEF) jdk-14+11
authorigerasim
Wed, 21 Aug 2019 13:49:16 -0700
changeset 57826 bf4c808a4488
parent 57825 8c73d2a46ba9
child 57827 425412369353
8211360: Change #if DEF to #if defined(DEF) Reviewed-by: bpb, vtewari
src/java.base/share/classes/sun/nio/ch/SocketOptionRegistry.java.template
src/java.base/share/native/libfdlibm/fdlibm.h
src/java.base/unix/native/libnio/ch/FileDispatcherImpl.c
src/java.base/windows/native/libjava/java_props_md.c
src/java.security.jgss/share/native/libj2gss/gssapi.h
src/jdk.sctp/unix/native/libsctp/SctpNet.c
--- a/src/java.base/share/classes/sun/nio/ch/SocketOptionRegistry.java.template	Wed Aug 21 12:34:37 2019 -0700
+++ b/src/java.base/share/classes/sun/nio/ch/SocketOptionRegistry.java.template	Wed Aug 21 13:49:16 2019 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved.
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -41,9 +41,9 @@
 #if !defined(SO_REUSEPORT)
 #ifdef _WIN32
 #define SO_REUSEPORT 0
-#elif __linux__
+#elif defined(__linux__)
 #define SO_REUSEPORT 15
-#elif __solaris__
+#elif defined(__solaris__)
 #define SO_REUSEPORT 0x100e
 #elif defined(AIX) || defined(MACOSX)
 #define SO_REUSEPORT 0x0200
--- a/src/java.base/share/native/libfdlibm/fdlibm.h	Wed Aug 21 12:34:37 2019 -0700
+++ b/src/java.base/share/native/libfdlibm/fdlibm.h	Wed Aug 21 13:49:16 2019 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2019, 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
@@ -25,7 +25,7 @@
 
 #ifdef _ALLBSD_SOURCE
 #include <machine/endian.h>
-#elif __linux__
+#elif defined(__linux__)
 #define __USE_BSD 1
 #include <endian.h>
 #endif
--- a/src/java.base/unix/native/libnio/ch/FileDispatcherImpl.c	Wed Aug 21 12:34:37 2019 -0700
+++ b/src/java.base/unix/native/libnio/ch/FileDispatcherImpl.c	Wed Aug 21 13:49:16 2019 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2019, 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
@@ -342,13 +342,13 @@
         JNU_ThrowIOExceptionWithLastError(env, "DirectIO setup failed");
         return result;
     }
-#elif F_NOCACHE
+#elif defined(F_NOCACHE)
     result = fcntl(fd, F_NOCACHE, 1);
     if (result == -1) {
         JNU_ThrowIOExceptionWithLastError(env, "DirectIO setup failed");
         return result;
     }
-#elif DIRECTIO_ON
+#elif defined(DIRECTIO_ON)
     result = directio(fd, DIRECTIO_ON);
     if (result == -1) {
         JNU_ThrowIOExceptionWithLastError(env, "DirectIO setup failed");
--- a/src/java.base/windows/native/libjava/java_props_md.c	Wed Aug 21 12:34:37 2019 -0700
+++ b/src/java.base/windows/native/libjava/java_props_md.c	Wed Aug 21 13:49:16 2019 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2019, 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
@@ -564,9 +564,9 @@
         }
         sprintf(buf, "%d.%d", majorVersion, minorVersion);
         sprops.os_version = _strdup(buf);
-#if _M_AMD64
+#if defined(_M_AMD64)
         sprops.os_arch = "amd64";
-#elif _X86_
+#elif defined(_X86_)
         sprops.os_arch = "x86";
 #else
         sprops.os_arch = "unknown";
--- a/src/java.security.jgss/share/native/libj2gss/gssapi.h	Wed Aug 21 12:34:37 2019 -0700
+++ b/src/java.security.jgss/share/native/libj2gss/gssapi.h	Wed Aug 21 13:49:16 2019 -0700
@@ -43,7 +43,7 @@
 extern "C" {
 #endif /* __cplusplus */
 
-#if TARGET_OS_MAC
+#if defined(TARGET_OS_MAC)
 #    pragma pack(push,2)
 #endif
 
@@ -695,7 +695,7 @@
         gss_name_t *            /* output_name */
 );
 
-#if TARGET_OS_MAC
+#if defined(TARGET_OS_MAC)
 #    pragma pack(pop)
 #endif
 
--- a/src/jdk.sctp/unix/native/libsctp/SctpNet.c	Wed Aug 21 12:34:37 2019 -0700
+++ b/src/jdk.sctp/unix/native/libsctp/SctpNet.c	Wed Aug 21 13:49:16 2019 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2019, 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
@@ -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) {