Skip to content

Commit

Permalink
add android32
Browse files Browse the repository at this point in the history
  • Loading branch information
altalk23 committed Dec 23, 2023
1 parent 71d89ac commit 657d19d
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 10 deletions.
5 changes: 3 additions & 2 deletions include/ast.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ namespace broma {
Windows = 2,
Android = 4,
iOS = 8,
Android64 = 16,
Android32 = 16,
Android64 = 32,
};

inline Platform operator|(Platform a, Platform b) {
Expand All @@ -41,7 +42,7 @@ namespace broma {
ptrdiff_t mac = -1;
ptrdiff_t ios = -1;
ptrdiff_t win = -1;
ptrdiff_t android = -1;
ptrdiff_t android32 = -1;
ptrdiff_t android64 = -1;
};

Expand Down
19 changes: 16 additions & 3 deletions src/attribute.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,14 @@ namespace broma {
struct run_action<tagged_rule<link_attribute, keyword_android>> {
template <typename T>
static void apply(T& input, Root* root, ScratchData* scratch) {
scratch->wip_link_platform |= Platform::Android;
scratch->wip_link_platform |= Platform::Android32 | Platform::Android64;
}
};
template <>
struct run_action<tagged_rule<link_attribute, keyword_android32>> {
template <typename T>
static void apply(T& input, Root* root, ScratchData* scratch) {
scratch->wip_link_platform |= Platform::Android32;
}
};
template <>
Expand Down Expand Up @@ -165,12 +172,18 @@ namespace broma {
scratch->wip_missing_platform |= Platform::Windows;
}
};

template <>
struct run_action<tagged_rule<missing_attribute, keyword_android>> {
template <typename T>
static void apply(T& input, Root* root, ScratchData* scratch) {
scratch->wip_missing_platform |= Platform::Android;
scratch->wip_missing_platform |= Platform::Android32 | Platform::Android64;
}
};
template <>
struct run_action<tagged_rule<missing_attribute, keyword_android32>> {
template <typename T>
static void apply(T& input, Root* root, ScratchData* scratch) {
scratch->wip_missing_platform |= Platform::Android32;
}
};
template <>
Expand Down
3 changes: 2 additions & 1 deletion src/basic_components.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ namespace broma {
keyword(win);
keyword(ios);
keyword(android);
keyword(android32);
keyword(android64);
keyword(PAD);

Expand All @@ -101,5 +102,5 @@ namespace broma {

/// @brief A platform identifier (mac, win, ios, android).
template <typename T>
struct tagged_platform : tagged_for_each<T, sor<keyword_mac, keyword_win, keyword_ios, keyword_android, keyword_android64>> {};
struct tagged_platform : tagged_for_each<T, sor<keyword_mac, keyword_win, keyword_ios, keyword_android, keyword_android32, keyword_android64>> {};
} // namespace broma
11 changes: 7 additions & 4 deletions src/bind.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ namespace broma {
}
};
template <>
struct run_action<tagged_rule<bind, keyword_android>> {
struct run_action<tagged_rule<bind, keyword_android32>> {
template <typename T>
static void apply(T& input, Root* root, ScratchData* scratch) {
scratch->wip_bind_platform = Platform::Android;
scratch->wip_bind_platform = Platform::Android32;
}
};
template <>
Expand All @@ -82,8 +82,11 @@ namespace broma {
case Platform::Windows:
scratch->wip_bind.win = out;
break;
case Platform::Android:
scratch->wip_bind.android = out;
case Platform::Android32:
scratch->wip_bind.android32 = out;
break;
case Platform::Android64:
scratch->wip_bind.android64 = out;
break;
default:
break;
Expand Down

0 comments on commit 657d19d

Please sign in to comment.