[agent/codex:gpt-5.3-codex-spark] Read docs/RFC.md fully. Find ONE feature described in the sp... #21

Merged
Virgil merged 1 commit from main into dev 2026-04-03 19:34:05 +00:00
3 changed files with 38 additions and 0 deletions

View file

@ -169,6 +169,14 @@ func TestCallSupportsCommonCIntegerTypes(t *testing.T) {
}
}
func TestCallSupportsCUintptrArgument(t *testing.T) {
t.Parallel()
if err := callSupportsCUintptrArgument(); err != nil {
t.Fatalf("expected success, got %v", err)
}
}
func TestErrnoMapping(t *testing.T) {
t.Parallel()

View file

@ -82,6 +82,10 @@ int call_c_types_arguments(long a0, unsigned long a1, long long a2, unsigned lon
return 13;
}
int call_uintptr_argument(uintptr_t value) {
return value == 42 ? 0 : 13;
}
uintptr_t call_sum_length_ptr(void) {
return (uintptr_t)&call_sum_length;
}
@ -130,6 +134,10 @@ uintptr_t call_c_types_arguments_ptr(void) {
return (uintptr_t)&call_c_types_arguments;
}
uintptr_t call_uintptr_argument_ptr(void) {
return (uintptr_t)&call_uintptr_argument;
}
*/
import "C"
@ -195,6 +203,11 @@ func callCTypeArgumentFunction() unsafe.Pointer {
return *(*unsafe.Pointer)(unsafe.Pointer(&function))
}
func callCUintptrArgumentFunction() unsafe.Pointer {
function := C.call_uintptr_argument_ptr()
return *(*unsafe.Pointer)(unsafe.Pointer(&function))
}
func callWithErrnoZero() (int, error) {
return WithErrno(func() C.int {
return 0
@ -210,3 +223,7 @@ func callWithErrnoFailure() (int, error) {
func callSupportsCIntegerArguments() error {
return Call(callCTypeArgumentFunction(), C.long(10), C.ulong(11), C.longlong(12), C.ulonglong(13))
}
func callSupportsCUintptrArgument() error {
return Call(callCUintptrArgumentFunction(), C.uintptr_t(42))
}

View file

@ -94,6 +94,7 @@ int cgo_call_16(uintptr_t fn, uintptr_t a0, uintptr_t a1, uintptr_t a2, uintptr_
import "C"
import (
"reflect"
"strconv"
"syscall"
"unsafe"
@ -805,6 +806,18 @@ func toSyscallArg(value interface{}) (uintptr, bool) {
case uint64:
return uintptr(typed), true
default:
reflected := reflect.ValueOf(value)
switch reflected.Kind() {
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
return uintptr(reflected.Int()), true
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
return uintptr(reflected.Uint()), true
case reflect.Bool:
if reflected.Bool() {
return 1, true
}
return 0, true
}
return 0, false
}
}