forked from elliotchance/c2go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
string.go
41 lines (34 loc) · 1.39 KB
/
string.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package darwin
import (
"github.com/elliotchance/c2go/noarch"
)
// BuiltinStrcpy is for __builtin___strcpy_chk.
// https://opensource.apple.com/source/Libc/Libc-498/include/secure/_string.h
func BuiltinStrcpy(dest, src []byte, size int32) []byte {
return noarch.Strcpy(dest, src)
}
// BuiltinObjectSize is for __builtin_object_size.
// https://github.com/elliotchance/c2go/issues/359
func BuiltinObjectSize(ptr []byte, theType int32) int32 {
return 5
}
// BuiltinStrncpy is for __builtin___strncpy_chk.
// https://opensource.apple.com/source/Libc/Libc-498/include/secure/_string.h
func BuiltinStrncpy(dest, src []byte, len, size int32) []byte {
return noarch.Strncpy(dest, src, len)
}
// BuiltinStrcat is for __builtin___strcat_chk
// https://opensource.apple.com/source/Libc/Libc-763.12/include/secure/_string.h.auto.html
func BuiltinStrcat(dest, src []byte, _ int32) []byte {
return noarch.Strcat(dest, src)
}
// Memset is for __builtin___memset_chk
// https://opensource.apple.com/source/Libc/Libc-498/include/secure/_string.h
func Memset(dst interface{}, val int32, size int32, _ int32) interface{} {
return noarch.Memset(dst, val, size)
}
// Memcpy is for __builtin___memcpy_chk and __builtin___memmove_chk
//// https://opensource.apple.com/source/Libc/Libc-498/include/secure/_string.h
func Memcpy(dst interface{}, src interface{}, size int32, _ int32) interface{} {
return noarch.Memcpy(dst, src, size)
}