From 56b95b09a1b506175c753d54cd4a9574934ef0e4 Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Tue, 23 Dec 2014 19:40:21 -0800 Subject: [PATCH] alien.c-types: move definitions of stdint.h from unix.types. --- basis/alien/c-types/c-types.factor | 20 +++++++++++++++----- basis/unix/types/types.factor | 12 +----------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/basis/alien/c-types/c-types.factor b/basis/alien/c-types/c-types.factor index f65080046b..4e0e4c111f 100644 --- a/basis/alien/c-types/c-types.factor +++ b/basis/alien/c-types/c-types.factor @@ -62,7 +62,6 @@ M: word lookup-c-type dup "c-type" word-prop resolve-typedef [ ] [ no-c-type ] ?if ; - GENERIC: c-type-class ( name -- class ) M: abstract-c-type c-type-class class>> ; @@ -139,7 +138,7 @@ MACRO: set-alien-value ( c-type -- quot: ( value c-ptr offset -- ) ) : set-alien-element ( value n c-ptr c-type -- ) array-accessor set-alien-value ; inline -PROTOCOL: c-type-protocol +PROTOCOL: c-type-protocol c-type-class c-type-boxed-class c-type-boxer-quot @@ -176,7 +175,8 @@ TUPLE: long-long-type < c-type ; SYMBOLS: ptrdiff_t intptr_t uintptr_t size_t - c-string ; + c-string int8_t uint8_t int16_t uint16_t + int32_t uint32_t int64_t uint64_t ; CONSTANT: primitive-types { @@ -332,7 +332,7 @@ M: pointer lookup-c-type "to_signed_4" >>unboxer [ >fixnum ] >>unboxer-quot \ int typedef - + ! 64bit-vm uint fixnum >>class @@ -404,7 +404,7 @@ M: pointer lookup-c-type "to_fixnum" >>unboxer [ >integer ] >>unboxer-quot \ int typedef - + ! 32bit-vm uint integer >>class @@ -462,6 +462,16 @@ M: pointer lookup-c-type object >>boxed-class \ bool typedef + \ char lookup-c-type int8_t typedef + \ short lookup-c-type int16_t typedef + \ int lookup-c-type int32_t typedef + \ longlong lookup-c-type int64_t typedef + + \ uchar lookup-c-type uint8_t typedef + \ ushort lookup-c-type uint16_t typedef + \ uint lookup-c-type uint32_t typedef + \ ulonglong lookup-c-type uint64_t typedef + ] with-compilation-unit M: char-16-rep rep-component-type drop char ; diff --git a/basis/unix/types/types.factor b/basis/unix/types/types.factor index 704dd7b751..c77a9749a1 100644 --- a/basis/unix/types/types.factor +++ b/basis/unix/types/types.factor @@ -2,16 +2,6 @@ USING: accessors alien.c-types alien.syntax system vocabs ; FROM: sequences => append ; IN: unix.types -TYPEDEF: char int8_t -TYPEDEF: short int16_t -TYPEDEF: int int32_t -TYPEDEF: longlong int64_t - -TYPEDEF: uchar uint8_t -TYPEDEF: ushort uint16_t -TYPEDEF: uint uint32_t -TYPEDEF: ulonglong uint64_t - TYPEDEF: uchar u_int8_t TYPEDEF: ushort u_int16_t TYPEDEF: uint u_int32_t @@ -32,7 +22,7 @@ TYPEDEF: uint in_addr_t TYPEDEF: uint socklen_t TYPEDEF: __uint64_t fsblkcnt_t -TYPEDEF: fsblkcnt_t __fsblkcnt_t +TYPEDEF: fsblkcnt_t __fsblkcnt_t TYPEDEF: __uint64_t fsfilcnt_t TYPEDEF: fsfilcnt_t __fsfilcnt_t TYPEDEF: __uint64_t rlim_t