Skip to content

Commit 1d9e80a

Browse files
committed
Simplify COM_ERR_CONST definition for x64
This is also a wee bit faster.
1 parent 4bdc4da commit 1d9e80a

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

ext/com_dotnet/com_extension.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -246,11 +246,7 @@ PHP_MINIT_FUNCTION(com_dotnet)
246246
#define COM_CONST(x) REGISTER_LONG_CONSTANT(#x, x, CONST_CS|CONST_PERSISTENT)
247247

248248
#if SIZEOF_ZEND_LONG == 8
249-
# define COM_ERR_CONST(x) { \
250-
zend_long __tmp; \
251-
ULongToIntPtr(x, &__tmp); \
252-
REGISTER_LONG_CONSTANT(#x, __tmp, CONST_CS|CONST_PERSISTENT); \
253-
}
249+
# define COM_ERR_CONST(x) REGISTER_LONG_CONSTANT(#x, (zend_long) (ULONG) (x), CONST_CS|CONST_PERSISTENT)
254250
#else
255251
# define COM_ERR_CONST COM_CONST
256252
#endif

0 commit comments

Comments
 (0)