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); }