Skip to content

Commit

Permalink
Avoid name collision with macros TRUE and FALSE.
Browse files Browse the repository at this point in the history
  • Loading branch information
1uc committed Apr 4, 2023
1 parent 2759770 commit a744dd4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions include/highfive/bits/H5Converter_misc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,11 @@ struct type_helper {
template <typename T>
struct inspector: type_helper<T> {};

enum Boolean : int8_t {
FALSE = 0,
TRUE = 1,
enum class Boolean : int8_t {
HighFiveFalse = 0,
HighFiveTrue = 1,
};

template <>
struct inspector<bool>: type_helper<bool> {
using base_type = Boolean;
Expand Down
2 changes: 1 addition & 1 deletion include/highfive/bits/H5DataType_misc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ class AtomicType<std::complex<T>>: public DataType {

// For boolean we act as h5py
inline EnumType<details::Boolean> create_enum_boolean() {
return {{"FALSE", details::Boolean::FALSE}, {"TRUE", details::Boolean::TRUE}};
return {{"FALSE", details::Boolean::HighFiveFalse}, {"TRUE", details::Boolean::HighFiveTrue}};
}

// Other cases not supported. Fail early with a user message
Expand Down

0 comments on commit a744dd4

Please sign in to comment.