From: jsg Date: Mon, 29 Apr 2024 06:06:46 +0000 (+0000) Subject: add check_add_overflow() for 6.6.29 drm X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=4d3df29298314c53d0d7547b3696f27078ee60a7;p=openbsd add check_add_overflow() for 6.6.29 drm --- diff --git a/sys/dev/pci/drm/include/linux/overflow.h b/sys/dev/pci/drm/include/linux/overflow.h index 93615be569b..f4170325716 100644 --- a/sys/dev/pci/drm/include/linux/overflow.h +++ b/sys/dev/pci/drm/include/linux/overflow.h @@ -8,4 +8,8 @@ #define struct_size(p, member, n) \ (sizeof(*(p)) + ((n) * (sizeof(*(p)->member)))) +#if defined(__clang__) || (defined(__GNUC__) && __GNUC__ >= 5) +#define check_add_overflow(x, y, sum) __builtin_add_overflow(x, y, sum) +#endif + #endif