Attempt to fix g++-4.6 build

Remove fake std::nullptr_t implementation
This commit is contained in:
Carter Li 2015-02-13 20:29:57 +08:00
parent 52039e8b71
commit 651f8286b1
2 changed files with 7 additions and 23 deletions

View File

@ -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.

View File

@ -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 {