forked from elliotchance/c2go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
string.go
27 lines (22 loc) · 907 Bytes
/
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
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 int) []byte {
return noarch.Strcpy(dest, src)
}
// BuiltinObjectSize is for __builtin_object_size.
// https://github.com/elliotchance/c2go/issues/359
func BuiltinObjectSize(ptr []byte, theType int) int {
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 int) []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, _ int) []byte {
return noarch.Strcat(dest, src)
}