We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1b12772 commit 4812438Copy full SHA for 4812438
ext/intl/calendar/calendar_class.h
@@ -43,7 +43,13 @@ typedef struct {
43
} Calendar_object;
44
45
static inline Calendar_object *php_intl_calendar_fetch_object(zend_object *obj) {
46
+#ifndef __cplusplus
47
return (Calendar_object *)((char*)(obj) - XtOffsetOf(Calendar_object, zo));
48
+#else
49
+ Calendar_object empty;
50
+ size_t offset = reinterpret_cast<char *>(&empty.zo) - reinterpret_cast<char *>(&empty);
51
+ return reinterpret_cast<Calendar_object *>(reinterpret_cast<char *>(obj) - offset);
52
+#endif
53
}
54
#define Z_INTL_CALENDAR_P(zv) php_intl_calendar_fetch_object(Z_OBJ_P(zv))
55
0 commit comments