Skip to content

Fix Android build error with mi_atomic_storei64_release argument type mismatching#1223

Closed
akrieger wants to merge 1 commit intomicrosoft:mainfrom
akrieger:android_atomics
Closed

Fix Android build error with mi_atomic_storei64_release argument type mismatching#1223
akrieger wants to merge 1 commit intomicrosoft:mainfrom
akrieger:android_atomics

Conversation

@akrieger
Copy link
Copy Markdown

@akrieger akrieger commented Feb 7, 2026

Resolves this compile error. Fix inspired by https://github.com/microsoft/mimalloc/blob/dev3/src/arena.c#L2059

Error:   /home/runner/work/Cataclysm-DDA/Cataclysm-DDA/android/app/jni/src/../../../../src/third-party/mimalloc/arena.c:651:7: error: no matching function for call to 'atomic_store_explicit'
        mi_atomic_storei64_release(&mi_arenas_purge_expire, 0);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  /home/runner/work/Cataclysm-DDA/Cataclysm-DDA/android/app/jni/src/../../../../src/third-party/mimalloc/mimalloc/atomic.h:148:49: note: expanded from macro 'mi_atomic_storei64_release'
  #define mi_atomic_storei64_release(p,x)         mi_atomic(store_explicit)(p,x,mi_memory_order(release))
                                                  ^~~~~~~~~~~~~~~~~~~~~~~~~
  /home/runner/work/Cataclysm-DDA/Cataclysm-DDA/android/app/jni/src/../../../../src/third-party/mimalloc/mimalloc/atomic.h:35:35: note: expanded from macro 'mi_atomic'
  #define  mi_atomic(name)          std::atomic_##name
                                    ^~~~~~~~~~~~~~~~~~
  /usr/local/lib/android/sdk/ndk/25.2.9519653/sources/cxx-stl/llvm-libc++/include/atomic:1890:1: note: candidate template ignored: deduced conflicting types for parameter '_Tp' ('long' vs. 'int')
  atomic_store_explicit(volatile atomic<_Tp>* __o, _Tp __d, memory_order __m) _NOEXCEPT
  ^
  /usr/local/lib/android/sdk/ndk/25.2.9519653/sources/cxx-stl/llvm-libc++/include/atomic:1899:1: note: candidate template ignored: deduced conflicting types for parameter '_Tp' ('long' vs. 'int')
  atomic_store_explicit(atomic<_Tp>* __o, _Tp __d, memory_order __m) _NOEXCEPT
  ^
  /usr/local/lib/android/sdk/ndk/25.2.9519653/sources/cxx-stl/llvm-libc++/include/memory:5138:1: note: candidate template ignored: could not match 'shared_ptr' against 'atomic'
  atomic_store_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r, memory_order)
  ^
  1 error generated.

akrieger added a commit to akrieger/Cataclysm-DDA that referenced this pull request Feb 9, 2026
akrieger added a commit to akrieger/Cataclysm-DDA that referenced this pull request Feb 9, 2026
akrieger added a commit to akrieger/Cataclysm-DDA that referenced this pull request Feb 10, 2026
akrieger added a commit to akrieger/Cataclysm-DDA that referenced this pull request Feb 18, 2026
akrieger added a commit to akrieger/Cataclysm-DDA that referenced this pull request Feb 23, 2026
daanx added a commit that referenced this pull request Apr 12, 2026
@daanx
Copy link
Copy Markdown
Collaborator

daanx commented Apr 12, 2026

Thank you @akrieger ! I merged manually as we do commits generally on dev.

@daanx daanx closed this Apr 12, 2026
@akrieger akrieger deleted the android_atomics branch April 12, 2026 23:23
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