File tree 5 files changed +71
-1
lines changed
vendor/backtrace-sys/src/libbacktrace
5 files changed +71
-1
lines changed Original file line number Diff line number Diff line change 21
21
#include < cstdint>
22
22
#include < cstring>
23
23
24
+ #ifdef __APPLE__
25
+ #include < Availability.h>
26
+ #if __MAC_OS_X_VERSION_MIN_REQUIRED < 1070
27
+ static size_t strnlen (const char *s, size_t maxlen) {
28
+ size_t l = 0 ;
29
+ while (l < maxlen && *s) {
30
+ l++;
31
+ s++;
32
+ }
33
+ return l;
34
+ }
35
+ #endif
36
+ #endif
37
+
24
38
namespace llvm {
25
39
26
40
MachOYAML::LoadCommand::~LoadCommand () = default ;
Original file line number Diff line number Diff line change 13
13
#include " llvm/Object/MachO.h"
14
14
#include < memory>
15
15
16
+ #ifdef __APPLE__
17
+ #include < Availability.h>
18
+ #if __MAC_OS_X_VERSION_MIN_REQUIRED < 1070
19
+ static size_t strnlen (const char *s, size_t maxlen) {
20
+ size_t l = 0 ;
21
+ while (l < maxlen && *s) {
22
+ l++;
23
+ s++;
24
+ }
25
+ return l;
26
+ }
27
+ #endif
28
+ #endif
29
+
16
30
namespace llvm {
17
31
namespace objcopy {
18
32
namespace macho {
Original file line number Diff line number Diff line change 21
21
#include " llvm/Support/raw_ostream.h"
22
22
#include < map>
23
23
24
+ #ifdef __APPLE__
25
+ #include < Availability.h>
26
+ #if __MAC_OS_X_VERSION_MIN_REQUIRED < 1070
27
+ static size_t strnlen (const char *s, size_t maxlen) {
28
+ size_t l = 0 ;
29
+ while (l < maxlen && *s) {
30
+ l++;
31
+ s++;
32
+ }
33
+ return l;
34
+ }
35
+ #endif
36
+ #endif
37
+
24
38
namespace llvm {
25
39
26
40
ObjDumper::ObjDumper (ScopedPrinter &Writer) : W(Writer) {}
Original file line number Diff line number Diff line change 14
14
#include " llvm/Support/ErrorHandling.h"
15
15
#include " llvm/Support/LEB128.h"
16
16
17
- #include < string.h> // for memcpy
17
+ #include < string.h> // for memcpy and strnlen
18
+
19
+ #ifdef __APPLE__
20
+ #include < Availability.h>
21
+ #if __MAC_OS_X_VERSION_MIN_REQUIRED < 1070
22
+ static size_t strnlen (const char *s, size_t maxlen) {
23
+ size_t l = 0 ;
24
+ while (l < maxlen && *s) {
25
+ l++;
26
+ s++;
27
+ }
28
+ return l;
29
+ }
30
+ #endif
31
+ #endif
18
32
19
33
using namespace llvm ;
20
34
Original file line number Diff line number Diff line change @@ -76,6 +76,20 @@ POSSIBILITY OF SUCH DAMAGE. */
76
76
#include "backtrace.h"
77
77
#include "internal.h"
78
78
79
+ #ifdef __APPLE__
80
+ #include <Availability.h>
81
+ #if __MAC_OS_X_VERSION_MIN_REQUIRED < 1070
82
+ static size_t strnlen (const char * s , size_t maxlen ) {
83
+ size_t l = 0 ;
84
+ while (l < maxlen && * s ) {
85
+ l ++ ;
86
+ s ++ ;
87
+ }
88
+ return l ;
89
+ }
90
+ #endif
91
+ #endif
92
+
79
93
struct macho_commands_view
80
94
{
81
95
struct backtrace_view view ;
You can’t perform that action at this time.
0 commit comments