diff --git a/src/TNL/Logger_impl.h b/src/TNL/Logger_impl.h
index 6f71b40277515ce60ffd3a09082e140731f1a4b5..d419f31b8b2f926ac6d547635a66ba9814fab34b 100644
--- a/src/TNL/Logger_impl.h
+++ b/src/TNL/Logger_impl.h
@@ -48,9 +48,12 @@ Logger::writeSystemInformation( const Config::ParameterContainer& parameters )
 // http://nadeausoftware.com/articles/2012/10/c_c_tip_how_detect_compiler_name_and_version_using_compiler_predefined_macros
 // https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html#compilation-phases
 #if defined(__NVCC__)
-   #define TNL_STRINGIFY(x) #x
+   #define TNL_STRINGIFY_IMPL(x) #x
+   // indirection is necessary in order to expand macros in the argument
+   #define TNL_STRINGIFY(x) TNL_STRINGIFY_IMPL(x)
    const char* compiler_name = "Nvidia NVCC (" TNL_STRINGIFY(__CUDACC_VER_MAJOR__) "." TNL_STRINGIFY(__CUDACC_VER_MINOR__) "." TNL_STRINGIFY(__CUDACC_VER_BUILD__) ")";
    #undef TNL_STRINGIFY
+   #undef TNL_STRINGIFY_IMPL
 #elif defined(__clang__)
    const char* compiler_name = "Clang/LLVM (" __VERSION__ ")";
 #elif defined(__ICC) || defined(__INTEL_COMPILER)