Skip to content

Commit 42466e2

Browse files
committed
Make it compile on OS X
1 parent 119b7fc commit 42466e2

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

src/util.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#include "util.h"
22

3+
#ifndef __APPLE__
4+
35
#include <string.h>
46

57
const char* strnchr(const char* str, size_t len, int character) {
@@ -40,3 +42,5 @@ const char* strnstr(const char* str, const char* find, size_t len)
4042

4143
return ((char*) str);
4244
}
45+
46+
#endif /* __APPLE__ */

src/util.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
#ifndef __UTIL_H__
22
#define __UTIL_H__
33

4+
#ifndef __APPLE__
5+
46
#include <stdlib.h>
57

68
const char* strnchr(const char* str, size_t len, int character);
79
const char* strnstr(const char* str, const char* find, size_t len);
810

11+
#endif /* __APPLE__ */
12+
913
#endif /* __UTIL_H__ */

0 commit comments

Comments
 (0)