Skip to content

Commit

Permalink
Try harder to appease MSVC
Browse files Browse the repository at this point in the history
  • Loading branch information
miscco committed Jun 10, 2024
1 parent a31debc commit 740fefe
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions libcudacxx/include/cuda/std/__exception/cuda_error.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ class cuda_error : public ::std::runtime_error
char __buffer[256];
};

static char* __format_string(::cudaError_t __status, const char* __msg, char* __formatted_msg) noexcept
static char* __format_cuda_error(::cudaError_t __status, const char* __msg, char* __msg_buffer) noexcept
{
::snprintf(__formatted_msg, 256, "cudaError %d: %s", __status, __msg);
return __formatted_msg;
::snprintf(__msg_buffer, 256, "cudaError %d: %s", __status, __msg);
return __msg_buffer;
}

public:
cuda_error(::cudaError_t __status, const char* __msg, __msg_storage __formatted_msg = {0}) noexcept
: ::std::runtime_error(__format_string(__status, __msg, __formatted_msg.__buffer))
cuda_error(::cudaError_t __status, const char* __msg, __msg_storage __msg_buffer = {0}) noexcept
: ::std::runtime_error(__format_cuda_error(__status, __msg, __msg_buffer.__buffer))
{}
};

Expand Down

0 comments on commit 740fefe

Please sign in to comment.