Skip to content

Android: Add ImportC definitions#5104

Open
eakmyr wants to merge 5 commits intoldc-developers:masterfrom
eakmyr:patch-1
Open

Android: Add ImportC definitions#5104
eakmyr wants to merge 5 commits intoldc-developers:masterfrom
eakmyr:patch-1

Conversation

@eakmyr
Copy link
Copy Markdown
Contributor

@eakmyr eakmyr commented Mar 25, 2026

This PR fixes broken ImportC on Android targets. Tested on sqlite3, zlib, lwIP.

Copy link
Copy Markdown
Contributor

@thewilsonator thewilsonator left a comment

Choose a reason for hiding this comment

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

please file this upstream to DMD and once that is accepted with review (e.g. __builtin_memset and friend have recently beed added to DMD, though maybe that was for APPLE I forget, and #define alignof(x) sizeof(x)` looks suspect) cherrypick this back to LDC if you need to.

@eakmyr
Copy link
Copy Markdown
Contributor Author

eakmyr commented Mar 25, 2026

__builtin_memset and friend

there's only one for APPLE, and __builtin_memset**_chk** and same with friends

#define alignof(x) **sizeof**(x)

true thanks. changed sizeof(x) to _Alignof(x)

opened the PR at DMD with these changes. let's see..

@eakmyr
Copy link
Copy Markdown
Contributor Author

eakmyr commented Mar 26, 2026

Removed obsolete builtins. These changes rely on #5106 and #5107

@thewilsonator
Copy link
Copy Markdown
Contributor

DMD PR is dlang/dmd#22814

@thewilsonator
Copy link
Copy Markdown
Contributor

Merged dependant PRs

@eakmyr
Copy link
Copy Markdown
Contributor Author

eakmyr commented Mar 27, 2026

This PR's changes are now consistent with the DMD PR

@eakmyr
Copy link
Copy Markdown
Contributor Author

eakmyr commented Mar 27, 2026

__alignof__ is not Android-specific. The problem is that some C libs use __alignof__ with two trailing underscores, so I opened another PR #5108 that adds it below the __alignof define.

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