Skip to content

android: Fix build with NDK 26 #674

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions core/src/Generator.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@

#pragma once

#ifdef __cpp_impl_coroutine
#ifdef __ANDROID__
#include <android/ndk-version.h>
#endif

#ifdef __cpp_impl_coroutine
#if defined __ANDROID__ && __NDK_MAJOR__ < 26
// NDK 25.1.8937393 can compile this code with c++20 but needs a few tweaks:
#include <experimental/coroutine>
namespace std {
Expand All @@ -25,7 +29,7 @@ namespace std {
// this code is based on https://en.cppreference.com/w/cpp/coroutine/coroutine_handle#Example
// but modified trying to prevent accidental copying of generated objects

#ifdef __ANDROID__
#if defined __ANDROID__ && __NDK_MAJOR__ < 26
template <class T>
#else
template <std::movable T>
Expand Down