ikrt_last_errno moved to ikarus-runtime where it belongs

This commit is contained in:
Abdulaziz Ghuloum 2008-11-26 05:03:16 -05:00
parent d88babf935
commit d35f039ca1
5 changed files with 12 additions and 11 deletions

View File

@ -1 +1 @@
1693
1694

View File

@ -224,6 +224,9 @@ ikptr ik_safe_alloc(ikpcb* pcb, int size);
ikptr u_to_number(unsigned long, ikpcb*);
ikptr ull_to_number(unsigned long long, ikpcb*);
ikptr normalize_bignum(long int limbs, int sign, ikptr r);
ikptr s_to_number(signed long x, ikpcb* pcb);
ikptr d_to_number(double x, ikpcb* pcb);
ikptr make_pointer(long x, ikpcb* pcb);
#define IK_HEAP_EXT_SIZE (32 * 4096)
#define IK_HEAPSIZE (1024 * ((wordsize==4)?1:2) * 4096) /* 4/8 MB */

View File

@ -139,10 +139,6 @@ scheme_to_ffi_value_cast(ffi_type* t, ikptr nptr, ikptr p, void* r) {
}
extern ikptr u_to_number(unsigned long x, ikpcb* pcb);
extern ikptr s_to_number(signed long x, ikpcb* pcb);
extern ikptr d_to_number(double x, ikpcb* pcb);
extern ikptr make_pointer(void* x, ikpcb* pcb);
static ikptr
ffi_to_scheme_value_cast(int n, void* p, ikpcb* pcb) {
switch (n & 0xF) {
@ -157,7 +153,7 @@ ffi_to_scheme_value_cast(int n, void* p, ikpcb* pcb) {
case 9: return s_to_number(*((signed long*)p), pcb);
case 10: return d_to_number(*((float*)p), pcb);
case 11: return d_to_number(*((double*)p), pcb);
case 12: return make_pointer(*((void**)p), pcb);
case 12: return make_pointer((long)*((void**)p), pcb);
default:
fprintf(stderr, "INVALID ARG %d", n);
exit(-1);
@ -362,10 +358,7 @@ ikrt_ffi_call(ikptr data, ikptr argsvec, ikpcb* pcb) {
return val;
}
ikptr
ikrt_last_errno(ikpcb* pcb){
return s_to_number(pcb->last_errno, pcb);
}
/*

View File

@ -37,7 +37,7 @@ ikrt_pointer_to_int(ikptr x, ikpcb* pcb) {
}
ikptr
make_pointer(long int x, ikpcb* pcb) {
make_pointer(long x, ikpcb* pcb) {
ikptr r = ik_safe_alloc(pcb, pointer_size);
ref(r, 0) = pointer_tag;
ref(r, wordsize) = (ikptr)x;

View File

@ -1096,3 +1096,8 @@ ikrt_rename_file(ikptr src, ikptr dst /* ikpcb* pcb */){
return ik_errno_to_code();
}
}
ikptr
ikrt_last_errno(ikpcb* pcb){
return s_to_number(pcb->last_errno, pcb);
}