Attempt to fix g++-4.6 build
Remove fake std::nullptr_t implementation
This commit is contained in:
parent
52039e8b71
commit
651f8286b1
@ -122,7 +122,7 @@ endif ()
|
|||||||
check_cxx_source_compiles("
|
check_cxx_source_compiles("
|
||||||
int main(){int*p=nullptr;}" FMT_NULLPTR)
|
int main(){int*p=nullptr;}" FMT_NULLPTR)
|
||||||
if (FMT_NULLPTR)
|
if (FMT_NULLPTR)
|
||||||
add_definitions(-DFMT_USE_NULLPTR=1)
|
# add_definitions(-DFMT_USE_NULLPTR=1)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
check_cxx_source_compiles("
|
check_cxx_source_compiles("
|
||||||
@ -133,14 +133,14 @@ check_cxx_source_compiles("
|
|||||||
};
|
};
|
||||||
int main(){}" FMT_DELETED_FUNCTIONS)
|
int main(){}" FMT_DELETED_FUNCTIONS)
|
||||||
if (FMT_DELETED_FUNCTIONS)
|
if (FMT_DELETED_FUNCTIONS)
|
||||||
add_definitions(-DFMT_USE_DELETED_FUNCTIONS=1)
|
# add_definitions(-DFMT_USE_DELETED_FUNCTIONS=1)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
check_cxx_source_compiles("
|
check_cxx_source_compiles("
|
||||||
void f() noexcept {}
|
void f() noexcept {}
|
||||||
int main(){ f(); }" FMT_BASIC_NOEXCEPT_SUPPORT)
|
int main(){ f(); }" FMT_BASIC_NOEXCEPT_SUPPORT)
|
||||||
if (FMT_BASIC_NOEXCEPT_SUPPORT)
|
if (FMT_BASIC_NOEXCEPT_SUPPORT)
|
||||||
add_definitions(-DFMT_USE_NOEXCEPT=1)
|
# add_definitions(-DFMT_USE_NOEXCEPT=1)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
check_cxx_source_compiles("
|
check_cxx_source_compiles("
|
||||||
@ -157,7 +157,7 @@ check_cxx_source_compiles("
|
|||||||
MoveOnly c(MoveOnly());
|
MoveOnly c(MoveOnly());
|
||||||
}" FMT_RVALUE_REFERENCES)
|
}" FMT_RVALUE_REFERENCES)
|
||||||
if (FMT_RVALUE_REFERENCES)
|
if (FMT_RVALUE_REFERENCES)
|
||||||
add_definitions(-DFMT_USE_RVALUE_REFERENCES=1)
|
# add_definitions(-DFMT_USE_RVALUE_REFERENCES=1)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
# GTest doesn't detect <tuple> with clang.
|
# GTest doesn't detect <tuple> with clang.
|
||||||
|
|||||||
22
format.h
22
format.h
@ -137,25 +137,9 @@
|
|||||||
|| (FMT_GCC_VERSION >= 406 && __cplusplus >= 201103L)\
|
|| (FMT_GCC_VERSION >= 406 && __cplusplus >= 201103L)\
|
||||||
|| (_MSC_VER >= 1600)
|
|| (_MSC_VER >= 1600)
|
||||||
// Use nullptr
|
// Use nullptr
|
||||||
#else
|
#elif !defined(nullptr)
|
||||||
// Simulate it
|
// Some standard library implementations define nullptr themselves such as libc++
|
||||||
namespace std {
|
# define nullptr 0
|
||||||
class nullptr_t {
|
|
||||||
public:
|
|
||||||
template<typename T>
|
|
||||||
operator T*() const {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
template<typename C, typename T>
|
|
||||||
operator T C::*() const {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
private:
|
|
||||||
void operator&() const;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
std::nullptr_t const nullptr = {};
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace fmt {
|
namespace fmt {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user