diff --git a/dxlibex/basic_types/bel.hpp b/dxlibex/basic_types/bel.hpp index 63a342f..571cfa3 100644 --- a/dxlibex/basic_types/bel.hpp +++ b/dxlibex/basic_types/bel.hpp @@ -114,14 +114,24 @@ 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 { - inline constexpr myrio_bel operator "" _myrioB(unsigned long long myrioB) { +#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 constexpr myrio_bel operator "" _dB(unsigned long long 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/samples/sound_play/sound_play/main.cpp b/samples/sound_play/sound_play/main.cpp index f8d90d0..93b2472 100644 --- a/samples/sound_play/sound_play/main.cpp +++ b/samples/sound_play/sound_play/main.cpp @@ -6,4 +6,5 @@ int WINAPI WinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, LPSTR / constexpr auto rate = 300_dB; constexpr auto rate2 = 4000_myrioB; constexpr auto rate3 = dxle::bel_cast(rate); + constexpr dxle::deci_bel rate4(100); }