Pārlūkot izejas kodu

4.3BSD says that bcopy and bzero are defined in strings.h, not string.h

tags/v0.9.3
Michael Brown 18 gadus atpakaļ
vecāks
revīzija
1a0ca661c2
2 mainītis faili ar 11 papildinājumiem un 1 dzēšanām
  1. 0
    1
      src/include/string.h
  2. 11
    0
      src/include/strings.h

+ 0
- 1
src/include/string.h Parādīt failu

@@ -59,7 +59,6 @@ char * strpbrk(const char * cs,const char * ct);
59 59
 char * strtok(char * s,const char * ct);
60 60
 char * strsep(char **s, const char *ct);
61 61
 void * memset(void * s,int c,size_t count);
62
-char * bcopy(const char * src, char * dest, int count);
63 62
 void * memmove(void * dest,const void *src,size_t count);
64 63
 int __attribute__ (( pure )) memcmp(const void * cs,const void * ct,
65 64
 				    size_t count);

+ 11
- 0
src/include/strings.h Parādīt failu

@@ -2,6 +2,7 @@
2 2
 #define _STRINGS_H
3 3
 
4 4
 #include <limits.h>
5
+#include <string.h>
5 6
 
6 7
 static inline __attribute__ (( always_inline )) int
7 8
 __constant_flsl ( unsigned long x ) {
@@ -53,4 +54,14 @@ extern int __flsl ( long x );
53 54
 
54 55
 extern int strcasecmp ( const char *s1, const char *s2 );
55 56
 
57
+static inline __attribute__ (( always_inline )) void
58
+bcopy ( const void *src, void *dest, size_t n ) {
59
+	memmove ( dest, src, n );
60
+}
61
+
62
+static inline __attribute__ (( always_inline )) void
63
+bzero ( void *s, size_t n ) {
64
+	memset ( s, 0, n );
65
+}
66
+
56 67
 #endif /* _STRINGS_H */

Notiek ielāde…
Atcelt
Saglabāt