Skip to content

Commit

Permalink
Try .to_string()
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeshingles committed Nov 11, 2024
1 parent e99b063 commit 1fbc716
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .clangd
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Diagnostics:
# std::ranges::upper_bound is triggering warning to include a private libc++ header __algorithm/ranges_upper_bound.h
# IgnoreHeader: '.*(ranges).*'
IgnoreHeader: 'signal.h|(_).*(.h)|.*(__algorithm).*'
AnalyzeAngledIncludes: true

Completion:
AllScopes: true
Expand All @@ -23,3 +24,7 @@ InlayHints:
Designators: true
Enabled: true
ParameterNames: true
DeducedTypes: false

Hover:
ShowAKA: Yes
11 changes: 6 additions & 5 deletions sn3d.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#define __device__
#endif

#include <getopt.h>
#include <gsl/gsl_integration.h>
#include <sys/wait.h>
#include <unistd.h>
Expand All @@ -40,9 +39,9 @@

#ifdef ENABLE_STACKTRACE
#include <stacktrace>
#define STACKTRACEIFSUPPORTED << std::stacktrace::current() << "\n"
#define STACKTRACEIFSUPPORTED std::stacktrace::current().to_string()
#else
#define STACKTRACEIFSUPPORTED << "std::stacktrace not supported\n"
#define STACKTRACEIFSUPPORTED "std::stacktrace not supported\n"
#endif

#ifdef STDPAR_ON
Expand Down Expand Up @@ -136,11 +135,13 @@ __attribute__((__format__(__printf__, 1, 2))) inline auto printout(const char *f
if (!assertpass) [[unlikely]] { \
if (output_file) { \
output_file << "\n[rank " << globals::my_rank << "] " << __FILE__ << ":" << __LINE__ << ": failed assertion `" \
<< #e << "` in function " << __PRETTY_FUNCTION__ << "\n" STACKTRACEIFSUPPORTED; \
<< #e << "` in function " << __PRETTY_FUNCTION__ << "\n" \
<< STACKTRACEIFSUPPORTED; \
output_file.flush(); \
} \
std::cerr << "\n[rank " << globals::my_rank << "] " << __FILE__ << ":" << __LINE__ << ": failed assertion `" \
<< #e << "` in function " << __PRETTY_FUNCTION__ << "\n" STACKTRACEIFSUPPORTED; \
<< #e << "` in function " << __PRETTY_FUNCTION__ << "\n" \
<< STACKTRACEIFSUPPORTED; \
} \
assert(assertpass); \
}
Expand Down

0 comments on commit 1fbc716

Please sign in to comment.