From 3b993e127470889e2de6a2eb312d794d31df99a4 Mon Sep 17 00:00:00 2001 From: yumetodo Date: Tue, 15 Mar 2016 12:06:42 +0900 Subject: [PATCH] =?UTF-8?q?=5F=5Fcpp=5Fuser=5Fdefined=5Fliterals=E3=81=ABV?= =?UTF-8?q?S=E3=81=AEIntelliSense=E3=81=AF=E5=AF=BE=E5=BF=9C=E3=81=97?= =?UTF-8?q?=E3=81=A6=E3=81=84=E3=82=8B=E3=81=8C=E3=80=81=E3=82=B3=E3=83=B3?= =?UTF-8?q?=E3=83=91=E3=82=A4=E3=83=A9=E3=81=AF=E5=AF=BE=E5=BF=9C=E3=81=97?= =?UTF-8?q?=E3=81=A6=E3=81=84=E3=81=AA=E3=81=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dxlibex/basic_types/bel.hpp | 10 ---------- dxlibex/config/compiler/visualc.hpp | 3 +++ samples/sound_play/sound_play/main.cpp | 2 ++ 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/dxlibex/basic_types/bel.hpp b/dxlibex/basic_types/bel.hpp index 571cfa3..b2a7b78 100644 --- a/dxlibex/basic_types/bel.hpp +++ b/dxlibex/basic_types/bel.hpp @@ -114,24 +114,14 @@ namespace dxle { using namespace sound_units; } #ifdef DXLE_SUPPORT_CXX11_USER_DEFINED_LITERALS -#if !defined(_MSC_VER) || defined(__clang__) namespace dxle { namespace sound_units { namespace sound_units_literals { -#else -# define myrio_bel dxle::myrio_bel -# define deci_bel dxle::deci_bel -#endif inline DXLE_CONSTEXPR myrio_bel operator "" _myrioB(unsigned long long myrioB) { return myrio_bel(static_cast(myrioB)); } inline DXLE_CONSTEXPR deci_bel operator "" _dB(unsigned long long myrioB) { return deci_bel(static_cast(myrioB)); } -#if !defined(_MSC_VER) || defined(__clang__) } } } using namespace dxle::sound_units::sound_units_literals; -#else -# undef myrio_bel -# undef deci_bel -#endif #endif #endif //DXLE_INC_BASIC_TYPES_BEL_HPP_ diff --git a/dxlibex/config/compiler/visualc.hpp b/dxlibex/config/compiler/visualc.hpp index e693fd4..a70f966 100644 --- a/dxlibex/config/compiler/visualc.hpp +++ b/dxlibex/config/compiler/visualc.hpp @@ -32,5 +32,8 @@ #ifndef __cpp_user_defined_literals #define DXLE_NO_CXX11_USER_DEFINED_LITERALS #endif +#if _MSC_VER == 1900 +#undef DXLE_NO_CXX11_USER_DEFINED_LITERALS +#endif #endif // #ifndef DXLE_INC_CONFIG_COMPILER_VISUALC_HPP_ diff --git a/samples/sound_play/sound_play/main.cpp b/samples/sound_play/sound_play/main.cpp index 93b2472..7b1d90b 100644 --- a/samples/sound_play/sound_play/main.cpp +++ b/samples/sound_play/sound_play/main.cpp @@ -3,8 +3,10 @@ #include int WINAPI WinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, LPSTR /*lpCmdLine*/, int /*nCmdShow*/) { //SetCreateSoundPitchRate(100); +#ifdef DXLE_SUPPORT_CXX11_USER_DEFINED_LITERALS constexpr auto rate = 300_dB; constexpr auto rate2 = 4000_myrioB; constexpr auto rate3 = dxle::bel_cast(rate); +#endif constexpr dxle::deci_bel rate4(100); }