aboutsummaryrefslogtreecommitdiff
path: root/libbutl/backtrace.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'libbutl/backtrace.cxx')
-rw-r--r--libbutl/backtrace.cxx30
1 files changed, 8 insertions, 22 deletions
diff --git a/libbutl/backtrace.cxx b/libbutl/backtrace.cxx
index 8c9c6ae..347e231 100644
--- a/libbutl/backtrace.cxx
+++ b/libbutl/backtrace.cxx
@@ -1,15 +1,14 @@
// file : libbutl/backtrace.cxx -*- C++ -*-
// license : MIT; see accompanying LICENSE file
-#ifndef __cpp_modules_ts
-#include <libbutl/backtrace.mxx>
-#endif
+#include <libbutl/backtrace.hxx>
// We only enable backtrace during bootstrap if we can do it without any
// complications of the build scripts/makefiles.
//
// With glibc linking with -rdynamic gives (non-static) function names.
-// FreeBSD/NetBSD requires explicitly linking -lexecinfo.
+// FreeBSD/NetBSD requires explicitly linking -lexecinfo. OpenBSD only has
+// this functionality built-in from 7.0 and requires -lexecinfo.
//
// Note that some libc implementation on Linux (most notably, musl), don't
// support this, at least not out of the box.
@@ -20,6 +19,11 @@
defined(__FreeBSD__) || \
defined(__NetBSD__)
# define LIBBUTL_BACKTRACE
+# elif defined (__OpenBSD__)
+# include <sys/param.h> // OpenBSD (yyyymm)
+# if OpenBSD >= 202110 // 7.0 was released in October 2021.
+# define LIBBUTL_BACKTRACE
+# endif
# endif
#else
# if defined(__GLIBC__) || \
@@ -35,30 +39,12 @@
#include <cassert>
-#ifndef __cpp_lib_modules_ts
-#include <string>
-
#ifdef LIBBUTL_BACKTRACE
# include <memory> // unique_ptr
# include <cstddef> // size_t
#endif
#include <exception>
-#endif
-
-// Other includes.
-
-#ifdef __cpp_modules_ts
-module butl.backtrace;
-
-// Only imports additional to interface.
-#ifdef __clang__
-#ifdef __cpp_lib_modules_ts
-import std.core;
-#endif
-#endif
-
-#endif
using namespace std;