File tree Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -245,11 +245,15 @@ PHP_MINIT_FUNCTION(com_dotnet)
245
245
246
246
#define COM_CONST (x ) REGISTER_LONG_CONSTANT(#x, x, CONST_CS|CONST_PERSISTENT)
247
247
248
- #define COM_ERR_CONST (x ) { \
248
+ #if SIZEOF_ZEND_LONG == 8
249
+ # define COM_ERR_CONST (x ) { \
249
250
zend_long __tmp; \
250
251
ULongToIntPtr(x, &__tmp); \
251
252
REGISTER_LONG_CONSTANT(#x, __tmp, CONST_CS|CONST_PERSISTENT); \
252
253
}
254
+ #else
255
+ # define COM_ERR_CONST COM_CONST
256
+ #endif
253
257
254
258
COM_CONST (CLSCTX_INPROC_SERVER );
255
259
COM_CONST (CLSCTX_INPROC_HANDLER );
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Bug #79242 (COM error constants don't match com_exception codes)
3
+ --SKIPIF--
4
+ <?php
5
+ if (!extension_loaded ('com_dotnet ' )) die ('skip com_dotnet extension not available ' );
6
+ if (PHP_INT_SIZE != 4 ) die ("skip this test is for 32bit platforms only " );
7
+ ?>
8
+ --FILE--
9
+ <?php
10
+ var_dump (
11
+ DISP_E_DIVBYZERO ,
12
+ DISP_E_OVERFLOW ,
13
+ DISP_E_BADINDEX ,
14
+ MK_E_UNAVAILABLE
15
+ );
16
+ ?>
17
+ --EXPECT--
18
+ int(-2147352558)
19
+ int(-2147352566)
20
+ int(-2147352565)
21
+ int(-2147221021)
22
+
You can’t perform that action at this time.
0 commit comments