Merge branch 'master' of git://factorcode.org/git/factor

db4
Eduardo Cavazos 2008-03-14 10:54:35 -06:00
commit c8e550edca
7 changed files with 25 additions and 9 deletions

View File

@ -46,10 +46,10 @@ DLL_OBJS = $(PLAF_DLL_OBJS) \
EXE_OBJS = $(PLAF_EXE_OBJS)
default: misc/wordsize
make `./misc/target`
$(MAKE) `./misc/target`
help:
@echo "Run 'make' with one of the following parameters:"
@echo "Run '$(MAKE)' with one of the following parameters:"
@echo ""
@echo "freebsd-x86-32"
@echo "freebsd-x86-64"

View File

@ -301,6 +301,12 @@ define-builtin
"f" "syntax" lookup builtins get remove [ ] subset f union-class
define-class
"f" "syntax" create [ not ] "predicate" set-word-prop
"f?" "syntax" create "syntax" vocab-words delete-at
"general-t" "kernel" create [ ] "predicate" set-word-prop
"general-t?" "kernel" create "syntax" vocab-words delete-at
! Catch-all class for providing a default method.
"object" "kernel" create [ drop t ] "predicate" set-word-prop
"object" "kernel" create

View File

@ -4,7 +4,7 @@ IN: io.mmap.tests
[ "mmap-test-file.txt" resource-path delete-file ] ignore-errors
[ ] [ "12345" "mmap-test-file.txt" resource-path ascii set-file-contents ] unit-test
[ ] [ "mmap-test-file.txt" resource-path dup file-info file-info-length [ CHAR: 2 0 pick set-nth drop ] with-mapped-file ] unit-test
[ ] [ "mmap-test-file.txt" resource-path dup file-info file-info-size [ CHAR: 2 0 pick set-nth drop ] with-mapped-file ] unit-test
[ 5 ] [ "mmap-test-file.txt" resource-path dup file-info file-info-size [ length ] with-mapped-file ] unit-test
[ "22345" ] [ "mmap-test-file.txt" resource-path ascii file-contents ] unit-test
[ "mmap-test-file.txt" resource-path delete-file ] ignore-errors

View File

@ -1,5 +1,5 @@
IN: io.unix.freebsd
USING: io.unix.bsd io.backend core-foundation.fsevents ;
USING: io.unix.bsd io.backend ;
TUPLE: freebsd-io ;

View File

@ -88,7 +88,7 @@ M: string b, ( n string -- ) heap-size b, ;
read [ zero? ] right-trim dup empty? [ drop f ] when ;
: (read-128-ber) ( n -- n )
1 read first
read1
[ >r 7 shift r> 7 clear-bit bitor ] keep
7 bit? [ (read-128-ber) ] when ;

9
extra/unix/types/freebsd/freebsd.factor Normal file → Executable file
View File

@ -2,6 +2,10 @@ USING: alien.syntax ;
IN: unix.types
! FreeBSD 7 x86.32
! Need to verify on 64-bit
TYPEDEF: ushort __uint16_t
TYPEDEF: uint __uint32_t
TYPEDEF: int __int32_t
@ -16,4 +20,7 @@ TYPEDEF: __uint32_t gid_t
TYPEDEF: __int64_t off_t
TYPEDEF: __int64_t blkcnt_t
TYPEDEF: __uint32_t blksize_t
TYPEDEF: __uint32_t fflags_t
TYPEDEF: __uint32_t fflags_t
TYPEDEF: int ssize_t
TYPEDEF: int pid_t
TYPEDEF: int time_t

View File

@ -1,6 +1,9 @@
#!/bin/bash
#!/bin/sh
if [ \( `uname -s` = Darwin \) -a \( `uname -p` = powerpc \) ]
if [ \( `uname -s ` = FreeBSD \) -a \( `uname -p` = i386 \) ]
then
echo freebsd-x86-32
elif [ \( `uname -s` = Darwin \) -a \( `uname -p` = powerpc \) ]
then
echo macosx-ppc
elif [ `uname -s` = Darwin ]
@ -17,4 +20,4 @@ then
echo winnt-x86-`./misc/wordsize`
else
echo help
fi
fi