From 1d9e80a53d84910acbde81715dbde9aef3320c47 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Fri, 7 Feb 2020 18:24:46 +0100 Subject: [PATCH] Simplify COM_ERR_CONST definition for x64 This is also a wee bit faster. --- ext/com_dotnet/com_extension.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/ext/com_dotnet/com_extension.c b/ext/com_dotnet/com_extension.c index e791cb0126..1353f48cb4 100644 --- a/ext/com_dotnet/com_extension.c +++ b/ext/com_dotnet/com_extension.c @@ -246,11 +246,7 @@ PHP_MINIT_FUNCTION(com_dotnet) #define COM_CONST(x) REGISTER_LONG_CONSTANT(#x, x, CONST_CS|CONST_PERSISTENT) #if SIZEOF_ZEND_LONG == 8 -# define COM_ERR_CONST(x) { \ - zend_long __tmp; \ - ULongToIntPtr(x, &__tmp); \ - REGISTER_LONG_CONSTANT(#x, __tmp, CONST_CS|CONST_PERSISTENT); \ -} +# define COM_ERR_CONST(x) REGISTER_LONG_CONSTANT(#x, (zend_long) (ULONG) (x), CONST_CS|CONST_PERSISTENT) #else # define COM_ERR_CONST COM_CONST #endif -- 2.49.0