Skip to content

Commit a2c35fa

Browse files
committed
Fix FILE* compile error on musl
1 parent 4b3ff36 commit a2c35fa

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

include/jlcxx/type_conversion.hpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,12 @@ struct MappingTrait<void*>
271271
using type = DirectPtrTrait;
272272
};
273273

274+
template<>
275+
struct MappingTrait<FILE*>
276+
{
277+
using type = DirectPtrTrait;
278+
};
279+
274280
template<typename T>
275281
struct MappingTrait<T, typename std::enable_if<!IsMirroredType<T>::value && !IsSmartPointerType<T>::value>::type>
276282
{
@@ -565,6 +571,16 @@ struct julia_type_factory<jl_value_t*>
565571
}
566572
};
567573

574+
template<>
575+
struct julia_type_factory<FILE*>
576+
{
577+
static inline jl_datatype_t* julia_type()
578+
{
579+
static jl_datatype_t* result = (jl_datatype_t*)jl_apply_type1((jl_value_t*)jl_pointer_type, jlcxx::julia_type("FILE", "Libc"));
580+
return result;
581+
}
582+
};
583+
568584
/// Base class to specialize for conversion to C++
569585
template<typename CppT, typename TraitT=mapping_trait<CppT>>
570586
struct ConvertToCpp

0 commit comments

Comments
 (0)