spack/var/spack/repos/builtin/packages/gettext/nvhpc-builtin.patch
Scott McMillan 0015dd0bf8
Enable packages to use the NVIDIA HPC SDK (#19452)
* Enable packages to use the NVIDIA HPC SDK

* fix linter and review items

* fix linter issue

Co-authored-by: Scott McMillan <smcmillan@nvidia.com>
2020-10-22 16:42:48 -05:00

167 lines
7.9 KiB
Diff

--- a/gettext-runtime/gnulib-lib/xalloc-oversized.h 2020-08-21 07:51:29.459375578 -0700
+++ b/gettext-runtime/gnulib-lib/xalloc-oversized.h 2020-08-21 07:53:18.571795663 -0700
@@ -41,10 +41,10 @@
positive and N must be nonnegative. This is a macro, not a
function, so that it works correctly even when SIZE_MAX < N. */
-#if 7 <= __GNUC__
+#if 7 <= __GNUC__ && !defined __NVCOMPILER
# define xalloc_oversized(n, s) \
__builtin_mul_overflow_p (n, s, (__xalloc_count_type) 1)
-#elif 5 <= __GNUC__ && !defined __ICC && !__STRICT_ANSI__
+#elif 5 <= __GNUC__ && !defined __ICC && !__STRICT_ANSI__ && !defined __NVCOMPILER
# define xalloc_oversized(n, s) \
(__builtin_constant_p (n) && __builtin_constant_p (s) \
? __xalloc_oversized (n, s) \
--- a/gettext-runtime/gnulib-lib/intprops.h 2020-08-21 07:51:20.668341900 -0700
+++ b/gettext-runtime/gnulib-lib/intprops.h 2020-08-21 07:52:43.906661856 -0700
@@ -222,7 +222,7 @@
/* True if __builtin_add_overflow (A, B, P) and __builtin_sub_overflow
(A, B, P) work when P is non-null. */
-#if 5 <= __GNUC__ && !defined __ICC
+#if 5 <= __GNUC__ && !defined __ICC && !defined __NVCOMPILER
# define _GL_HAS_BUILTIN_ADD_OVERFLOW 1
-#elif defined __has_builtin
+#elif defined __has_builtin && !defined __NVCOMPILER
# define _GL_HAS_BUILTIN_ADD_OVERFLOW __has_builtin (__builtin_add_overflow)
@@ -240,7 +240,7 @@
/* True if __builtin_add_overflow_p (A, B, C) works, and similarly for
__builtin_mul_overflow_p and __builtin_mul_overflow_p. */
-#define _GL_HAS_BUILTIN_OVERFLOW_P (7 <= __GNUC__)
+#define _GL_HAS_BUILTIN_OVERFLOW_P (7 <= __GNUC__ && !defined __NVCOMPILER)
/* The _GL*_OVERFLOW macros have the same restrictions as the
*_RANGE_OVERFLOW macros, except that they do not assume that operands
--- a/gettext-tools/gnulib-lib/xalloc-oversized.h 2020-08-21 10:19:23.875281647 -0700
+++ b/gettext-tools/gnulib-lib/xalloc-oversized.h 2020-08-21 10:20:40.650583499 -0700
@@ -41,10 +41,10 @@
positive and N must be nonnegative. This is a macro, not a
function, so that it works correctly even when SIZE_MAX < N. */
-#if 7 <= __GNUC__
+#if 7 <= __GNUC__ && !defined __NVCOMPILER
# define xalloc_oversized(n, s) \
__builtin_mul_overflow_p (n, s, (__xalloc_count_type) 1)
-#elif 5 <= __GNUC__ && !defined __ICC && !__STRICT_ANSI__
+#elif 5 <= __GNUC__ && !defined __ICC && !__STRICT_ANSI__ && !defined __NVCOMPILER
# define xalloc_oversized(n, s) \
(__builtin_constant_p (n) && __builtin_constant_p (s) \
? __xalloc_oversized (n, s) \
--- a/gettext-tools/gnulib-lib/intprops.h 2020-08-21 10:18:38.650103825 -0700
+++ b/gettext-tools/gnulib-lib/intprops.h 2020-08-21 10:19:12.379236445 -0700
@@ -222,7 +222,7 @@
/* True if __builtin_add_overflow (A, B, P) and __builtin_sub_overflow
(A, B, P) work when P is non-null. */
-#if 5 <= __GNUC__ && !defined __ICC
+#if 5 <= __GNUC__ && !defined __ICC && !defined __NVCOMPILER
# define _GL_HAS_BUILTIN_ADD_OVERFLOW 1
-#elif defined __has_builtin
+#elif defined __has_builtin && !defined __NVCOMPILER
# define _GL_HAS_BUILTIN_ADD_OVERFLOW __has_builtin (__builtin_add_overflow)
@@ -240,7 +240,7 @@
/* True if __builtin_add_overflow_p (A, B, C) works, and similarly for
__builtin_mul_overflow_p and __builtin_mul_overflow_p. */
-#define _GL_HAS_BUILTIN_OVERFLOW_P (7 <= __GNUC__)
+#define _GL_HAS_BUILTIN_OVERFLOW_P (7 <= __GNUC__ && !defined __NVCOMPILER)
/* The _GL*_OVERFLOW macros have the same restrictions as the
*_RANGE_OVERFLOW macros, except that they do not assume that operands
--- a/gettext-tools/libgrep/intprops.h 2020-08-21 10:31:00.726022663 -0700
+++ b/gettext-tools/libgrep/intprops.h 2020-08-21 10:31:29.946137693 -0700
@@ -222,7 +222,7 @@
/* True if __builtin_add_overflow (A, B, P) and __builtin_sub_overflow
(A, B, P) work when P is non-null. */
-#if 5 <= __GNUC__ && !defined __ICC
+#if 5 <= __GNUC__ && !defined __ICC && !defined __NVCOMPILER
# define _GL_HAS_BUILTIN_ADD_OVERFLOW 1
-#elif defined __has_builtin
+#elif defined __has_builtin && !defined __NVCOMPILER
# define _GL_HAS_BUILTIN_ADD_OVERFLOW __has_builtin (__builtin_add_overflow)
@@ -240,7 +240,7 @@
/* True if __builtin_add_overflow_p (A, B, C) works, and similarly for
__builtin_mul_overflow_p and __builtin_mul_overflow_p. */
-#define _GL_HAS_BUILTIN_OVERFLOW_P (7 <= __GNUC__)
+#define _GL_HAS_BUILTIN_OVERFLOW_P (7 <= __GNUC__ && !defined __NVCOMPILER)
/* The _GL*_OVERFLOW macros have the same restrictions as the
*_RANGE_OVERFLOW macros, except that they do not assume that operands
--- a/gettext-tools/libgettextpo/xalloc-oversized.h 2020-08-21 11:19:50.065564273 -0700
+++ b/gettext-tools/libgettextpo/xalloc-oversized.h 2020-08-21 11:21:14.732898185 -0700
@@ -41,10 +41,10 @@
positive and N must be nonnegative. This is a macro, not a
function, so that it works correctly even when SIZE_MAX < N. */
-#if 7 <= __GNUC__
+#if 7 <= __GNUC__ && !defined __NVCOMPILER
# define xalloc_oversized(n, s) \
__builtin_mul_overflow_p (n, s, (__xalloc_count_type) 1)
-#elif 5 <= __GNUC__ && !defined __ICC && !__STRICT_ANSI__
+#elif 5 <= __GNUC__ && !defined __ICC && !__STRICT_ANSI__ && !defined __NVCOMPILER
# define xalloc_oversized(n, s) \
(__builtin_constant_p (n) && __builtin_constant_p (s) \
? __xalloc_oversized (n, s) \
--- a/gettext-tools/libgettextpo/intprops.h 2020-08-21 11:19:58.703598336 -0700
+++ b/gettext-tools/libgettextpo/intprops.h 2020-08-21 11:20:37.612751786 -0700
@@ -222,7 +222,7 @@
/* True if __builtin_add_overflow (A, B, P) and __builtin_sub_overflow
(A, B, P) work when P is non-null. */
-#if 5 <= __GNUC__ && !defined __ICC
+#if 5 <= __GNUC__ && !defined __ICC && !defined __NVCOMPILER
# define _GL_HAS_BUILTIN_ADD_OVERFLOW 1
-#elif defined __has_builtin
+#elif defined __has_builtin && !defined __NVCOMPILER
# define _GL_HAS_BUILTIN_ADD_OVERFLOW __has_builtin (__builtin_add_overflow)
@@ -240,7 +240,7 @@
/* True if __builtin_add_overflow_p (A, B, C) works, and similarly for
__builtin_mul_overflow_p and __builtin_mul_overflow_p. */
-#define _GL_HAS_BUILTIN_OVERFLOW_P (7 <= __GNUC__)
+#define _GL_HAS_BUILTIN_OVERFLOW_P (7 <= __GNUC__ && !defined __NVCOMPILER)
/* The _GL*_OVERFLOW macros have the same restrictions as the
*_RANGE_OVERFLOW macros, except that they do not assume that operands
--- a/libtextstyle/lib/xalloc-oversized.h 2020-08-21 11:30:13.488022919 -0700
+++ b/libtextstyle/lib/xalloc-oversized.h 2020-08-21 11:31:26.561311097 -0700
@@ -41,10 +41,10 @@
positive and N must be nonnegative. This is a macro, not a
function, so that it works correctly even when SIZE_MAX < N. */
-#if 7 <= __GNUC__
+#if 7 <= __GNUC__ && !defined __NVCOMPILER
# define xalloc_oversized(n, s) \
__builtin_mul_overflow_p (n, s, (__xalloc_count_type) 1)
-#elif 5 <= __GNUC__ && !defined __ICC && !__STRICT_ANSI__
+#elif 5 <= __GNUC__ && !defined __ICC && !__STRICT_ANSI__ && !defined __NVCOMPILER
# define xalloc_oversized(n, s) \
(__builtin_constant_p (n) && __builtin_constant_p (s) \
? __xalloc_oversized (n, s) \
--- a/libtextstyle/lib/intprops.h 2020-08-21 11:30:24.283065492 -0700
+++ b/libtextstyle/lib/intprops.h 2020-08-21 11:30:54.415184325 -0700
@@ -222,7 +222,7 @@
/* True if __builtin_add_overflow (A, B, P) and __builtin_sub_overflow
(A, B, P) work when P is non-null. */
-#if 5 <= __GNUC__ && !defined __ICC
+#if 5 <= __GNUC__ && !defined __ICC && !defined __NVCOMPILER
# define _GL_HAS_BUILTIN_ADD_OVERFLOW 1
-#elif defined __has_builtin
+#elif defined __has_builtin && !defined __NVCOMPILER
# define _GL_HAS_BUILTIN_ADD_OVERFLOW __has_builtin (__builtin_add_overflow)
@@ -240,7 +240,7 @@
/* True if __builtin_add_overflow_p (A, B, C) works, and similarly for
__builtin_mul_overflow_p and __builtin_mul_overflow_p. */
-#define _GL_HAS_BUILTIN_OVERFLOW_P (7 <= __GNUC__)
+#define _GL_HAS_BUILTIN_OVERFLOW_P (7 <= __GNUC__ && !defined __NVCOMPILER)
/* The _GL*_OVERFLOW macros have the same restrictions as the
*_RANGE_OVERFLOW macros, except that they do not assume that operands