mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-27 11:13:24 +02:00
29 lines
794 B
Diff
29 lines
794 B
Diff
diff --git a/dos/string.h b/dos/string.h
|
|
index f648de2d..407d0233 100644
|
|
--- a/dos/string.h
|
|
+++ b/dos/string.h
|
|
@@ -5,12 +5,22 @@
|
|
#ifndef _STRING_H
|
|
#define _STRING_H
|
|
|
|
+#include <stddef.h>
|
|
+
|
|
/* Standard routines */
|
|
#define memcpy(a,b,c) __builtin_memcpy(a,b,c)
|
|
#define memmove(a,b,c) __builtin_memmove(a,b,c)
|
|
#define memset(a,b,c) __builtin_memset(a,b,c)
|
|
#define strcpy(a,b) __builtin_strcpy(a,b)
|
|
-#define strlen(a) __builtin_strlen(a)
|
|
+#define strlen(a) inline_strlen(a)
|
|
+
|
|
+/* replacement for builtin strlen that appears to get optimized away */
|
|
+static inline size_t inline_strlen(const char *str)
|
|
+{
|
|
+ size_t l;
|
|
+ for (l = 0; *str++; l++);
|
|
+ return l;
|
|
+}
|
|
|
|
/* This only returns true or false */
|
|
static inline int memcmp(const void *__m1, const void *__m2, unsigned int __n)
|