Skip to content

Commit 7baaeb8

Browse files
committed
further offset fix
1 parent 4812438 commit 7baaeb8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ext/intl/calendar/calendar_class.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,13 +247,14 @@ static zend_object *Calendar_object_create(zend_class_entry *ce)
247247
void calendar_register_IntlCalendar_class(void)
248248
{
249249
/* Create and register 'IntlCalendar' class. */
250+
Calendar_object empty;
250251
Calendar_ce_ptr = register_class_IntlCalendar();
251252
Calendar_ce_ptr->default_object_handlers = &Calendar_handlers;
252253
Calendar_ce_ptr->create_object = Calendar_object_create;
253254

254255
memcpy( &Calendar_handlers, &std_object_handlers,
255256
sizeof Calendar_handlers);
256-
Calendar_handlers.offset = XtOffsetOf(Calendar_object, zo);
257+
Calendar_handlers.offset = reinterpret_cast<char *>(&empty.zo) - reinterpret_cast<char *>(&empty);
257258
Calendar_handlers.clone_obj = Calendar_clone_obj;
258259
Calendar_handlers.get_debug_info = Calendar_get_debug_info;
259260
Calendar_handlers.free_obj = Calendar_objects_free;

0 commit comments

Comments
 (0)