Skip to content

Commit

Permalink
Merge pull request #16 from Teckids/google/fix-hurd-kfreebsd-build
Browse files Browse the repository at this point in the history
fix memrchr detection
  • Loading branch information
JinsukKim authored Jul 30, 2019
2 parents 1193457 + e9e7e81 commit 37529e6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion util/string_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,13 @@ inline int strncasecmp(const char* s1, const char* s2, size_t n) {
#endif
}

#if !defined(__linux__)
#ifndef HAVE_MEMRCHR
#if defined(__GLIBC__) && ((__GLIBC__ > 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 2)))
#define HAVE_MEMRCHR
#endif
#endif

#ifndef HAVE_MEMRCHR
inline void* memrchr(const void* s, int c, size_t n) {
const unsigned char* p = (const unsigned char*) s;
for (p += n; n > 0; n--) {
Expand Down

0 comments on commit 37529e6

Please sign in to comment.