diff --git a/src/XrdCeph.cmake b/src/XrdCeph.cmake index ace2f5921f5..b692b9001fe 100644 --- a/src/XrdCeph.cmake +++ b/src/XrdCeph.cmake @@ -18,7 +18,15 @@ add_library( # needed during the transition between ceph giant and ceph hammer # for object listing API set_property(SOURCE XrdCeph/XrdCephPosix.cc - PROPERTY COMPILE_FLAGS " -Wno-deprecated-declarations") + PROPERTY COMPILE_FLAGS " -Wno-deprecated-declarations") + +# needed for librados when as C++11 is enabled +include(CheckCXXCompilerFlag) +CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11) +IF (COMPILER_SUPPORTS_CXX11) + set_property(SOURCE XrdCeph/XrdCephPosix.cc APPEND_STRING + PROPERTY COMPILE_FLAGS " -std=c++11") +ENDIF() target_link_libraries( XrdCephPosix diff --git a/src/XrdCeph/XrdCephPosix.cc b/src/XrdCeph/XrdCephPosix.cc index 99bacef5aa4..644490ca00a 100644 --- a/src/XrdCeph/XrdCephPosix.cc +++ b/src/XrdCeph/XrdCephPosix.cc @@ -220,15 +220,15 @@ static int fillCephStripeUnit(const std::string ¶ms, unsigned int offset, Xr if (NULL != env) { char* cStripeUnit = env->Get("cephStripeUnit"); if (0 != cStripeUnit) { - file.stripeUnit = stoull(cStripeUnit); + file.stripeUnit = ::stoull(cStripeUnit); } } } else { - file.stripeUnit = stoull(params.substr(offset)); + file.stripeUnit = ::stoull(params.substr(offset)); } return params.size(); } else { - file.stripeUnit = stoull(params.substr(offset, comPos-offset)); + file.stripeUnit = ::stoull(params.substr(offset, comPos-offset)); return comPos+1; } } @@ -244,11 +244,11 @@ static void fillCephObjectSize(const std::string ¶ms, unsigned int offset, X if (NULL != env) { char* cObjectSize = env->Get("cephObjectSize"); if (0 != cObjectSize) { - file.objectSize = stoull(cObjectSize); + file.objectSize = ::stoull(cObjectSize); } } } else { - file.objectSize = stoull(params.substr(offset)); + file.objectSize = ::stoull(params.substr(offset)); } }