Skip to content

Adopt zero-length interface members from Objectively; bump to 2.2.0 - #47

Merged
jdolan merged 5 commits into
mainfrom
zero-length-interface
Sep 2, 2026
Merged

Adopt zero-length interface members from Objectively; bump to 2.2.0#47
jdolan merged 5 commits into
mainfrom
zero-length-interface

Conversation

@jdolan

@jdolan jdolan commented Sep 2, 2026

Copy link
Copy Markdown
Owner

Follow-through of jdolan/Objectively#41 and jdolan/ObjectivelyGPU#6, which remove the per-instance interface pointer: $ now resolves the interface through Object::clazz, and the struct member exists only so typeof can name the interface type. ClassDef.interfaceOffset no longer exists.

Changes

  • Mechanical, per class (50 classes), no call-site changes: XInterface *interface;XInterface *interface[0]; and .interfaceOffset = offsetof(X, interface), removed from each ClassDef. Copilot guidance updated to match.
  • Version 2.2.0, requiring ObjectivelyGPU >= 2.2.0 and Objectively >= 2.2.0 (configure.ac, Documentation/install.md). Objectively 2.2.0 changed every instance's layout, so this MUST be built against it and nothing older; the >= checks enforce the install order.
  • Soname derived from the package version. The library was previously unversioned; it now links with -release MAJOR.MINOR computed from AC_INIT (libObjectivelyMVC-2.2.dylib), matching Objectively and ObjectivelyGPU. Every minor release gets a new soname so a stale binary fails to load rather than reading changed struct layouts; patch releases stay compatible.

Verification

Against Objectively 2.2.0 and ObjectivelyGPU 2.2.0 installed to /usr/local:

  • make clean (only the pre-existing libtool probe and test-Makefile warnings), make check 4/4 pass with Tests/ unchanged.
  • Examples/Hello runs cleanly: shaders compile, both graphics pipelines assemble, the view hierarchy dispatches touch-responder events, exits 0.

Quetoo follows once these three are merged.

🤖 Generated with Claude Code

jdolan and others added 4 commits September 2, 2026 19:22
Objectively no longer stores an interface pointer on each instance; `$` resolves
the interface through Object::clazz, and the struct member exists only to carry a
type for typeof. ClassDef.interfaceOffset is gone. Follow suit: each instance
struct's interface member becomes a zero-length array, and each ClassDef drops
interfaceOffset. No call sites change.

See jdolan/Objectively#41 and jdolan/ObjectivelyGPU#6.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Objectively 2.2.0 changed the instance layout (no per-instance interface
pointers); ObjectivelyGPU 2.2.0 is the first build against it. This library
MUST be built against both and nothing older.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The library was previously unversioned. Use -release MAJOR.MINOR, computed from
AC_INIT, so every minor release gets a new soname and patch releases stay
compatible, matching Objectively and ObjectivelyGPU.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 2, 2026 23:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new libtool -release naming needs to be validated/adjusted to remain consistent with downstream link expectations (e.g., pkg-config -lObjectivelyMVC) to avoid breaking consumer builds.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR updates ObjectivelyMVC to be compatible with Objectively/ObjectivelyGPU 2.2.0’s revised interface resolution (no per-instance interface pointer), and introduces release-suffixed shared library naming derived from the package version to prevent ABI-mismatched binaries from loading.

Changes:

  • Replace per-instance XInterface *interface; members with zero-length XInterface *interface[0]; type markers across classes (no intended call-site changes).
  • Remove ClassDef.interfaceOffset usage from each class definition.
  • Bump ObjectivelyMVC to 2.2.0, enforce Objectively >= 2.2.0 and ObjectivelyGPU >= 2.2.0, and add libtool -release @RELEASE_VERSION@.
File summaries
File Description
Sources/ObjectivelyMVC/WindowController.h Convert interface member to zero-length array type marker.
Sources/ObjectivelyMVC/WindowController.c Remove .interfaceOffset from ClassDef.
Sources/ObjectivelyMVC/Warning.h Convert interface member to zero-length array type marker.
Sources/ObjectivelyMVC/Warning.c Remove .interfaceOffset from ClassDef.
Sources/ObjectivelyMVC/ViewController.h Convert interface member to zero-length array type marker.
Sources/ObjectivelyMVC/ViewController.c Remove .interfaceOffset from ClassDef.
Sources/ObjectivelyMVC/View.h Convert interface member to zero-length array type marker.
Sources/ObjectivelyMVC/View.c Remove .interfaceOffset from ClassDef.
Sources/ObjectivelyMVC/Theme.h Convert interface member to zero-length array type marker.
Sources/ObjectivelyMVC/Theme.c Remove .interfaceOffset from ClassDef.
Sources/ObjectivelyMVC/TextView.h Convert interface member to zero-length array type marker.
Sources/ObjectivelyMVC/TextView.c Remove .interfaceOffset from ClassDef.
Sources/ObjectivelyMVC/Text.h Convert interface member to zero-length array type marker.
Sources/ObjectivelyMVC/Text.c Remove .interfaceOffset from ClassDef.
Sources/ObjectivelyMVC/TabViewItem.h Convert interface member to zero-length array type marker.
Sources/ObjectivelyMVC/TabViewItem.c Remove .interfaceOffset from ClassDef.
Sources/ObjectivelyMVC/TabViewController.h Convert interface member to zero-length array type marker.
Sources/ObjectivelyMVC/TabViewController.c Remove .interfaceOffset from ClassDef.
Sources/ObjectivelyMVC/TabView.h Convert interface member to zero-length array type marker.
Sources/ObjectivelyMVC/TabView.c Remove .interfaceOffset from ClassDef.
Sources/ObjectivelyMVC/TableView.h Convert interface member to zero-length array type marker.
Sources/ObjectivelyMVC/TableView.c Remove .interfaceOffset from ClassDef.
Sources/ObjectivelyMVC/TableRowView.h Convert interface member to zero-length array type marker.
Sources/ObjectivelyMVC/TableRowView.c Remove .interfaceOffset from ClassDef.
Sources/ObjectivelyMVC/TableHeaderView.h Convert interface member to zero-length array type marker.
Sources/ObjectivelyMVC/TableHeaderView.c Remove .interfaceOffset from ClassDef.
Sources/ObjectivelyMVC/TableHeaderCellView.h Convert interface member to zero-length array type marker.
Sources/ObjectivelyMVC/TableHeaderCellView.c Remove .interfaceOffset from ClassDef.
Sources/ObjectivelyMVC/TableColumn.h Convert interface member to zero-length array type marker.
Sources/ObjectivelyMVC/TableColumn.c Remove .interfaceOffset from ClassDef.
Sources/ObjectivelyMVC/TableCellView.h Convert interface member to zero-length array type marker.
Sources/ObjectivelyMVC/TableCellView.c Remove .interfaceOffset from ClassDef.
Sources/ObjectivelyMVC/Stylesheet.h Convert interface member to zero-length array type marker.
Sources/ObjectivelyMVC/Stylesheet.c Remove .interfaceOffset from ClassDef.
Sources/ObjectivelyMVC/Style.h Convert interface member to zero-length array type marker.
Sources/ObjectivelyMVC/Style.c Remove .interfaceOffset from ClassDef.
Sources/ObjectivelyMVC/StackView.h Convert interface member to zero-length array type marker.
Sources/ObjectivelyMVC/StackView.c Remove .interfaceOffset from ClassDef.
Sources/ObjectivelyMVC/SlideShowView.h Convert interface member to zero-length array type marker.
Sources/ObjectivelyMVC/SlideShowView.c Remove .interfaceOffset from ClassDef.
Sources/ObjectivelyMVC/Slider.h Convert interface member to zero-length array type marker.
Sources/ObjectivelyMVC/Slider.c Remove .interfaceOffset from ClassDef.
Sources/ObjectivelyMVC/SimpleSelector.h Convert interface member to zero-length array type marker.
Sources/ObjectivelyMVC/SimpleSelector.c Remove .interfaceOffset from ClassDef.
Sources/ObjectivelyMVC/SelectorSequence.h Convert interface member to zero-length array type marker.
Sources/ObjectivelyMVC/SelectorSequence.c Remove .interfaceOffset from ClassDef.
Sources/ObjectivelyMVC/Selector.h Convert interface member to zero-length array type marker.
Sources/ObjectivelyMVC/Selector.c Remove .interfaceOffset from ClassDef.
Sources/ObjectivelyMVC/Select.h Convert interface member to zero-length array type marker.
Sources/ObjectivelyMVC/Select.c Remove .interfaceOffset from ClassDef.
Sources/ObjectivelyMVC/ScrollView.h Convert interface member to zero-length array type marker.
Sources/ObjectivelyMVC/ScrollView.c Remove .interfaceOffset from ClassDef.
Sources/ObjectivelyMVC/ScrollHandle.h Convert interface member to zero-length array type marker.
Sources/ObjectivelyMVC/ScrollHandle.c Remove .interfaceOffset from ClassDef.
Sources/ObjectivelyMVC/ScrollBar.h Convert interface member to zero-length array type marker.
Sources/ObjectivelyMVC/ScrollBar.c Remove .interfaceOffset from ClassDef.
Sources/ObjectivelyMVC/RGBColorPicker.h Convert interface member to zero-length array type marker.
Sources/ObjectivelyMVC/RGBColorPicker.c Remove .interfaceOffset from ClassDef.
Sources/ObjectivelyMVC/Renderer.h Convert interface member to zero-length array type marker.
Sources/ObjectivelyMVC/Renderer.c Remove .interfaceOffset from ClassDef.
Sources/ObjectivelyMVC/ProgressBar.h Convert interface member to zero-length array type marker.
Sources/ObjectivelyMVC/ProgressBar.c Remove .interfaceOffset from ClassDef.
Sources/ObjectivelyMVC/Panel.h Convert interface member to zero-length array type marker.
Sources/ObjectivelyMVC/Panel.c Remove .interfaceOffset from ClassDef.
Sources/ObjectivelyMVC/PageView.h Convert interface member to zero-length array type marker.
Sources/ObjectivelyMVC/PageView.c Remove .interfaceOffset from ClassDef.
Sources/ObjectivelyMVC/Option.h Convert interface member to zero-length array type marker.
Sources/ObjectivelyMVC/Option.c Remove .interfaceOffset from ClassDef.
Sources/ObjectivelyMVC/NavigationViewController.h Convert interface member to zero-length array type marker.
Sources/ObjectivelyMVC/NavigationViewController.c Remove .interfaceOffset from ClassDef.
Sources/ObjectivelyMVC/Label.h Convert interface member to zero-length array type marker.
Sources/ObjectivelyMVC/Label.c Remove .interfaceOffset from ClassDef.
Sources/ObjectivelyMVC/Input.h Convert interface member to zero-length array type marker.
Sources/ObjectivelyMVC/Input.c Remove .interfaceOffset from ClassDef.
Sources/ObjectivelyMVC/ImageView.h Convert interface member to zero-length array type marker.
Sources/ObjectivelyMVC/ImageView.c Remove .interfaceOffset from ClassDef.
Sources/ObjectivelyMVC/Image.h Convert interface member to zero-length array type marker.
Sources/ObjectivelyMVC/Image.c Remove .interfaceOffset from ClassDef.
Sources/ObjectivelyMVC/HueColorPicker.h Convert interface member to zero-length array type marker.
Sources/ObjectivelyMVC/HueColorPicker.c Remove .interfaceOffset from ClassDef.
Sources/ObjectivelyMVC/HSVColorPicker.h Convert interface member to zero-length array type marker.
Sources/ObjectivelyMVC/HSVColorPicker.c Remove .interfaceOffset from ClassDef.
Sources/ObjectivelyMVC/Font.h Convert interface member to zero-length array type marker.
Sources/ObjectivelyMVC/Font.c Remove .interfaceOffset from ClassDef.
Sources/ObjectivelyMVC/DebugViewController.h Convert interface member to zero-length array type marker.
Sources/ObjectivelyMVC/DebugViewController.c Remove .interfaceOffset from ClassDef.
Sources/ObjectivelyMVC/Control.h Convert interface member to zero-length array type marker.
Sources/ObjectivelyMVC/Control.c Remove .interfaceOffset from ClassDef.
Sources/ObjectivelyMVC/CollectionView.h Convert interface member to zero-length array type marker.
Sources/ObjectivelyMVC/CollectionView.c Remove .interfaceOffset from ClassDef.
Sources/ObjectivelyMVC/CollectionItemView.h Convert interface member to zero-length array type marker.
Sources/ObjectivelyMVC/CollectionItemView.c Remove .interfaceOffset from ClassDef.
Sources/ObjectivelyMVC/Checkbox.h Convert interface member to zero-length array type marker.
Sources/ObjectivelyMVC/Checkbox.c Remove .interfaceOffset from ClassDef.
Sources/ObjectivelyMVC/Button.h Convert interface member to zero-length array type marker.
Sources/ObjectivelyMVC/Button.c Remove .interfaceOffset from ClassDef.
Sources/ObjectivelyMVC/Box.h Convert interface member to zero-length array type marker.
Sources/ObjectivelyMVC/Box.c Remove .interfaceOffset from ClassDef.
Sources/ObjectivelyMVC/Makefile.am Add -release @RELEASE_VERSION@ to libtool link flags.
Examples/HelloViewController.h Convert interface member to zero-length array type marker.
Examples/HelloViewController.c Remove .interfaceOffset from ClassDef.
Documentation/install.md Bump documented minimum dependency versions to 2.2.0.
configure.ac Bump version to 2.2.0, add RELEASE_VERSION substitution, bump pkg-config dependency minimums.
Review details
  • Files reviewed: 103/103 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread Sources/ObjectivelyMVC/Makefile.am
Comment thread Sources/ObjectivelyMVC/Makefile.am Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@jdolan
jdolan merged commit b1ce4c9 into main Sep 2, 2026
4 checks passed
@jdolan
jdolan deleted the zero-length-interface branch September 2, 2026 23:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants