[php-src] PR #17472: Use built-ins for addition and subtraction on Windows
| From: | cmb69 | Date: | Tue, 14 Jan 2025 17:57:42 +0000 |
| Subject: | [php-src] PR #17472: Use built-ins for addition and subtraction on Windows | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-30387@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/17472
Author: cmb69
For Clang, we just need to define the respective macros, since these built-ins are available in all
supported Clang versions (>= 4.0.0, currently)[1].
For MSVC (and possibly other compilers) we use the respective APIs of intsafe.h[2] which are
available as of Windows 7/Server 2008 R2.
This avoids the UB due to signed integer overflow that may happen with our fallback implementations.
[1] <https://releases.llvm.org/4.0.0/tools/clang/docs/LanguageExtensions.html>
[2] <https://learn.microsoft.com/en-us/windows/win32/api/intsafe/>