]> gitweb.factorcode.org Git - factor.git/commitdiff
alien.c-types: move definitions of stdint.h from unix.types.
authorJohn Benediktsson <mrjbq7@gmail.com>
Wed, 24 Dec 2014 03:40:21 +0000 (19:40 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Wed, 24 Dec 2014 03:40:21 +0000 (19:40 -0800)
basis/alien/c-types/c-types.factor
basis/unix/types/types.factor

index f65080046b56547532babe2e031f752d47b77d53..4e0e4c111f97e41a8b7409e03c35fd2f378ad52a 100644 (file)
@@ -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
         <c-type>
             fixnum >>class
@@ -404,7 +404,7 @@ M: pointer lookup-c-type
             "to_fixnum" >>unboxer
             [ >integer ] >>unboxer-quot
         \ int typedef
-    
+
         ! 32bit-vm uint
         <c-type>
             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 ;
index 704dd7b7519fb049f80662d825618cb1f102494b..c77a9749a1444aecc4c3624fd078bd692653b814 100644 (file)
@@ -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