fix MinGW's compiler errors

This commit is contained in:
Jinhao 2017-05-10 05:47:42 +08:00
parent 8d4a734272
commit abfde4e77c
2 changed files with 14 additions and 7 deletions

View File

@ -116,8 +116,6 @@
# define _enable_std_clamp # define _enable_std_clamp
# endif # endif
#elif defined(NANA_MINGW)
# define STD_THREAD_NOT_SUPPORTED
#elif defined(__clang__) //Clang #elif defined(__clang__) //Clang
#include <iosfwd> //Introduces some implement-specific flags of ISO C++ Library #include <iosfwd> //Introduces some implement-specific flags of ISO C++ Library
@ -132,9 +130,6 @@
#endif #endif
#endif #endif
# define _enable_std_clamp
#elif defined(__GNUC__) //GCC #elif defined(__GNUC__) //GCC
#include <iosfwd> //Introduces some implement-specific flags of ISO C++ Library #include <iosfwd> //Introduces some implement-specific flags of ISO C++ Library
@ -190,8 +185,20 @@
#endif #endif
#endif #endif
#endif #endif
#endif
# define _enable_std_clamp //Assume the std::thread is not implement on MinGW
//But some toolchains may implement std::thread.
#ifdef NANA_MINGW
# ifndef STD_THREAD_NOT_SUPPORTED
# define STD_THREAD_NOT_SUPPORTED
# endif
#endif
#if (!defined(__cpp_lib_clamp)) || (__cpp_lib_clamp < 201603)
# ifndef _enable_std_clamp
# define _enable_std_clamp
# endif
#endif #endif

View File

@ -51,7 +51,7 @@ namespace nana
truetype(const path_type& filename) truetype(const path_type& filename)
{ {
std::ifstream ifs{ filename, std::ios::binary }; std::ifstream ifs(filename.string(), std::ios::binary);
if (!ifs.is_open()) if (!ifs.is_open())
return; return;