diff --git a/.gitignore b/.gitignore index 5c5fac64..53eee01b 100644 --- a/.gitignore +++ b/.gitignore @@ -40,3 +40,4 @@ CMakeCache.txt CMakeFiles/ cmake_install.cmake *.DS_Store +.idea/ diff --git a/CMakeLists.txt b/CMakeLists.txt index a6453263..5b65dadc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,48 +4,17 @@ # Robert Hauck - Enable support for PNG/Freetype # Qiangqiang Wu - Add biicode support +# set compile flags +if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall") +endif(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") + + +# move this to the end ?? if(BIICODE) # prepare BII_LIB_SRC set(LIB_SRC ${BII_LIB_SRC}) - foreach(cpp ${BII_LIB_SRC}) - if(${cpp} MATCHES "/detail/(win32|linux_X11)/.+$") - list(APPEND trash_files ${cpp}) - endif() - endforeach() - - list(REMOVE_ITEM BII_LIB_SRC ${trash_files}) - - if(WIN32) - file(GLOB_RECURSE platform_files "*/detail/win32/*") - list(APPEND BII_LIB_SRC ${platform_files}) - elseif(APPLE) - file(GLOB_RECURSE platform_files "*/detail/macos_X11/*") - list(APPEND BII_LIB_SRC ${platform_files}) - elseif(UNIX) - file(GLOB_RECURSE platform_files "*/detail/linux_X11/*") - list(APPEND BII_LIB_SRC ${platform_files}) - else() - message(FATAL_ERROR "Only Windows and Unix are supported for the moment (Mac OS is experimental)") - endif() - - # set compile flags - if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall") - endif(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") - - # we'll use the default config file so we can iliminate the following macro definitions - if(MSVC) - # More MSVC specific compilation flags - add_definitions(-D_SCL_SECURE_NO_WARNINGS) - add_definitions(-D_CRT_SECURE_NO_DEPRECATE) - if(MSVC14) - add_definitions(-DSTD_CODECVT_NOT_SUPPORTED) - else() - add_definitions(-DNOT_IMPLEMENTED_KEYWORD_noexcept) - endif() - endif() - add_biicode_targets() return() @@ -54,69 +23,35 @@ endif() project(nana) cmake_minimum_required(VERSION 2.8) -#Select platform automatically -if(WIN32) - add_definitions(-DNANA_WINDOWS) - add_definitions(-DPLATFORM_SPEC_HPP=) - if(MSVC14) - add_definitions(-DSTD_CODECVT_NOT_SUPPORTED) - else() - add_definitions(-DNOT_IMPLEMENTED_KEYWORD_noexcept) - endif() - - #Test if it is MINGW - if(MINGW) - add_definitions(-DNANA_MINGW) - add_definitions(-DSTD_CODECVT_NOT_SUPPORTED) - if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.8.1") - option(NANA_THREAD_NOT_SUPPORTED "Use this flag if MinGW version is older than 4.8.1" ON) - endif() - endif() - if(NANA_THREAD_NOT_SUPPORTED) - add_definitions(-DSTD_THREAD_NOT_SUPPORTED) - endif() - endif() -endif() -if(APPLE) - add_definitions(-DNANA_MACOS) - add_definitions(-DNANA_X11) - add_definitions(-DPLATFORM_SPEC_HPP=) - add_definitions(-DSTD_CODECVT_NOT_SUPPORTED) - include_directories(/opt/X11/include/) -elseif(UNIX) - add_definitions(-DNANA_LINUX) - add_definitions(-DNANA_X11) - add_definitions(-DPLATFORM_SPEC_HPP=) - add_definitions(-DSTD_CODECVT_NOT_SUPPORTED) -endif() - #Global MSVC definitions if(WIN32) if(MSVC) option(WIN32_USE_MP "Set to ON to build nana with the /MP option (Visual Studio 2005 and above)." ON) + # ?? if(WIN32_USE_MP) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP") endif() - # More MSVC specific compilation flags - add_definitions(-D_SCL_SECURE_NO_WARNINGS) - add_definitions(-D_CRT_SECURE_NO_DEPRECATE) endif(MSVC) endif(WIN32) #Unicode -option(NANA_UNICODE "Use Unicode Character Set" ON) -if(NANA_UNICODE) - add_definitions(-DNANA_UNICODE) - if(WIN32) - add_definitions(-DUNICODE -D_UNICODE) - endif() +option(USE_UNICODE "Use Unicode Character Set") +if(USE_UNICODE) + add_definitions(-DNANA_UNICODE) endif() -#Find PNG +if(APPLE) + add_definitions(-DAPPLE) + include_directories(/opt/X11/include/) +elseif(UNIX) + add_definitions(-Dlinux) +endif() + + + if(UNIX) find_package(Freetype) if (FREETYPE_FOUND) @@ -124,30 +59,42 @@ if(UNIX) endif() endif() -option(NANA_ENABLE_PNG "Enable the use of PNG" ON) -if(NANA_ENABLE_PNG) - add_definitions(-DNANA_ENABLE_PNG) +if(WIN32) + add_definitions(-DWIN32) + if(MINGW) + add_definitions(-DMINGW) + endif() +endif() - option(NANA_LIBPNG "Use the included libpng" ON) - if(NANA_LIBPNG) - add_definitions(-DNANA_LIBPNG) - else() +#Find PNG +option(ENABLE_PNG "Enable the use of PNG") +option(LIBPNG_FROM_OS "Use libpng from operating system.") +if(ENABLE_PNG) + add_definitions(-DNANA_ENABLE_PNG) + if(LIBPNG_FROM_OS) find_package(PNG) if (PNG_FOUND) include_directories( ${PNG_INCLUDE_DIRS}) + add_definitions(-DUSE_LIBPNG_FROM_OS) endif() endif() endif() -#Copy our new config.hpp (with removed defines) -execute_process(COMMAND ${CMAKE_COMMAND} - -E copy_if_different - ${CMAKE_CURRENT_SOURCE_DIR}/build/cmake/config.hpp - ${CMAKE_CURRENT_SOURCE_DIR}/include/nana/) - -if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall") -endif(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") +#Find JPEG +option(ENABLE_JPEG "Enable the use of JPEG") +option(LIBJPEG_FROM_OS "Use libjpeg from operating system.") +if(ENABLE_JPEG) + add_definitions(-DNANA_ENABLE_JPEG) + if(LIBJPEG_FROM_OS) + find_package(JPEG) + if (JPEG_FOUND) + include_directories( ${JPEG_INCLUDE_DIRS}) + add_definitions(-DUSE_LIBJPEG_FROM_OS) + endif() + endif() +endif() + + set(NANA_SOURCE_DIR ${CMAKE_SOURCE_DIR}/source) set(NANA_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/include) diff --git a/build/cmake/config.hpp b/build/cmake/config.hpp deleted file mode 100644 index 08527a55..00000000 --- a/build/cmake/config.hpp +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Nana Configuration - * Nana C++ Library(http://www.nanapro.org) - * Copyright(C) 2003-2014 Jinhao(cnjinhao@hotmail.com) - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or copy at - * http://www.boost.org/LICENSE_1_0.txt) - * - * @file: nana/config.hpp - */ - -#ifndef NANA_CONFIG_HPP -#define NANA_CONFIG_HPP - -//All defines have been moved to the CMakelists.txt in the root directory. - -#endif //NANA_CONFIG_HPP diff --git a/include/nana/audio/detail/buffer_preparation.hpp b/include/nana/audio/detail/buffer_preparation.hpp index fdffc91c..c3e03d71 100644 --- a/include/nana/audio/detail/buffer_preparation.hpp +++ b/include/nana/audio/detail/buffer_preparation.hpp @@ -3,7 +3,7 @@ #include #include -#if defined(NANA_MINGW) && defined(STD_THREAD_NOT_SUPPORTED) +#if defined(STD_THREAD_NOT_SUPPORTED) #include #include #include diff --git a/include/nana/charset.hpp b/include/nana/charset.hpp index 9e109b65..6c36159b 100644 --- a/include/nana/charset.hpp +++ b/include/nana/charset.hpp @@ -1,3 +1,17 @@ +/** + * The charset Implementation + * Nana C++ Library(http://www.nanapro.org) + * Copyright(C) 2003-2015 Jinhao(cnjinhao@hotmail.com) + * + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) + * + * @file: nana/charset.hpp + * + * + */ + #ifndef NANA_CHARSET_HPP #define NANA_CHARSET_HPP #include @@ -13,6 +27,7 @@ namespace nana { class charset_encoding_interface; } + /// An intelligent charset class for character code conversion. class charset { diff --git a/include/nana/config.hpp b/include/nana/config.hpp index 188f7562..806a0fd1 100644 --- a/include/nana/config.hpp +++ b/include/nana/config.hpp @@ -1,7 +1,7 @@ -/* +/** * Nana Configuration * Nana C++ Library(http://www.nanapro.org) - * Copyright(C) 2003-2014 Jinhao(cnjinhao@hotmail.com) + * Copyright(C) 2003-2015 Jinhao(cnjinhao@hotmail.com) * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at @@ -13,57 +13,131 @@ #ifndef NANA_CONFIG_HPP #define NANA_CONFIG_HPP -#if defined(_MSC_VER) - #define _SCL_SECURE_NO_WARNINGS - #define _CRT_SECURE_NO_DEPRECATE - #pragma warning(disable : 4996) +// Select platform ...... - #if (_MSC_VER < 1900) - // is this a good idea? - #define NOT_IMPLEMENTED_KEYWORD_noexcept - #endif // _MSC_VER < 1900 - #if (_MSC_VER == 1900) - // google: break any code that tries to use codecvt or codecvt. - // google: It appears the C++ libs haven't been compiled with native char16_t/char32_t support. - // google: Those definitions are for codecvt::id, codecvt::id and codecvt::id respectively. - // However, the codecvt::id and codecvt::id definitions aren't there, and indeed, if you look at locale0.cpp in the CRT source code you'll see they're not defined at all. - // google: That's a known issue, tracked by an active bug (DevDiv#1060849). We were able to update the STL's headers in response to char16_t/char32_t, but we still need to update the separately compiled sources. - #define STD_CODECVT_NOT_SUPPORTED - #endif // _MSC_VER == 1900 -#endif // _MSVC + // Windows: + #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) -//Select platform automatically -#if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) -//Windows: - #define NANA_WINDOWS 1 + #define NANA_WINDOWS 1 - //Test if it is MINGW - #if defined(__MINGW32__) || defined(__MINGW64__) - #define NANA_MINGW - #define STD_CODECVT_NOT_SUPPORTED - #if (__GNUC__ == 4) && ((__GNUC_MINOR__ < 8) || (__GNUC_MINOR__ == 8 && __GNUC_PATCHLEVEL__ < 1)) + // compilers in Windows... + + // MSVC++ versions + #if defined(_MSC_VER) + #define _SCL_SECURE_NO_WARNNGS + #define _CRT_SECURE_NO_DEPRECATE + #pragma warning(disable : 4996) + + #if (_MSC_VER == 1900) + // google: break any code that tries to use codecvt or codecvt. + // google: It appears the C++ libs haven't been compiled with native char16_t/char32_t support. + // google: Those definitions are for codecvt::id, codecvt::id and codecvt::id respectively. + // However, the codecvt::id and codecvt::id definitions aren't there, and indeed, if you look at locale0.cpp in the CRT source code you'll see they're not defined at all. + // google: That's a known issue, tracked by an active bug (DevDiv#1060849). We were able to update the STL's headers in response to char16_t/char32_t, but we still need to update the separately compiled sources. + #define STD_CODECVT_NOT_SUPPORTED + #endif // _MSC_VER == 1900 + #endif // _MSVC + + // MINGW ... + #if defined(__MINGW32__) || defined(__MINGW64__) || defined(MINGW) + #define NANA_MINGW + //#define STD_THREAD_NOT_SUPPORTED // don't works? why? where __GNUC__, etc. are set? by CLion ?? //Use this flag if MinGW version is older than 4.8.1 - #define STD_THREAD_NOT_SUPPORTED + #if ((__GNUC__ == 4) && ((__GNUC_MINOR__ < 8) || (__GNUC_MINOR__ == 8 && __GNUC_PATCHLEVEL__ < 2))) + // don't works? why? where __GNUC__, etc. are set? by CLion ?? + // ?? + #define UNDEFINED_to_string + + // https://github.com/meganz/mingw-std-threads + #define STD_THREAD_NOT_SUPPORTED + #define USE_github_com_meganz_mingw_std_threads + + #endif + + #endif // MINGW + + // end Windows + + + // MacOS: who define APPLE ?? + //#define APPLE + #elif defined(APPLE) + #define NANA_MACOS 1 + #define NANA_X11 1 + // how to add this: include_directories(/opt/X11/include/) + // end MacOS + + // Linux: (not sure about __GNU__ ??) + #elif (defined(linux) || defined(__linux) || defined(__linux__) || defined(__GNU__) || defined(__GLIBC__)) && !defined(_CRAYC) + #define NANA_LINUX 1 + #define NANA_X11 1 + // end Linux + + + #else + # static_assert(false, "Only Windows and Unix are supported now (Mac OS is experimental)"); + #endif // Select platform + + #if defined(NANA_LINUX) || defined(NANA_MACOS) + #undef NANA_WINDOWS + #endif +// End Select platform ...... + +// compilers ... + +// temp +//#define STD_NUMERIC_CONVERSIONS_NOT_SUPPORTED // don't works? +//#define STD_CODECVT_NOT_SUPPORTED + + // GCC ... + #if defined(__GNU__) + #if (__GNUC__ == 4) && (__GNUC_MINOR__ == 8) && (__GNUC_PATCHLEVEL__ <= 1) + // don't works? + + //GCC 4.7.0 does not implement the and codecvt_utfx classes ?? + #define STD_CODECVT_NOT_SUPPORTED + + //Some functions which are specified in 21.5 Numeric conversions in Strings library have not yet implemented + + //Implement workarounds for GCC/MinGW which version is below 4.8.2 + #define STD_NUMERIC_CONVERSIONS_NOT_SUPPORTED #endif - #endif -#elif (defined(linux) || defined(__linux) || defined(__linux__) || defined(__GNU__) || defined(__GLIBC__)) && !defined(_CRAYC) -//Linux: - #define NANA_LINUX 1 - #define NANA_X11 1 - #define STD_CODECVT_NOT_SUPPORTED -#else -# static_assert(false, "Only Windows and Unix are supported now (Mac OS is experimental)"); -#endif + #endif // GCC +// End compilers ... -#if defined(NANA_MINGW) || defined(NANA_LINUX) - #if (__GNUC__ == 4) && (__GNUC_MINOR__ == 8) && (__GNUC_PATCHLEVEL__ <= 1) - //Some functions which are specified in 21.5 Numeric conversions in Strings library have not yet implemented - #define STD_NUMERIC_CONVERSIONS_NOT_SUPPORTED + +// Here defines some flags that tell Nana what features will be supported. + +/////////////////// +//Support for PNG +// Define the NANA_ENABLE_PNG to enable the support of PNG. +// +//#define NANA_ENABLE_PNG //! +//#define USE_LIBPNG_FROM_OS // Un-Comment it to use libpng from operating system. +#if defined(NANA_ENABLE_PNG) + #if not defined(USE_LIBPNG_FROM_OS) + #define NANA_LIBPNG #endif #endif -//Here defines some flags that tell Nana what features will be supported. -#define NANA_UNICODE +/////////////////// +//Support for JPEG +// Define the NANA_ENABLE_JPEG to enable the support of JPEG. +// +//#define NANA_ENABLE_JPEG //! +//#define USE_LIBJPEG_FROM_OS // Un-Comment it to use libjpeg from operating system. +#if defined(NANA_ENABLE_JPEG) + #if not defined(USE_LIBJPEG_FROM_OS) + #define NANA_LIBJPEG + #endif +#endif + + + +// always define NANA_UNICODE ?? it will be deprecated ?. +#ifndef NANA_UNICODE + #define NANA_UNICODE +#endif #if defined(NANA_UNICODE) && defined(NANA_WINDOWS) #ifndef _UNICODE @@ -75,23 +149,5 @@ #endif #endif -/////////////////// -//Support for PNG -// Define the NANA_ENABLE_PNG to enable the support of PNG. -// -//#define NANA_ENABLE_PNG //! -#if defined(NANA_ENABLE_PNG) - #define NANA_LIBPNG //Comment it to use libpng from operating system. -#endif - -/////////////////// -//Support for JPEG -// Define the NANA_ENABLE_JPEG to enable the support of JPEG. -// -//#define NANA_ENABLE_JPEG //! -#if defined(NANA_ENABLE_JPEG) - #define NANA_LIBJPEG //Comment this whole line to use libjpeg from operating system. -#endif - #endif //NANA_CONFIG_HPP diff --git a/include/nana/deploy.hpp b/include/nana/deploy.hpp index b3ac88d0..e1f15d7d 100644 --- a/include/nana/deploy.hpp +++ b/include/nana/deploy.hpp @@ -19,9 +19,7 @@ #include #include -#if defined(NANA_LINUX) || defined(NANA_MACOS) -#undef NANA_WINDOWS -#endif + //Implement workarounds for GCC/MinGW which version is below 4.8.2 #if defined(STD_NUMERIC_CONVERSIONS_NOT_SUPPORTED) diff --git a/include/nana/detail/linux_X11/platform_spec.hpp b/include/nana/detail/linux_X11/platform_spec.hpp index 461517f9..0a013ed6 100644 --- a/include/nana/detail/linux_X11/platform_spec.hpp +++ b/include/nana/detail/linux_X11/platform_spec.hpp @@ -13,6 +13,8 @@ * This file should not be included by any header files. */ +#if defined(NANA_LINUX) || defined(NANA_MACOS) + #ifndef NANA_DETAIL_PLATFORM_SPEC_HPP #define NANA_DETAIL_PLATFORM_SPEC_HPP @@ -323,5 +325,9 @@ namespace detail }//end namespace nana +// .h ward +#endif + +//#if defined(NANA_LINUX) || defined(NANA_MACOS) #endif diff --git a/include/nana/detail/win32/platform_spec.hpp b/include/nana/detail/win32/platform_spec.hpp index b0b90fad..b129406b 100644 --- a/include/nana/detail/win32/platform_spec.hpp +++ b/include/nana/detail/win32/platform_spec.hpp @@ -12,6 +12,7 @@ * This file provides basis class and data structrue that required by nana * This file should not be included by any header files. */ +#if defined(NANA_WINDOWS) #ifndef NANA_DETAIL_PLATFORM_SPEC_HPP #define NANA_DETAIL_PLATFORM_SPEC_HPP @@ -198,4 +199,9 @@ namespace detail }//end namespace detail }//end namespace nana + +// .h ward +#endif + +//#if defined(NANA_WINDOWS) #endif diff --git a/include/nana/gui/detail/events_operation.hpp b/include/nana/gui/detail/events_operation.hpp index 08a98b48..78f5c432 100644 --- a/include/nana/gui/detail/events_operation.hpp +++ b/include/nana/gui/detail/events_operation.hpp @@ -5,7 +5,7 @@ #include #include -#if defined(NANA_MINGW) && defined(STD_THREAD_NOT_SUPPORTED) +#if defined(STD_THREAD_NOT_SUPPORTED) #include #else #include diff --git a/include/nana/gui/detail/handle_manager.hpp b/include/nana/gui/detail/handle_manager.hpp index 91ac70f1..7e8f670d 100644 --- a/include/nana/gui/detail/handle_manager.hpp +++ b/include/nana/gui/detail/handle_manager.hpp @@ -17,7 +17,7 @@ #include #include -#if defined(NANA_MINGW) && defined(STD_THREAD_NOT_SUPPORTED) +#if defined(STD_THREAD_NOT_SUPPORTED) #include #else #include diff --git a/include/nana/gui/detail/window_manager.hpp b/include/nana/gui/detail/window_manager.hpp index c8229df6..b04c32dc 100644 --- a/include/nana/gui/detail/window_manager.hpp +++ b/include/nana/gui/detail/window_manager.hpp @@ -106,7 +106,7 @@ namespace detail //@brief: Delete window handle, the handle type must be a root and a frame. void destroy_handle(core_window_t*); - void default_icon(const paint::image& small_icon, const paint::image& big_icon); + void default_icon(const paint::image& _small_icon, const paint::image& big_icon); void icon(core_window_t*, const paint::image& small_icon, const paint::image& big_icon); //show diff --git a/include/nana/std_condition_variable.hpp b/include/nana/std_condition_variable.hpp index 72399b59..0c9813fc 100644 --- a/include/nana/std_condition_variable.hpp +++ b/include/nana/std_condition_variable.hpp @@ -3,10 +3,14 @@ #include #if defined(STD_THREAD_NOT_SUPPORTED) +#if defined(USE_github_com_meganz_mingw_std_threads) + #include +#else #include namespace std { typedef boost::condition_variable condition_variable; } -#endif +#endif // (USE_github_com_meganz_mingw_std_threads) +#endif // (STD_THREAD_NOT_SUPPORTED) #endif // NANA_STD_CONDITION_VARIABLE_HPP diff --git a/include/nana/std_mutex.hpp b/include/nana/std_mutex.hpp index 9fdebfc6..5eb6528a 100644 --- a/include/nana/std_mutex.hpp +++ b/include/nana/std_mutex.hpp @@ -3,6 +3,20 @@ #include #if defined(STD_THREAD_NOT_SUPPORTED) + +#if defined(USE_github_com_meganz_mingw_std_threads) +#include +#include +#include +#include +#include +#include +#include +// http://lxr.free-electrons.com/source/include/uapi/asm-generic/errno.h#L53 +#define EPROTO 71 /* Protocol error */ +#include +#include +#else #include #include #include @@ -18,5 +32,6 @@ namespace std typedef boost::mutex mutex; typedef boost::recursive_mutex recursive_mutex; } -#endif +#endif // (USE_github_com_meganz_mingw_std_threads) +#endif // (STD_THREAD_NOT_SUPPORTED) #endif // NANA_STD_MUTEX_HPP diff --git a/include/nana/std_thread.hpp b/include/nana/std_thread.hpp index 572193ac..321b3728 100644 --- a/include/nana/std_thread.hpp +++ b/include/nana/std_thread.hpp @@ -3,11 +3,15 @@ #include #if defined(STD_THREAD_NOT_SUPPORTED) + +#if defined(USE_github_com_meganz_mingw_std_threads) +#include +#else #include namespace std { typedef boost::thread thread; } -#endif - +#endif // (USE_github_com_meganz_mingw_std_threads) +#endif // (STD_THREAD_NOT_SUPPORTED) #endif // NANA_STD_THREAD_HPP diff --git a/source/deploy.cpp b/source/deploy.cpp index d61b0dd5..817721ec 100644 --- a/source/deploy.cpp +++ b/source/deploy.cpp @@ -61,6 +61,13 @@ namespace std *pos = (std::size_t)(end - sptr); return ((int)result); } + using ::strtof; + using ::strtold; + using ::wcstold; + using ::strtoll; + using ::wcstoll; + using ::strtoull; + using ::wcstoull; float stof(const std::string& str, std::size_t * pos) { diff --git a/source/detail/linux_X11/platform_spec.cpp b/source/detail/linux_X11/platform_spec.cpp index d2244430..1f17cda4 100644 --- a/source/detail/linux_X11/platform_spec.cpp +++ b/source/detail/linux_X11/platform_spec.cpp @@ -13,6 +13,9 @@ * * http://standards.freedesktop.org/clipboards-spec/clipboards-0.1.txt */ + +#if defined(NANA_LINUX) || defined(NANA_MACOS) + #include #include #include @@ -1411,3 +1414,7 @@ namespace detail } }//end namespace detail }//end namespace nana + + +//#if defined(NANA_LINUX) || defined(NANA_MACOS) +#endif diff --git a/source/detail/win32/platform_spec.cpp b/source/detail/win32/platform_spec.cpp index ffc6dc28..7b048aba 100644 --- a/source/detail/win32/platform_spec.cpp +++ b/source/detail/win32/platform_spec.cpp @@ -11,6 +11,9 @@ * * This file provides basis class and data structrue that required by nana */ + +#if defined(NANA_WINDOWS) + #include #include #include @@ -289,3 +292,6 @@ namespace detail } }//end namespace detail }//end namespace nana + +//#if defined(NANA_WINDOWS) +#endif \ No newline at end of file diff --git a/source/gui/animation.cpp b/source/gui/animation.cpp index 4b1c8e59..a82702e6 100644 --- a/source/gui/animation.cpp +++ b/source/gui/animation.cpp @@ -21,7 +21,7 @@ #include #include -#if defined(NANA_MINGW) && defined(STD_THREAD_NOT_SUPPORTED) +#if defined(STD_THREAD_NOT_SUPPORTED) #include #include #include @@ -29,7 +29,7 @@ #include #include #include -#endif //NANA_MINGW +#endif // STD_THREAD_NOT_SUPPORTED namespace nana { diff --git a/source/gui/detail/native_window_interface.cpp b/source/gui/detail/native_window_interface.cpp index fa3c2558..202a76d3 100644 --- a/source/gui/detail/native_window_interface.cpp +++ b/source/gui/detail/native_window_interface.cpp @@ -14,7 +14,7 @@ #include #include #if defined(NANA_WINDOWS) - #if defined(NANA_MINGW) && defined(STD_THREAD_NOT_SUPPORTED) + #if defined(STD_THREAD_NOT_SUPPORTED) #include #else #include diff --git a/source/gui/detail/window_manager.cpp b/source/gui/detail/window_manager.cpp index eb56ff89..909cf193 100644 --- a/source/gui/detail/window_manager.cpp +++ b/source/gui/detail/window_manager.cpp @@ -463,10 +463,10 @@ namespace detail } } - void window_manager::default_icon(const nana::paint::image& small, const nana::paint::image& big) + void window_manager::default_icon(const nana::paint::image& _small, const nana::paint::image& big) { impl_->default_icon_big = big; - impl_->default_icon_small = small; + impl_->default_icon_small = _small; } void window_manager::icon(core_window_t* wd, const paint::image& small_icon, const paint::image& big_icon) diff --git a/source/gui/notifier.cpp b/source/gui/notifier.cpp index b9577bdb..242b0334 100644 --- a/source/gui/notifier.cpp +++ b/source/gui/notifier.cpp @@ -20,7 +20,7 @@ #include #include -#if defined(NANA_MINGW) && defined(STD_THREAD_NOT_SUPPORTED) +#if defined(STD_THREAD_NOT_SUPPORTED) #include #else #include diff --git a/source/gui/place.cpp b/source/gui/place.cpp index c31daf36..da742af5 100644 --- a/source/gui/place.cpp +++ b/source/gui/place.cpp @@ -95,13 +95,13 @@ namespace nana std::string pos_str() const { -#ifdef NANA_MINGW +#ifdef UNDEFINED_to_string std::stringstream ss; ss< #include -#if defined(NANA_MINGW) && defined(STD_THREAD_NOT_SUPPORTED) +#if defined(STD_THREAD_NOT_SUPPORTED) #include #else #include diff --git a/source/internationalization.cpp b/source/internationalization.cpp index 56bc327e..c2e47e5d 100644 --- a/source/internationalization.cpp +++ b/source/internationalization.cpp @@ -14,9 +14,16 @@ #include #include #include -#include -#include +#include // Warning:(17, 1) [unused] Unused import statement +#include // Warning:(17, 1) [unused] Unused import statement + +#if defined(STD_THREAD_NOT_SUPPORTED) +#include +#else #include +#endif + + #include namespace nana @@ -68,7 +75,7 @@ namespace nana bool escape = false; for (auto i = read_ptr_ + 1; i != end_ptr_; ++i) { - if (escape) + if (escape) // Warning:(78, 12) Condition is always false { escape = false; continue; @@ -261,8 +268,9 @@ namespace nana { auto result = mgr.table.emplace(wd, std::move(eval)); result.first->second.destroy = nana::API::events(wd).destroy([wd]{ - auto & mgr = get_eval_manager(); - std::lock_guard lock(mgr.mutex); + auto & mgr = get_eval_manager(); // Warning:(271, 13) Local 'mgr' hides previous declaration + std::lock_guard lock(mgr.mutex); // Local 'lock' hides previous + mgr.table.erase(wd); }); } diff --git a/source/threads/pool.cpp b/source/threads/pool.cpp index aa9bd461..d15180d5 100644 --- a/source/threads/pool.cpp +++ b/source/threads/pool.cpp @@ -17,8 +17,9 @@ #include #if defined(STD_THREAD_NOT_SUPPORTED) - #include #include + #include + #else #include #include