Skip to content

[Cocoa] Support architecture-specific enum values in MacGenerator#3449

Open
HeikoKlare wants to merge 2 commits into
eclipse-platform:masterfrom
HeikoKlare:macgenerator-enum-aarch64-value
Open

[Cocoa] Support architecture-specific enum values in MacGenerator#3449
HeikoKlare wants to merge 2 commits into
eclipse-platform:masterfrom
HeikoKlare:macgenerator-enum-aarch64-value

Conversation

@HeikoKlare

@HeikoKlare HeikoKlare commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Some macOS enum constants have different numeric values on x86_64 vs aarch64 (aarch64 values were inherited from iOS headers and diverge from the x86_64/bridgesupport definitions). Until now this required hand-editing the generated OS.java after every MacGenerator run, since the divergence isn't present in the (machine-generated, non-editable) .bridgesupport files, and the generator had no way to express an architecture-dependent value.
  • MacGenerator now supports a new swt_value_aarch64 attribute on <enum> elements in *.bridgesupport.extras files. When set, it declares the aarch64-specific value while the regular value/value64 attribute continues to describe the x86_64 value; the generator derives the IS_X86_64 ? ... : ... expression from both, removing the need to manually patch generated code after each run.
  • Applied this to NSTextAlignmentCenter/NSTextAlignmentRight in AppKitFull.bridgesupport.extras, replacing the two hand-maintained ternaries that previously lived directly in OS.java.

Follow-up to 0ffafe6 (which introduced the manual macro code).

Test plan

  • Regenerate OS.java via MacGenerator on macOS and confirm NSTextAlignmentCenter/NSTextAlignmentRight produce the same IS_X86_64 ? ... : ... expressions as before, with no other unintended diff
  • Confirm MacGeneratorUI's attribute editor shows/edits swt_value_aarch64 for enum nodes
  • Confirm swt_value_aarch64 round-trips correctly when extras are re-saved from the tool

🤖 Generated with Claude Code

@eclipse-platform-bot

Copy link
Copy Markdown
Contributor

This pull request changes some projects for the first time in this development cycle.
Therefore the following files need a version increment:

bundles/org.eclipse.swt.tools/META-INF/MANIFEST.MF
features/org.eclipse.swt.tools.feature/feature.xml

An additional commit containing all the necessary changes was pushed to the top of this PR's branch. To obtain these changes (for example if you want to push more changes) either fetch from your fork or apply the git patch.

Git patch
From 7767e7424fd2b59a09e1a7d3bbe33351998cc8c5 Mon Sep 17 00:00:00 2001
From: Eclipse Platform Bot <platform-bot@eclipse.org>
Date: Fri, 17 Jul 2026 09:37:57 +0000
Subject: [PATCH] Version bump(s) for 4.41 stream


diff --git a/bundles/org.eclipse.swt.tools/META-INF/MANIFEST.MF b/bundles/org.eclipse.swt.tools/META-INF/MANIFEST.MF
index 6c5ef0ac6d..b90424780d 100644
--- a/bundles/org.eclipse.swt.tools/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.swt.tools/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-Name: %pluginName
 Bundle-Vendor: %providerName
 Bundle-SymbolicName: org.eclipse.swt.tools; singleton:=true
-Bundle-Version: 3.112.0.qualifier
+Bundle-Version: 3.112.100.qualifier
 Bundle-ManifestVersion: 2
 Export-Package: org.eclipse.swt.tools.internal; x-internal:=true
 Bundle-ActivationPolicy: lazy
diff --git a/features/org.eclipse.swt.tools.feature/feature.xml b/features/org.eclipse.swt.tools.feature/feature.xml
index e931cf31d7..bbd29d9849 100644
--- a/features/org.eclipse.swt.tools.feature/feature.xml
+++ b/features/org.eclipse.swt.tools.feature/feature.xml
@@ -2,7 +2,7 @@
 <feature
       id="org.eclipse.swt.tools.feature"
       label="%featureName"
-      version="3.111.0.qualifier"
+      version="3.111.100.qualifier"
       provider-name="%providerName"
       license-feature="org.eclipse.license"
       license-feature-version="0.0.0">
-- 
2.54.0

Further information are available in Common Build Issues - Missing version increments.

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Test Results

  200 files  ±0    200 suites  ±0   29m 55s ⏱️ + 2m 27s
4 744 tests ±0  4 720 ✅ ±0   24 💤 ±0  0 ❌ ±0 
6 892 runs  ±0  6 724 ✅ ±0  168 💤 ±0  0 ❌ ±0 

Results for commit 28ded75. ± Comparison against base commit a87a78d.

♻️ This comment has been updated with latest results.

@HeikoKlare
HeikoKlare force-pushed the macgenerator-enum-aarch64-value branch from e0026ef to 93bf7b2 Compare July 17, 2026 12:44
@HeikoKlare
HeikoKlare marked this pull request as ready for review July 17, 2026 12:58
HeikoKlare and others added 2 commits July 17, 2026 15:13
Some macOS enum constants have different numeric values on x86_64
versus aarch64, since aarch64 values were inherited from iOS headers
and diverge from the values in the x86_64/bridgesupport definitions.
Until now, this was handled by hand-editing the generated OS.java
after every MacGenerator run, since the generator had no way to
express an architecture-dependent value and the divergence isn't
present in the (machine-generated, non-editable) bridgesupport files
themselves.

MacGenerator now supports a new "swt_value_aarch64" attribute on
<enum> elements in *.bridgesupport.extras files. When set, it
declares the value to use on aarch64, while the regular value/value64
attribute continues to describe the x86_64 value; the generator
derives the appropriate architecture-conditional expression from
both. This removes the need to manually patch generated code after
each run and keeps the architecture-specific knowledge in the extras
file, alongside the other custom generation hints already maintained
there.

Follow-up to 0ffafe6

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@HeikoKlare
HeikoKlare force-pushed the macgenerator-enum-aarch64-value branch from 93bf7b2 to 28ded75 Compare July 17, 2026 13:13
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