Skip to content

Commit 459538c

Browse files
committed
Simplify has_addr2line check to not link with C++ Standard Library
1 parent cec5700 commit 459538c

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

build/has_addr2line.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
// Copyright Antony Polukhin, 2016-2020.
1+
// Copyright Antony Polukhin, 2016-2025.
22
//
33
// Distributed under the Boost Software License, Version 1.0. (See
44
// accompanying file LICENSE_1_0.txt or copy at
55
// http://www.boost.org/LICENSE_1_0.txt)
66

77
#include <cstdlib>
8-
#include <string>
98

109
#include <boost/config.hpp>
1110
#include <unwind.h>
@@ -15,11 +14,10 @@
1514
int main() {
1615

1716
#ifdef BOOST_STACKTRACE_ADDR2LINE_LOCATION
18-
std::string s = BOOST_STRINGIZE( BOOST_STACKTRACE_ADDR2LINE_LOCATION );
19-
s += " -h";
17+
const char* s = BOOST_STRINGIZE( BOOST_STACKTRACE_ADDR2LINE_LOCATION ) " -h";
2018
#else
21-
std::string s = "/usr/bin/addr2line -h";
19+
const char* s = "/usr/bin/addr2line -h";
2220
#endif
2321

24-
return std::system(s.c_str());
22+
return std::system(s);
2523
}

0 commit comments

Comments
 (0)