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("
|
||||
int main(){int*p=nullptr;}" FMT_NULLPTR)
|
||||
if (FMT_NULLPTR)
|
||||
add_definitions(-DFMT_USE_NULLPTR=1)
|
||||
# add_definitions(-DFMT_USE_NULLPTR=1)
|
||||
endif ()
|
||||
|
||||
check_cxx_source_compiles("
|
||||
@ -133,14 +133,14 @@ check_cxx_source_compiles("
|
||||
};
|
||||
int main(){}" FMT_DELETED_FUNCTIONS)
|
||||
if (FMT_DELETED_FUNCTIONS)
|
||||
add_definitions(-DFMT_USE_DELETED_FUNCTIONS=1)
|
||||
# add_definitions(-DFMT_USE_DELETED_FUNCTIONS=1)
|
||||
endif ()
|
||||
|
||||
check_cxx_source_compiles("
|
||||
void f() noexcept {}
|
||||
int main(){ f(); }" FMT_BASIC_NOEXCEPT_SUPPORT)
|
||||
if (FMT_BASIC_NOEXCEPT_SUPPORT)
|
||||
add_definitions(-DFMT_USE_NOEXCEPT=1)
|
||||
# add_definitions(-DFMT_USE_NOEXCEPT=1)
|
||||
endif ()
|
||||
|
||||
check_cxx_source_compiles("
|
||||
@ -157,7 +157,7 @@ check_cxx_source_compiles("
|
||||
MoveOnly c(MoveOnly());
|
||||
}" FMT_RVALUE_REFERENCES)
|
||||
if (FMT_RVALUE_REFERENCES)
|
||||
add_definitions(-DFMT_USE_RVALUE_REFERENCES=1)
|
||||
# add_definitions(-DFMT_USE_RVALUE_REFERENCES=1)
|
||||
endif ()
|
||||
|
||||
# GTest doesn't detect <tuple> with clang.
|
||||
|
||||
22
format.h
22
format.h
@ -137,25 +137,9 @@
|
||||
|| (FMT_GCC_VERSION >= 406 && __cplusplus >= 201103L)\
|
||||
|| (_MSC_VER >= 1600)
|
||||
// Use nullptr
|
||||
#else
|
||||
// Simulate it
|
||||
namespace std {
|
||||
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 = {};
|
||||
#elif !defined(nullptr)
|
||||
// Some standard library implementations define nullptr themselves such as libc++
|
||||
# define nullptr 0
|
||||
#endif
|
||||
|
||||
namespace fmt {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user