File tree 4 files changed +57
-1
lines changed
4 files changed +57
-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/Support/Errc.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 20
20
#include " llvm/Support/raw_ostream.h"
21
21
#include < map>
22
22
23
+ #ifdef __APPLE__
24
+ #include < Availability.h>
25
+ #if __MAC_OS_X_VERSION_MIN_REQUIRED < 1070
26
+ static size_t strnlen (const char *s, size_t maxlen) {
27
+ size_t l = 0 ;
28
+ while (l < maxlen && *s) {
29
+ l++;
30
+ s++;
31
+ }
32
+ return l;
33
+ }
34
+ #endif
35
+ #endif
36
+
23
37
namespace llvm {
24
38
25
39
static inline Error createError (const Twine &Msg) {
Original file line number Diff line number Diff line change 15
15
#include " llvm/Support/ErrorHandling.h"
16
16
#include " llvm/Support/LEB128.h"
17
17
18
- #include < string.h> // for memcpy
18
+ #include < string.h> // for memcpy and strnlen
19
+
20
+ #ifdef __APPLE__
21
+ #include < Availability.h>
22
+ #if __MAC_OS_X_VERSION_MIN_REQUIRED < 1070
23
+ static size_t strnlen (const char *s, size_t maxlen) {
24
+ size_t l = 0 ;
25
+ while (l < maxlen && *s) {
26
+ l++;
27
+ s++;
28
+ }
29
+ return l;
30
+ }
31
+ #endif
32
+ #endif
19
33
20
34
using namespace llvm ;
21
35
You can’t perform that action at this time.
0 commit comments