Skip to content
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

add fix for GCC. #40

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
compiler: [clang++, g++]
steps:
- uses: actions/checkout@v1
- name: set up JDK 1.8
Expand All @@ -20,4 +22,5 @@ jobs:
- name: Run tests
run: |
source scripts/android-setup.sh && installAndroidSDK && installsdk 'cmake;3.10.2.4988404'
export CXX=${{ matrix.compiler }}
scripts/run-host-tests.sh
7 changes: 5 additions & 2 deletions cxx/fbjni/detail/Meta.h
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,9 @@ struct jtype_traits {
return detail::SimpleFixedString<len>(Repr::get_instantiated_base_name());
}
public:
using descriptorType = decltype(jtype_traits<T>::descriptor());
using basenameType = decltype(jtype_traits<T>::base_name());

// The jni type signature (described at
// http://docs.oracle.com/javase/1.5.0/docs/guide/jni/spec/types.html).
static constexpr decltype(jtype_traits<T>::descriptor()) /* detail::SimpleFixedString<_> */ kDescriptor = descriptor();
erip marked this conversation as resolved.
Show resolved Hide resolved
Expand All @@ -303,9 +306,9 @@ struct jtype_traits {
};

template <typename T>
constexpr decltype(jtype_traits<T>::descriptor()) jtype_traits<T>::kDescriptor;
constexpr typename jtype_traits<T>::descriptorType jtype_traits<T>::kDescriptor;
template <typename T>
constexpr decltype(jtype_traits<T>::base_name())jtype_traits<T>::kBaseName;
constexpr typename jtype_traits<T>::basenameType jtype_traits<T>::kBaseName;

static_assert(
std::is_same<jint, int>::value,
Expand Down
4 changes: 3 additions & 1 deletion cxx/fbjni/detail/SimpleFixedString.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,10 @@ constexpr const char (&checkNullTerminated(const char (&a)[N]) noexcept)[N] {
#endif
) {
return decltype(a)(a);
} else {
assertNotNullTerminated();
return decltype(a)(a);
}
return (assertNotNullTerminated(), decltype(a)(a));
}

struct Helper {
Expand Down
1 change: 0 additions & 1 deletion scripts/run-host-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ set -exo pipefail

BASE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )/.."
CMAKE=$ANDROID_HOME/cmake/3.10.2.4988404/bin/cmake
export CXX=clang++

mkdir -p "$BASE_DIR/host-build-cmake"
cd "$BASE_DIR/host-build-cmake"
Expand Down