Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1diff --git a/dos/string.h b/dos/string.h 2index f648de2..a502132 100644 3--- a/dos/string.h 4+++ b/dos/string.h 5@@ -5,12 +5,13 @@ 6 #ifndef _STRING_H 7 #define _STRING_H 8 9+#include <stddef.h> 10+ 11 /* Standard routines */ 12 #define memcpy(a,b,c) __builtin_memcpy(a,b,c) 13 #define memmove(a,b,c) __builtin_memmove(a,b,c) 14 #define memset(a,b,c) __builtin_memset(a,b,c) 15 #define strcpy(a,b) __builtin_strcpy(a,b) 16-#define strlen(a) __builtin_strlen(a) 17 18 /* This only returns true or false */ 19 static inline int memcmp(const void *__m1, const void *__m2, unsigned int __n) 20@@ -21,6 +22,13 @@ static inline int memcmp(const void *__m1, const void *__m2, unsigned int __n) 21 return rv; 22 } 23 24+static inline size_t strlen(const char *s) 25+{ 26+ size_t len = 0; 27+ while (*s++) len++; 28+ return len; 29+} 30+ 31 extern char *strchr(const char *s, int c); 32 33 #endif /* _STRING_H */