Skip to content

Commit 48ae60d

Browse files
authored
4x+3x compatibility (#42)
* 4x updates * unify
1 parent 67b6b1e commit 48ae60d

File tree

2 files changed

+9
-40
lines changed

2 files changed

+9
-40
lines changed

CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ if(EMSCRIPTEN)
6060
SET(XEUS_JAVASCRIPT_USE_SHARED_XEUS ON)
6161
SET(XEUS_JAVASCRIPT_USE_SHARED_XEUS_JAVASCRIPT OFF)
6262
SET(XEUS_JAVASCRIPT_BUILD_TESTS OFF)
63+
64+
65+
if (EMSCRIPTEN_VERSION VERSION_LESS "4.0.0")
66+
# c-definitions for older emscripten versions
67+
add_compile_definitions(XEUS_JAVASCRIPT_EMSCRIPTEN_OLD)
68+
endif()
6369
endif()
6470

6571

include/xeus-javascript/convert_json.hpp

Lines changed: 3 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ struct BindingType<nl::json> {
4747
}
4848
};
4949

50+
#ifdef XEUS_JAVASCRIPT_EMSCRIPTEN_OLD
51+
5052

5153
template <typename T>
5254
using is_decayed_json = std::is_same<std::decay_t<T>, nl::json>;
@@ -61,46 +63,7 @@ struct TypeID<T, enable_if_decayed_json<T> > {
6163
}
6264
};
6365

64-
65-
66-
67-
68-
69-
// template <>
70-
// struct TypeID<nl::json> {
71-
// static constexpr TYPEID get() {
72-
// return LightTypeID<val>::get();
73-
// }
74-
// };
75-
76-
// template <>
77-
// struct TypeID<const nl::json> {
78-
// static constexpr TYPEID get() {
79-
// return LightTypeID<val>::get();
80-
// }
81-
// };
82-
83-
// template <>
84-
// struct TypeID< nl::json && > {
85-
// static constexpr TYPEID get() {
86-
// return LightTypeID<val>::get();
87-
// }
88-
// };
89-
90-
91-
// template <>
92-
// struct TypeID<nl::json&> {
93-
// static constexpr TYPEID get() {
94-
// return LightTypeID<val>::get();
95-
// }
96-
// };
97-
98-
// template <>
99-
// struct TypeID<const nl::json&> {
100-
// static constexpr TYPEID get() {
101-
// return LightTypeID<val>::get();
102-
// }
103-
// };
66+
#endif
10467

10568
} // namespace internal
10669
} // namespace emscripten

0 commit comments

Comments
 (0)