factor: << -> COMPILE<

fix modern parser bug
locals-and-roots
Doug Coleman 2016-06-13 16:48:59 -07:00
parent f5c8ee91b1
commit f51e1a50f9
217 changed files with 492 additions and 485 deletions

View File

@ -7,7 +7,7 @@ math.vectors math.vectors.simd math.vectors.simd.cords
math.parser make sequences words combinators ;
in: benchmark.raytracer-simd
<< SYNTAX: no-compile last-word t "no-compile" set-word-prop ; >>
COMPILE< SYNTAX: no-compile last-word t "no-compile" set-word-prop ; COMPILE>
! parameters

View File

@ -2,11 +2,11 @@ USING: io io.encodings.ascii io.files io.files.temp math
math.parser kernel sequences ;
in: benchmark.sum-file
<<
COMPILE<
"sum-file.txt" temp-file ascii [
100000 iota [ number>string print ] each
] with-file-writer
>>
COMPILE>
: sum-file ( file -- n )
ascii [ 0 [ string>number + ] each-line ] with-file-reader ;

View File

@ -5,7 +5,7 @@ sequences.private growable bit-arrays prettyprint.custom
parser accessors vectors.functor classes.parser ;
in: bit-vectors
<< "bit-vector" create-class-in \ bit-array \ <bit-array> define-vector >>
COMPILE< "bit-vector" create-class-in \ bit-array \ <bit-array> define-vector COMPILE>
SYNTAX: \ ?V{ \ } [ >bit-vector ] parse-literal ;

View File

@ -16,7 +16,7 @@ ERROR: bad-length bytes n ;
: check-length ( bytes n -- bytes n )
2dup [ length ] dip > [ bad-length ] when ; inline
<<
COMPILE<
: be-range ( n -- range )
1 - 8 * 0 -8 <range> ; inline
@ -30,7 +30,7 @@ ERROR: bad-length bytes n ;
MACRO: reassemble-be ( n -- quot ) be-range reassemble-bytes ;
MACRO: reassemble-le ( n -- quot ) le-range reassemble-bytes ;
>>
COMPILE>
:: n-be> ( bytes n -- x )
bytes n check-length drop n firstn-unsafe n reassemble-be ; inline

View File

@ -3,6 +3,6 @@
USING: layouts kernel parser math math.bitwise sequences ;
in: persistent.hashtables.config
: radix-bits ( -- n ) << cell 4 = 4 5 ? suffix! >> ; foldable
CONSTANT: radix-bits $[ cell 4 = 4 5 ? ]
: radix-mask ( -- n ) radix-bits on-bits ; foldable
: full-bitmap-mask ( -- n ) radix-bits 2^ on-bits ; inline

View File

@ -12,7 +12,7 @@ tools.test kernel locals namespaces random math.ranges sequences fry ;
! We have to define these first so that they're compiled before
! the below hashtables are parsed...
<<
COMPILE<
TUPLE: hash-0-a ;
@ -22,7 +22,7 @@ TUPLE: hash-0-b ;
M: hash-0-b hashcode* 2drop 0 ;
>>
COMPILE>
{ } [
PH{ }

View File

@ -132,7 +132,7 @@ TUPLE: sequence-parser sequence n ;
sequence-parser [ n + ] change-n drop
] if ;
<< "length" [ length ] define-sorting >>
COMPILE< "length" [ length ] define-sorting COMPILE>
: sort-tokens ( seq -- seq' )
{ length>=< <=> } sort-by ;

View File

@ -8,9 +8,9 @@ PRIVATE<
: (unrolled-each-integer) ( quot n -- )
swap '[ _ call( i -- ) ] each-integer ;
<< \ (unrolled-each-integer) [
COMPILE< \ (unrolled-each-integer) [
iota [ '[ _ swap call( i -- ) ] ] [ ] map-as '[ _ cleave ]
] 1 define-partial-eval >>
] 1 define-partial-eval COMPILE>
: (unrolled-collect) ( quot into -- quot' )
'[ dup @ swap _ set-nth-unsafe ] ; inline

View File

@ -2,29 +2,29 @@ auto-use
in: syntax
use: delegate.private
<< forget: postpone\ MACRO: >>
<< forget: postpone\ MACRO:: >>
<< forget: postpone\ MEMO: >>
<< forget: postpone\ MEMO:: >>
<< forget: postpone\ M:: >>
<< forget: postpone\ IDENTITY-MEMO: >>
<< forget: postpone\ IDENTITY-MEMO:: >>
<< forget: postpone\ TYPED: >>
<< forget: postpone\ TYPED:: >>
COMPILE< forget: postpone\ MACRO: COMPILE>
COMPILE< forget: postpone\ MACRO:: COMPILE>
COMPILE< forget: postpone\ MEMO: COMPILE>
COMPILE< forget: postpone\ MEMO:: COMPILE>
COMPILE< forget: postpone\ M:: COMPILE>
COMPILE< forget: postpone\ IDENTITY-MEMO: COMPILE>
COMPILE< forget: postpone\ IDENTITY-MEMO:: COMPILE>
COMPILE< forget: postpone\ TYPED: COMPILE>
COMPILE< forget: postpone\ TYPED:: COMPILE>
<< forget: postpone\ '[ >>
<< forget: postpone\ :: >>
<< forget: postpone\ :> >>
<< forget: _ >>
<< forget: @ >>
<< forget: postpone\ |[ >>
<< forget: postpone\ let[ >>
<< forget: postpone\ IH{ >>
<< forget: postpone\ PROTOCOL: >>
<< forget: postpone\ CONSULT: >>
<< forget: postpone\ BROADCAST: >>
<< forget: postpone\ SLOT-PROTOCOL: >>
<< forget: postpone\ HINTS: >>
COMPILE< forget: postpone\ '[ COMPILE>
COMPILE< forget: postpone\ :: COMPILE>
COMPILE< forget: postpone\ :> COMPILE>
COMPILE< forget: _ COMPILE>
COMPILE< forget: @ COMPILE>
COMPILE< forget: postpone\ |[ COMPILE>
COMPILE< forget: postpone\ let[ COMPILE>
COMPILE< forget: postpone\ IH{ COMPILE>
COMPILE< forget: postpone\ PROTOCOL: COMPILE>
COMPILE< forget: postpone\ CONSULT: COMPILE>
COMPILE< forget: postpone\ BROADCAST: COMPILE>
COMPILE< forget: postpone\ SLOT-PROTOCOL: COMPILE>
COMPILE< forget: postpone\ HINTS: COMPILE>

View File

@ -95,8 +95,8 @@ in: bootstrap.syntax
"{"
"}"
"CS{"
"<<"
">>"
"<<" ">>"
"COMPILE<" "COMPILE>"
"call-next-method"
"not{"
"maybe{"

View File

@ -811,7 +811,7 @@ TUPLE: rclasstest a b ;
{ f } [ \ rclasstest \ b>> ?lookup-method ] unit-test
{ f } [ \ rclasstest \ b<< ?lookup-method ] unit-test
<< \ rclasstest forget >>
COMPILE< \ rclasstest forget COMPILE>
! initial: should type check
TUPLE: initial-class ;

View File

@ -254,7 +254,7 @@ CONSTANT: case-const-2 2 ;
defer: corner-case-1
<< \ corner-case-1 2 [ + ] curry 1array [ case ] curry ( a -- b ) define-declared >>
COMPILE< \ corner-case-1 2 [ + ] curry 1array [ case ] curry ( a -- b ) define-declared COMPILE>
{ t } [ \ corner-case-1 word-optimized? ] unit-test

View File

@ -64,7 +64,7 @@ GENERIC: uncompiled-generic-test ( a -- b ) ;
M: integer uncompiled-generic-test 1 + ;
<< [ uncompiled-generic-test ] [ jit-compile ] [ suffix! ] bi >>
COMPILE< [ uncompiled-generic-test ] [ jit-compile ] [ suffix! ] bi COMPILE>
"q" set
{ 4 } [ 3 "q" get call ] unit-test

View File

@ -54,7 +54,7 @@ in: continuations.tests
: foo ( -- ) get-callstack "c" set don't-compile-me ;
: bar ( -- a b ) 1 foo 2 ;
<< { don't-compile-me foo bar } [ t "no-compile" set-word-prop ] each >>
COMPILE< { don't-compile-me foo bar } [ t "no-compile" set-word-prop ] each COMPILE>
{ 1 2 } [ bar ] unit-test

View File

@ -4,7 +4,7 @@ cpu.x86.assembler.operands help.markup help.syntax kernel layouts
literals math multiline sequences strings system vm words ;
in: cpu.architecture
<<
COMPILE<
STRING: ex-%allot
USING: cpu.architecture make ;
[ RAX 40 tuple RCX %allot ] B{ } make disassemble
@ -71,7 +71,7 @@ init-relocation [ RAX RBX 3 -14 RCX RDX %write-barrier ] B{ } make disassemble
000000000143f97c: 48ba0000000000000000 mov rdx, 0x0
000000000143f986: 48c60411c0 mov byte [rcx+rdx], 0xc0
;
>>
COMPILE>
HELP: %alien-invoke
{ $values

View File

@ -10,7 +10,7 @@ in: generalizations
! the input parameters, e.g. n.
! If math is done, the word needs to be a macro so the math can
! be done at compile-time.
<<
COMPILE<
ALIAS: n*quot (n*quot) ;
@ -19,7 +19,7 @@ MACRO: call-n ( n -- quot )
: repeat ( n obj quot -- ) swapd times ; inline
>>
COMPILE>
MACRO: nsum ( n -- quot )
1 - [ + ] n*quot ;

View File

@ -49,10 +49,10 @@ in: kernel.tests
: overflow-r ( -- ) 3 load-local overflow-r ;
<<
COMPILE<
{ overflow-d (overflow-d-alt) overflow-d-alt overflow-r }
[ t "no-compile" set-word-prop ] each
>>
COMPILE>
[ overflow-d ] [
2 head ${ KERNEL-ERROR ERROR-DATASTACK-OVERFLOW } =
@ -125,7 +125,7 @@ in: kernel.tests
! Doesn't compile; important
: foo ( a -- b ) ;
<< \ foo t "no-compile" set-word-prop >>
COMPILE< \ foo t "no-compile" set-word-prop COMPILE>
[ drop foo ] must-fail
{ } [ :c ] unit-test

View File

@ -36,13 +36,13 @@ symbol: header-bits
! We do this in its own compilation unit so that they can be
! folded below
<<
COMPILE<
: cell ( -- n ) OBJ-CELL-SIZE special-object ; foldable
: (fixnum-bits) ( m -- n ) tag-bits get - ; foldable
: (first-bignum) ( m -- n ) (fixnum-bits) 1 - 2^ ; foldable
>>
COMPILE>
: cells ( m -- n ) cell * ; inline

View File

@ -5,7 +5,7 @@ in: locals.parser.tests
! XXX: remove the << and >> below and make test-all pass
<<
COMPILE<
! (::)
{
"dobiedoo"
@ -26,7 +26,7 @@ in: locals.parser.tests
qualified-vocabs last words>> keys "um" swap member?
] with-compilation-unit
] unit-test
>>
COMPILE>
! check-local-name
{ "hello" } [
@ -58,7 +58,7 @@ in: locals.parser.tests
[ locals>> [ name>> ] map ] [ keys ] bi*
] unit-test
<<
COMPILE<
{
"V{ 99 :> kkk kkk }"
} [
@ -69,4 +69,4 @@ in: locals.parser.tests
] with-lexer
] with-compilation-unit unparse
] unit-test
>>
COMPILE>

View File

@ -31,7 +31,7 @@ in: modern.compiler
! over changed-definition
! swap def>> first swapd set-at
! ] with-definition ;
! >>
! COMPILE>
TUPLE: holder literal ;

View File

@ -8,7 +8,7 @@ quotations sequences sequences.extras splitting
splitting.monotonic strings unicode generalizations ;
in: modern
<<
COMPILE<
! Base rules, everything should have a generator macro
TUPLE: lexer generator ;
@ -52,7 +52,7 @@ TUPLE: right-decorator-literal < decorator-literal ;
TUPLE: compound-sequence-literal sequence ;
CONSTRUCTOR: <compound-sequence-literal> compound-sequence-literal ( sequence -- obj ) ;
>>
COMPILE>
GENERIC: lexed-underlying ( obj -- slice ) ;
M: f lexed-underlying ;
@ -132,7 +132,7 @@ M: array collapse-decorators
[ [ length 2 - ] keep [ char: \: = ] find-last-from ] keep
swap [ swap tail strict-upper? ] [ nip strict-upper? ] if
] [
drop t
"<" sequence= not
] if
] [
drop f
@ -406,13 +406,13 @@ PRIVATE>
[ make-tag-literal ]
} cond ;
<<
COMPILE<
: lexer-rules>delimiters ( seq -- string )
[ delimiter>> ] "" map-as ;
: lexer-rules>assoc ( seq -- seq' )
[ [ delimiter>> ] [ generator>> 1quotation ] bi ] { } map>assoc ;
>>
COMPILE>
! 0 "HI: ;" slice-til-either -> 3 "HI: ;" "HI:" CHAR: \:
MACRO: rules>call-lexer ( seq -- quot: ( top? n/f string -- top?' n'/f string literal ) )

View File

@ -539,7 +539,7 @@ EXCLUDE: qualified.tests.bar => x ;
! Two similar bugs
! Replace : def with something in << >>
! Replace : def with something in << COMPILE>
/* { [ ] } [
"in: parser.tests : was-once-a-word-bug ( -- ) ;"
<string-reader> "was-once-a-word-test" parse-stream

View File

@ -30,7 +30,7 @@ ARTICLE: "syntax-immediate" "Parse time evaluation"
"Code can be evaluated at parse time. This is a rarely-used feature; one use-case is " { $link "loading-libs" } ", where you want to execute some code before the words in a source file are compiled."
{ $subsections
\ <<
\ >>
\ COMPILE>
} ;
ARTICLE: "syntax-integers" "Integer syntax"
@ -870,7 +870,7 @@ HELP: <<
{ $description "Evaluates some code at parse time." }
{ $notes "Calling words defined in the same source file at parse time is prohibited; see compilation unit as where it was defined; see " { $link "compilation-units" } "." } ;
HELP: >>
HELP: COMPILE>
{ $syntax ">>" }
{ $description "Marks the end of a parse time code block." } ;

View File

@ -53,7 +53,7 @@ in: bootstrap.syntax
dup [ define-fry-specifier ] curry each ;
[
{ "]" "}" ";" ">>" } [ define-delimiter ] each
{ "]" "}" ";" ">>" "COMPILE>" } [ define-delimiter ] each
{ "_" "@" } define-fry-specifiers
! "@" [ "Only valid inside a fry" throw ] ( -- * ) define-fry-specifier
@ -320,6 +320,14 @@ in: bootstrap.syntax
] with-nested-compilation-unit call( -- )
] define-core-syntax
"COMPILE<" [
[
\ COMPILE> parse-until >quotation
] with-nested-compilation-unit call( -- )
] define-core-syntax
"call-next-method" [
current-method get [
literalize suffix!

View File

@ -1,7 +1,7 @@
USING: namespaces parser ;
in: vocabs.loader.test.a
<< global [ "count-me" inc ] with-variables >>
COMPILE< global [ "count-me" inc ] with-variables COMPILE>
: v-l-t-a-hello ( -- a ) 4 ;

View File

@ -1,6 +1,6 @@
USING: namespaces ;
in: vocabs.loader.test.b
<< global [ "count-me" inc ] with-variables >>
COMPILE< global [ "count-me" inc ] with-variables COMPILE>
: fred ( -- ) bob ;

View File

@ -196,7 +196,7 @@ FUNCTOR;"
}
{ $slide "Example of sorting functor"
{ $code "USING: sorting.functor ;
<< \"length\" [ length ] define-sorting >>"
COMPILE< \"length\" [ length ] define-sorting >>"
}
{ $code
"{ { 1 2 3 } { 1 2 } { 1 } }

View File

@ -4,14 +4,14 @@ USING: alien alien.libraries alien.syntax combinators
gobject-introspection kernel system vocabs ;
in: atk.ffi
<< "gobject.ffi" require >>
COMPILE< "gobject.ffi" require COMPILE>
library: atk
<< "atk" {
COMPILE< "atk" {
{ [ os windows? ] [ "libatk-1.0-0.dll" ] }
{ [ os macosx? ] [ "libatk-1.0.dylib" ] }
{ [ os unix? ] [ "libatk-1.0.so" ] }
} cond cdecl add-library >>
} cond cdecl add-library COMPILE>
gir: vocab:atk/Atk-1.0.gir

View File

@ -8,11 +8,11 @@ in: cairo.ffi
! Adapted from cairo.h, version 1.8.10
<< "cairo" {
COMPILE< "cairo" {
{ [ os windows? ] [ "libcairo-2.dll" ] }
{ [ os macosx? ] [ "libcairo.dylib" ] }
{ [ os unix? ] [ "libcairo.so" ] }
} cond cdecl add-library >>
} cond cdecl add-library COMPILE>
library: cairo

View File

@ -4,19 +4,19 @@ USING: alien alien.libraries alien.syntax combinators
gobject-introspection kernel system vocabs ;
in: clutter.cally.ffi
<<
COMPILE<
"atk.ffi" require
"clutter.ffi" require
>>
COMPILE>
library: clutter.cally
<<
COMPILE<
"clutter.cally" {
{ [ os windows? ] [ drop ] }
{ [ os macosx? ] [ drop ] }
{ [ os unix? ] [ "libclutter-glx-1.0.so" cdecl add-library ] }
} cond
>>
COMPILE>
gir: Cally-1.0.gir

View File

@ -4,19 +4,19 @@ USING: alien alien.libraries alien.syntax combinators
gobject-introspection kernel opengl.gl system vocabs ;
in: clutter.cogl.ffi
<<
COMPILE<
"gobject.ffi" require
>>
COMPILE>
library: clutter.cogl
<<
COMPILE<
"clutter.cogl" {
{ [ os windows? ] [ drop ] }
{ [ os macosx? ] [ drop ] }
{ [ os unix? ] [ "libclutter-glx-1.0.so" cdecl add-library ] }
} cond
>>
COMPILE>
FOREIGN-ATOMIC-TYPE: GL.uint GLuint ;
FOREIGN-ATOMIC-TYPE: GL.enum GLenum ;

View File

@ -4,23 +4,23 @@ USING: alien alien.libraries alien.syntax cairo.ffi combinators
gobject-introspection kernel system vocabs ;
in: clutter.ffi
<<
COMPILE<
"gtk" require
"atk.ffi" require
"pango.cairo.ffi" require
"clutter.cogl.ffi" require
"clutter.json.ffi" require
>>
COMPILE>
library: clutter
<<
COMPILE<
"clutter" {
{ [ os windows? ] [ drop ] }
{ [ os macosx? ] [ drop ] }
{ [ os unix? ] [ "libclutter-glx-1.0.so" cdecl add-library ] }
} cond
>>
COMPILE>
FOREIGN-RECORD-TYPE: cairo.Path cairo_path_t ;

View File

@ -4,19 +4,19 @@ USING: alien alien.libraries alien.syntax combinators
gobject-introspection kernel system vocabs ;
in: clutter.gtk.ffi
<<
COMPILE<
"clutter.ffi" require
"gtk.ffi" require
>>
COMPILE>
library: clutter.gtk
<<
COMPILE<
"clutter.gtk" {
{ [ os windows? ] [ drop ] }
{ [ os macosx? ] [ drop ] }
{ [ os unix? ] [ "libclutter-gtk-1.0.so" cdecl add-library ] }
} cond
>>
COMPILE>
gir: GtkClutter-1.0.gir

View File

@ -4,19 +4,19 @@ USING: alien alien.libraries alien.syntax combinators
gobject-introspection kernel system vocabs ;
in: clutter.json.ffi
<<
COMPILE<
"gobject.ffi" require
"gio.ffi" require
>>
COMPILE>
library: clutter.json
<<
COMPILE<
"clutter.json" {
{ [ os windows? ] [ drop ] }
{ [ os macosx? ] [ drop ] }
{ [ os unix? ] [ "libclutter-glx-1.0.so" cdecl add-library ] }
} cond
>>
COMPILE>
gir: Json-1.0.gir

View File

@ -6,7 +6,7 @@ FROM: alien.c-types => float ;
in: core-graphics.types
symbol: CGFloat
<< cell 4 = float double ? \ CGFloat typedef >>
COMPILE< cell 4 = float double ? \ CGFloat typedef COMPILE>
STRUCT: CGPoint
{ x CGFloat }

View File

@ -3,13 +3,13 @@ USING: accessors alien alien.c-types alien.libraries alien.syntax
classes.struct combinators kernel system ;
in: cuda.ffi
<<
COMPILE<
"cuda" {
{ [ os windows? ] [ "nvcuda.dll" stdcall ] }
{ [ os macosx? ] [ "/usr/local/cuda/lib/libcuda.dylib" cdecl ] }
{ [ os unix? ] [ "libcuda.so" cdecl ] }
} cond add-library
>>
COMPILE>
library: cuda
@ -28,14 +28,14 @@ TYPEDEF: void* CUgraphicsResource ;
SYMBOLS: CUdouble CUlonglong CUulonglong ;
<<
COMPILE<
: always-8-byte-align ( c-type -- c-type )
8 >>align 8 >>align-first ;
longlong lookup-c-type clone always-8-byte-align \ CUlonglong typedef
ulonglong lookup-c-type clone always-8-byte-align \ CUulonglong typedef
double lookup-c-type clone always-8-byte-align \ CUdouble typedef
>>
COMPILE>
STRUCT: CUuuid
{ bytes char[16] } ;

View File

@ -4,10 +4,10 @@ system words ;
in: curl.ffi
<< "curl" {
COMPILE< "curl" {
{ [ os macosx? ] [ "libcurl.dylib" ] }
{ [ os unix? ] [ "libcurl.so" ] }
} cond cdecl add-library >>
} cond cdecl add-library COMPILE>
library: curl

View File

@ -4,11 +4,11 @@ USING: accessors alien alien.c-types alien.libraries alien.libraries.finder
alien.syntax classes.struct combinators kernel math system unix.types ;
in: curses.ffi
<< "curses" {
COMPILE< "curses" {
{ [ os windows? ] [ "libcurses.dll" ] }
{ [ os macosx? ] [ "libcurses.dylib" ] }
{ [ os unix? ] [ "ncursesw" find-library ] }
} cond cdecl add-library >>
} cond cdecl add-library COMPILE>
c-type: SCREEN
TYPEDEF: void* va_list ;

View File

@ -8,11 +8,11 @@ in: fftw.ffi
library: fftw3
<< "fftw3" {
COMPILE< "fftw3" {
{ [ os windows? ] [ "libfftw3-3.dll" ] }
{ [ os macosx? ] [ "libfftw3.dylib" ] }
{ [ os unix? ] [ "libfftw3.so" ] }
} cond cdecl add-library >>
} cond cdecl add-library COMPILE>
TYPEDEF: double[2] fftw_complex ;

View File

@ -6,7 +6,7 @@ in: forestdb.ffi
! Functions with LIBFDB_API are exported.
<< "forestdb" dup find-library cdecl add-library >>
COMPILE< "forestdb" dup find-library cdecl add-library COMPILE>
library: forestdb

View File

@ -4,11 +4,11 @@ USING: alien alien.c-types alien.syntax kernel system combinators
alien.libraries classes.struct ;
in: freetype
<< "freetype" {
COMPILE< "freetype" {
{ [ os macosx? ] [ "/usr/X11R6/lib/libfreetype.6.dylib" cdecl add-library ] }
{ [ os windows? ] [ "freetype6.dll" cdecl add-library ] }
{ [ t ] [ drop ] }
} cond >>
} cond COMPILE>
library: freetype

View File

@ -4,9 +4,9 @@ USING: alien alien.c-types alien.libraries alien.libraries.finder
alien.syntax classes.struct combinators kernel system ;
in: gdbm.ffi
<< "libgdbm"
COMPILE< "libgdbm"
{ "gdbm" "gdbm3" "libgdbm-3" } find-library-from-list
cdecl add-library >>
cdecl add-library COMPILE>
library: libgdbm

View File

@ -6,20 +6,20 @@ gobject-introspection gobject-introspection.standard-types
kernel system vocabs vocabs.loader ;
in: gdk.ffi
<<
COMPILE<
"pango.ffi" require
"gdk.pixbuf.ffi" require
>>
COMPILE>
library: gdk
<<
COMPILE<
"gdk" {
{ [ os windows? ] [ "libgdk-win32-2.0-0.dll" cdecl add-library ] }
{ [ os macosx? ] [ drop ] }
{ [ os unix? ] [ "libgdk-x11-2.0.so" cdecl add-library ] }
} cond
>>
COMPILE>
! <workaround these types are from cairo 1.10
STRUCT: cairo_rectangle_int_t

View File

@ -4,18 +4,18 @@ USING: alien alien.libraries alien.syntax combinators
gobject-introspection kernel system vocabs vocabs.loader ;
in: gdk.gl.ffi
<<
COMPILE<
"gdk.ffi" require
>>
COMPILE>
library: gdk.gl
<<
COMPILE<
"gdk.gl" {
{ [ os windows? ] [ "libgdkglext-win32-1.0-0.dll" cdecl add-library ] }
{ [ os macosx? ] [ drop ] }
{ [ os unix? ] [ "libgdkglext-x11-1.0.so" cdecl add-library ] }
} cond
>>
COMPILE>
gir: vocab:gdk/gl/GdkGLExt-1.0.gir

View File

@ -6,15 +6,15 @@ gobject-introspection.standard-types kernel libc sequences
system vocabs ;
in: gdk.pixbuf.ffi
<< "gio.ffi" require >>
COMPILE< "gio.ffi" require COMPILE>
library: gdk.pixbuf
<< "gdk.pixbuf" {
COMPILE< "gdk.pixbuf" {
{ [ os windows? ] [ "libgdk_pixbuf-2.0-0.dll" ] }
{ [ os macosx? ] [ "libgdk_pixbuf-2.0.dylib" ] }
{ [ os unix? ] [ "libgdk_pixbuf-2.0.so" ] }
} cond cdecl add-library >>
} cond cdecl add-library COMPILE>
gir: vocab:gdk/pixbuf/GdkPixbuf-2.0.gir

View File

@ -4,14 +4,14 @@ USING: alien alien.libraries alien.syntax combinators
gobject-introspection kernel system vocabs ;
in: gio.ffi
<< "gobject.ffi" require >>
COMPILE< "gobject.ffi" require COMPILE>
library: gio
<< "gio" {
COMPILE< "gio" {
{ [ os windows? ] [ "libgio-2.0-0.dll" ] }
{ [ os macosx? ] [ "libgio-2.0.dylib" ] }
{ [ os unix? ] [ "libgio-2.0.so" ] }
} cond cdecl add-library >>
} cond cdecl add-library COMPILE>
gir: vocab:gio/Gio-2.0.gir

View File

@ -8,11 +8,11 @@ in: glib.ffi
library: glib
<< "glib" {
COMPILE< "glib" {
{ [ os windows? ] [ "libglib-2.0-0.dll" ] }
{ [ os macosx? ] [ "libglib-2.0.0.dylib" ] }
{ [ os unix? ] [ "libglib-2.0.so" ] }
} cond cdecl add-library >>
} cond cdecl add-library COMPILE>
IMPLEMENT-STRUCTS: GError GPollFD GSource GSourceFuncs ;

View File

@ -4,14 +4,14 @@ USING: alien alien.libraries alien.syntax combinators
gobject-introspection kernel system vocabs ;
in: gmodule.ffi
<< "glib.ffi" require >>
COMPILE< "glib.ffi" require COMPILE>
library: gmodule
<< "gmodule" {
COMPILE< "gmodule" {
{ [ os windows? ] [ "libgmodule-2.0-0.dll" ] }
{ [ os macosx? ] [ "libgmodule-2.0.dylib" ] }
{ [ os unix? ] [ "libgmodule-2.0.so" ] }
} cond cdecl add-library >>
} cond cdecl add-library COMPILE>
gir: vocab:gmodule/GModule-2.0.gir

View File

@ -4,7 +4,7 @@ tools.test ;
in: gobject-introspection.ffi.tests
! callback
<<
COMPILE<
{
T{ return
@ -31,4 +31,4 @@ in: gobject-introspection.ffi.tests
"none" f simple-type boa "none" return boa return-c-type
] unit-test
>>
COMPILE>

View File

@ -4,7 +4,7 @@ USING: accessors alien.c-types alien.syntax
classes.struct gobject-introspection.types kernel parser ;
in: gobject-introspection.standard-types
<<
COMPILE<
TYPEDEF: char gchar ;
TYPEDEF: uchar guchar ;
TYPEDEF: short gshort ;
@ -41,7 +41,7 @@ int lookup-c-type clone
"gboolean" create-word-in typedef
STRUCT: longdouble { data char[10] } ;
>>
COMPILE>
gchar "gchar" register-standard-type
guchar "guchar" register-standard-type

View File

@ -103,10 +103,10 @@ ERROR: unknown-type-error type ;
ERROR: deferred-type-error ;
<<
COMPILE<
void* lookup-c-type clone
[ drop deferred-type-error ] >>unboxer-quot
[ drop deferred-type-error ] >>boxer-quot
object >>boxed-class
"deferred-type" create-word-in typedef
>>
COMPILE>

View File

@ -6,16 +6,16 @@ in: gobject.ffi
! these two are needed for the definition of GError and others.
! otherwise we generate GError and some others in this vocab as well.
<< "glib.ffi" require >>
COMPILE< "glib.ffi" require COMPILE>
use: glib.ffi
library: gobject
<< "gobject" {
COMPILE< "gobject" {
{ [ os windows? ] [ "libgobject-2.0-0.dll" ] }
{ [ os macosx? ] [ "libgobject-2.0.dylib" ] }
{ [ os unix? ] [ "libgobject-2.0.so" ] }
} cond cdecl add-library >>
} cond cdecl add-library COMPILE>
IMPLEMENT-STRUCTS: GValue GParamSpecVariant ;

View File

@ -4,18 +4,18 @@ USING: alien alien.libraries alien.syntax combinators
gobject-introspection kernel system vocabs ;
in: gstreamer.base.ffi
<<
COMPILE<
"gstreamer.ffi" require
>>
COMPILE>
library: gstreamer.base
<<
COMPILE<
"gstreamer.base" {
{ [ os windows? ] [ drop ] }
{ [ os macosx? ] [ drop ] }
{ [ os unix? ] [ "libgstbase-0.10.so" cdecl add-library ] }
} cond
>>
COMPILE>
gir: GstBase-0.10.gir

View File

@ -4,18 +4,18 @@ USING: alien alien.libraries alien.syntax combinators
gobject-introspection kernel system vocabs ;
in: gstreamer.controller.ffi
<<
COMPILE<
"gstreamer.ffi" require
>>
COMPILE>
library: gstreamer.controller
<<
COMPILE<
"gstreamer.controller" {
{ [ os windows? ] [ drop ] }
{ [ os macosx? ] [ drop ] }
{ [ os unix? ] [ "libgstcontroller-0.10.so" cdecl add-library ] }
} cond
>>
COMPILE>
gir: GstController-0.10.gir

View File

@ -4,21 +4,21 @@ USING: alien alien.c-types alien.libraries alien.syntax combinators
gobject-introspection kernel system vocabs ;
in: gstreamer.ffi
<<
COMPILE<
"glib.ffi" require
"gobject.ffi" require
"gmodule.ffi" require
>>
COMPILE>
library: gstreamer
<<
COMPILE<
"gstreamer" {
{ [ os windows? ] [ drop ] }
{ [ os macosx? ] [ drop ] }
{ [ os unix? ] [ "libgstreamer-0.10.so" cdecl add-library ] }
} cond
>>
COMPILE>
PRIVATE<

View File

@ -4,18 +4,18 @@ USING: alien alien.libraries alien.syntax combinators
gobject-introspection kernel system vocabs ;
in: gstreamer.net.ffi
<<
COMPILE<
"gstreamer.ffi" require
>>
COMPILE>
library: gstreamer.net
<<
COMPILE<
"gstreamer.net" {
{ [ os windows? ] [ drop ] }
{ [ os macosx? ] [ drop ] }
{ [ os unix? ] [ "libgstnet-0.10.so" cdecl add-library ] }
} cond
>>
COMPILE>
gir: GstNet-0.10.gir

View File

@ -6,20 +6,20 @@ gobject-introspection.standard-types kernel pango.ffi system
vocabs ;
in: gtk.ffi
<<
COMPILE<
"atk.ffi" require
"gdk.ffi" require
>>
COMPILE>
library: gtk
<<
COMPILE<
"gtk" {
{ [ os windows? ] [ "libgtk-win32-2.0-0.dll" cdecl add-library ] }
{ [ os linux? ] [ "libgtk-x11-2.0.so" cdecl add-library ] }
[ drop ]
} cond
>>
COMPILE>
IMPLEMENT-STRUCTS: GtkTreeIter ;

View File

@ -4,19 +4,19 @@ USING: alien alien.libraries alien.syntax combinators
gobject-introspection kernel system vocabs ;
in: gtk.gl.ffi
<<
COMPILE<
"gtk.ffi" require
"gdk.gl.ffi" require
>>
COMPILE>
library: gtk.gl
<<
COMPILE<
"gtk.gl" {
{ [ os windows? ] [ drop ] }
{ [ os macosx? ] [ drop ] }
{ [ os unix? ] [ "libgtkglext-x11-1.0.so" cdecl add-library ] }
} cond
>>
COMPILE>
gir: vocab:gtk/gl/GtkGLExt-1.0.gir

View File

@ -3,11 +3,11 @@ core-foundation.bundles core-foundation.dictionaries system
combinators kernel sequences io accessors unix.types ;
in: iokit
<<
COMPILE<
os macosx?
[ "/System/Library/Frameworks/IOKit.framework" load-framework ]
when
>>
COMPILE>
CONSTANT: kIOKitBuildVersionKey "IOKitBuildVersion" ;
CONSTANT: kIOKitDiagnosticsKey "IOKitDiagnostics" ;

View File

@ -3,11 +3,11 @@ alien.syntax combinators io.sockets.secure system unix.types ;
in: libtls.ffi
<< "libtls" {
COMPILE< "libtls" {
{ [ os windows? ] [ "libtls-10.dll" ] }
{ [ os macosx? ] [ "libtls.dylib" ] }
{ [ os unix? ] [ "libtls.so" ] }
} cond cdecl add-library >>
} cond cdecl add-library COMPILE>
c-type: tls_config
c-type: tls_ctx

View File

@ -4,7 +4,7 @@ USING: alien alien.c-types alien.libraries alien.syntax
fry kernel sequences unix.types ;
in: libudev
<< "libudev" "libudev.so" cdecl add-library >>
COMPILE< "libudev" "libudev.so" cdecl add-library COMPILE>
library: libudev

View File

@ -7,11 +7,11 @@ system unix.time unix.types ;
FROM: alien.c-types => short ;
in: libusb
<< "libusb" {
COMPILE< "libusb" {
{ [ os windows? ] [ "libusb-1.0.dll" ] }
{ [ os macosx? ] [ "libusb-1.0.dylib" ] }
{ [ os unix? ] [ "libusb-1.0.so" ] }
} cond cdecl add-library >>
} cond cdecl add-library COMPILE>
library: libusb
: libusb_cpu_to_le16 ( x -- y )

View File

@ -5,11 +5,11 @@ alien.syntax classes.struct combinators io.encodings.ascii kernel
locals math system ;
in: lua
<< "liblua5.1" {
COMPILE< "liblua5.1" {
{ [ os windows? ] [ "lua5.1.dll" ] }
{ [ os macosx? ] [ "liblua5.1.dylib" ] }
{ [ os unix? ] [ "liblua5.1.so" ] }
} cond cdecl add-library >>
} cond cdecl add-library COMPILE>
library: liblua5.1

View File

@ -13,7 +13,7 @@ USING:
;
in: ogg
<<
COMPILE<
"ogg" {
{ [ os windows? ] [ "ogg.dll" ] }
{ [ os macosx? ] [ "libogg.0.dylib" ] }
@ -21,7 +21,7 @@ in: ogg
} cond cdecl add-library
"ogg" deploy-library
>>
COMPILE>
library: ogg

View File

@ -14,7 +14,7 @@ USING:
;
in: ogg.theora
<<
COMPILE<
"theoradec" {
{ [ os windows? ] [ "theoradec.dll" ] }
{ [ os macosx? ] [ "libtheoradec.0.dylib" ] }
@ -26,7 +26,7 @@ in: ogg.theora
{ [ os macosx? ] [ "libtheoraenc.0.dylib" ] }
{ [ os unix? ] [ "libtheoraenc.so" ] }
} cond cdecl add-library
>>
COMPILE>
CONSTANT: TH-EFAULT -1 ;
CONSTANT: TH-EINVAL -10 ;

View File

@ -14,7 +14,7 @@ USING:
;
in: ogg.vorbis
<<
COMPILE<
"vorbis" {
{ [ os windows? ] [ "vorbis.dll" ] }
{ [ os macosx? ] [ "libvorbis.0.dylib" ] }
@ -22,7 +22,7 @@ in: ogg.vorbis
} cond cdecl add-library
"vorbis" deploy-library
>>
COMPILE>
library: vorbis

View File

@ -8,15 +8,15 @@ FROM: alien.c-types => float short ;
specialized-array: uint
in: openal.alut
<< "alut" {
COMPILE< "alut" {
{ [ os windows? ] [ "alut.dll" ] }
{ [ os macosx? ] [
"/System/Library/Frameworks/OpenAL.framework/OpenAL"
] }
{ [ os unix? ] [ "libalut.so" ] }
} cond cdecl add-library >>
} cond cdecl add-library COMPILE>
<< os macosx? [ "alut" deploy-library ] unless >>
COMPILE< os macosx? [ "alut" deploy-library ] unless COMPILE>
library: alut

View File

@ -9,15 +9,15 @@ ushort void ;
specialized-array: uint
in: openal
<< "openal" {
COMPILE< "openal" {
{ [ os windows? ] [ "OpenAL32.dll" ] }
{ [ os macosx? ] [
"/System/Library/Frameworks/OpenAL.framework/OpenAL"
] }
{ [ os unix? ] [ "libopenal.so" ] }
} cond cdecl add-library >>
} cond cdecl add-library COMPILE>
<< os unix? [ "openal" deploy-library ] unless >>
COMPILE< os unix? [ "openal" deploy-library ] unless COMPILE>
library: openal

View File

@ -5,11 +5,11 @@ classes.struct combinators system alien.accessors byte-arrays
kernel ;
in: opencl.ffi
<< "opencl" {
COMPILE< "opencl" {
{ [ os windows? ] [ "OpenCL.dll" stdcall ] }
{ [ os macosx? ] [ "/System/Library/Frameworks/OpenCL.framework/OpenCL" cdecl ] }
{ [ os unix? ] [ "libOpenCL.so" cdecl ] }
} cond add-library >>
} cond add-library COMPILE>
library: opencl
! cl_platform.h

View File

@ -16,7 +16,7 @@ symbol: G-world
[ break ] dip
set-gl-context ;
<< \ gl-break t "break?" set-word-prop >>
COMPILE< \ gl-break t "break?" set-word-prop COMPILE>
SYNTAX: GB
\ gl-break suffix! ;

View File

@ -4,12 +4,12 @@ math arrays assocs continuations lexer fry locals vocabs.parser ;
in: opengl.gl.extensions
ERROR: unknown-gl-platform ;
<< {
COMPILE< {
{ [ os windows? ] [ "opengl.gl.windows" ] }
{ [ os macosx? ] [ "opengl.gl.macosx" ] }
{ [ os unix? ] [ "opengl.gl.gtk" ] }
[ unknown-gl-platform ]
} cond use-vocab >>
} cond use-vocab COMPILE>
symbol: +gl-function-counter+
symbol: +gl-function-pointers+

View File

@ -627,11 +627,11 @@ CONSTANT: GL_CLIENT_ALL_ATTRIB_BITS 0xFFFFFFFF ;
library: gl
<<
COMPILE<
os linux? [
"gl" "libGL.so" cdecl add-library
] when
>>
COMPILE>
! Miscellaneous
@ -1125,7 +1125,7 @@ FUNCTION: void glLoadName ( GLuint name ) ;
FUNCTION: void glPushName ( GLuint name ) ;
FUNCTION: void glPopName ( ) ;
<< reset-gl-function-number-counter >>
COMPILE< reset-gl-function-number-counter COMPILE>
! OpenGL 1.2

View File

@ -4,7 +4,7 @@ USING: alien alien.c-types alien.libraries alien.syntax kernel
sequences words system combinators opengl.gl alien.destructors ;
in: opengl.glu
<<
COMPILE<
os {
{ [ dup macosx? ] [ drop ] }
@ -12,7 +12,7 @@ os {
{ [ dup unix? ] [ drop "glu" "libGLU.so.1" cdecl add-library ] }
} cond
>>
COMPILE>
library: glu

View File

@ -10,11 +10,11 @@ alien.syntax classes.struct combinators system ;
in: openssl.libcrypto
<< "libcrypto" {
COMPILE< "libcrypto" {
{ [ os windows? ] [ "libcrypto-37.dll" ] }
{ [ os macosx? ] [ "libcrypto.dylib" ] }
{ [ os unix? ] [ "libcrypto.so" ] }
} cond cdecl add-library >>
} cond cdecl add-library COMPILE>
STRUCT: bio-method
{ type int }

View File

@ -8,11 +8,11 @@ sequences system words ;
in: openssl.libssl
<< "libssl" {
COMPILE< "libssl" {
{ [ os windows? ] [ "libssl-38.dll" ] }
{ [ os macosx? ] [ "libssl.dylib" ] }
{ [ os unix? ] [ "libssl.so" ] }
} cond cdecl add-library >>
} cond cdecl add-library COMPILE>
CONSTANT: X509_FILETYPE_PEM 1 ;
CONSTANT: X509_FILETYPE_ASN1 2 ;
@ -529,7 +529,7 @@ CONSTANT: SSL_SESS_CACHE_NO_INTERNAL
! x509_vfy.h
! ===============================================
<<
COMPILE<
symbol: verify-messages
@ -544,7 +544,7 @@ SYNTAX: X509_V_:
[ verify-messages get set-at ]
2bi ;
>>
COMPILE>
X509_V_: OK 0
X509_V_: ERR_UNABLE_TO_GET_ISSUER_CERT 2
@ -601,10 +601,10 @@ CONSTANT: NID_issuer_alt_name 86 ;
! are placed in libcrypto-37.dll
! ===============================================
<< os windows? [
COMPILE< os windows? [
"libssl-windows"
[ "libcrypto-37.dll" cdecl add-library ] [ current-library set ] bi
] when >>
] when COMPILE>
! x509.h
FUNCTION: int X509_NAME_get_text_by_NID ( X509_NAME* name, int nid, void* buf, int len ) ;

View File

@ -4,15 +4,15 @@ USING: alien alien.libraries alien.syntax cairo.ffi combinators
kernel gobject-introspection system vocabs ;
in: pango.cairo.ffi
<< "pango.ffi" require >>
COMPILE< "pango.ffi" require COMPILE>
library: pango.cairo
<< "pango.cairo" {
COMPILE< "pango.cairo" {
{ [ os windows? ] [ "libpangocairo-1.0-0.dll" ] }
{ [ os macosx? ] [ "libpangocairo-1.0.dylib" ] }
{ [ os unix? ] [ "libpangocairo-1.0.so" ] }
} cond cdecl add-library >>
} cond cdecl add-library COMPILE>
FOREIGN-RECORD-TYPE: cairo.Context cairo_t ;
FOREIGN-RECORD-TYPE: cairo.ScaledFont cairo_scaled_font_t ;

View File

@ -5,15 +5,15 @@ alien.syntax combinators gobject-introspection
gobject-introspection.standard-types system vocabs ;
in: pango.ffi
<< "gobject.ffi" require >>
COMPILE< "gobject.ffi" require COMPILE>
library: pango
<< "pango" {
COMPILE< "pango" {
{ [ os windows? ] [ "libpango-1.0-0.dll" ] }
{ [ os macosx? ] [ "libpango-1.0.dylib" ] }
{ [ os unix? ] [ "libpango-1.0.so" ] }
} cond cdecl add-library >>
} cond cdecl add-library COMPILE>
IMPLEMENT-STRUCTS: PangoRectangle ;

View File

@ -8,11 +8,11 @@ USING:
system ;
in: pcre.ffi
<< "pcre" {
COMPILE< "pcre" {
{ [ os windows? ] [ "pcre.dll" ] }
{ [ os macosx? ] [ "libpcre.dylib" ] }
{ [ os unix? ] [ "libpcre.so" ] }
} cond cdecl add-library >>
} cond cdecl add-library COMPILE>
library: pcre

View File

@ -4,9 +4,9 @@ system ;
in: python.ffi
! << "python" { "3.0" "3" "2.7" "2.6" } ! Python 3 has a different api, enable someday
<< "python"
COMPILE< "python"
{ "python2.7" "python2.6" "python27" "python26" } find-library-from-list
cdecl add-library >>
cdecl add-library COMPILE>
! Functions that return borrowed references needs to be called like this:
! Py_Func dup Py_IncRef &Py_DecRef

View File

@ -5,11 +5,11 @@ alien.syntax classes.struct combinators kernel libc math
namespaces system unix.types ;
in: readline.ffi
<< "readline" {
COMPILE< "readline" {
{ [ os windows? ] [ "readline.dll" ] }
{ [ os macosx? ] [ "libreadline.dylib" ] }
{ [ os unix? ] [ "libreadline.so" ] }
} cond cdecl add-library >>
} cond cdecl add-library COMPILE>
library: readline

View File

@ -5,7 +5,7 @@ alien.syntax classes.struct sequences system unix.time
unix.types vocabs ;
in: unix.ffi
<< "unix.ffi." os name>> append require >>
COMPILE< "unix.ffi." os name>> append require COMPILE>
CONSTANT: PROT_NONE 0 ;
CONSTANT: PROT_READ 1 ;

View File

@ -4,7 +4,7 @@ USING: alien.c-types alien.syntax system sequences vocabs.loader words
accessors vocabs ;
in: unix.kqueue
<< "unix.kqueue." os name>> append require >>
COMPILE< "unix.kqueue." os name>> append require COMPILE>
FUNCTION: int kqueue ( ) ;

View File

@ -21,7 +21,7 @@ STRUCT: fsid
TYPEDEF: fsid __fsid_t ;
TYPEDEF: fsid fsid_t ;
<< "unix.stat." os name>> append require >>
COMPILE< "unix.stat." os name>> append require COMPILE>
: file-status ( pathname -- stat )
\ stat <struct> [ [ stat-func ] unix-system-call drop ] keep ;

View File

@ -4,7 +4,7 @@ USING: alien alien.c-types alien.libraries alien.syntax
classes.struct kernel math windows.types windows.ole32 ;
in: windows.ddk.hid
<< "hid" "hid.dll" stdcall add-library >>
COMPILE< "hid" "hid.dll" stdcall add-library COMPILE>
library: hid
TYPEDEF: LONG NTSTATUS ;

View File

@ -5,7 +5,7 @@ classes.struct alien alien.c-types windows.errors windows.ole32
windows.advapi32 alien.libraries ;
in: windows.ddk.setupapi
<< "setupapi" "setupapi.dll" stdcall add-library >>
COMPILE< "setupapi" "setupapi.dll" stdcall add-library COMPILE>
library: setupapi
TYPEDEF: DWORDLONG SP_LOG_TOKEN ;

View File

@ -4,7 +4,7 @@ USING: alien alien.c-types alien.syntax classes.struct
windows.kernel32 windows.types alien.libraries ;
in: windows.ddk.winusb
<< "winusb" "winusb.dll" stdcall add-library >>
COMPILE< "winusb" "winusb.dll" stdcall add-library COMPILE>
library: winusb
TYPEDEF: PVOID WINUSB_INTERFACE_HANDLE ;

View File

@ -23,7 +23,7 @@ PRIVATE<
: initialize ( variable quot -- )
call swap set-global ; inline
<<
COMPILE<
GENERIC: array-base-type ( c-type -- c-type' ) ;
M: object array-base-type ;
@ -68,7 +68,7 @@ M: array array-base-type first ;
[ ] tri
] ;
>>
COMPILE>
MACRO: <DIDATAFORMAT> ( dwFlags dwDataSize struct rgodf-array -- alien )
[ DIDATAFORMAT heap-size DIOBJECTDATAFORMAT heap-size ] 4 ndip

View File

@ -22,7 +22,7 @@ STRUCT: DWM_BLURBEHIND
: full-window-margins ( -- MARGINS )
-1 -1 -1 -1 <MARGINS> ; inline
<< "dwmapi" "dwmapi.dll" stdcall add-library >>
COMPILE< "dwmapi" "dwmapi.dll" stdcall add-library COMPILE>
library: dwmapi

View File

@ -10,7 +10,7 @@ in: windows.iphlpapi
library: iphlpapi
<<
COMPILE<
CONSTANT: DEFAULT_MINIMUM_ENTITIES 32 ;
CONSTANT: MAX_ADAPTER_ADDRESS_LENGTH 8 ;
CONSTANT: MAX_ADAPTER_DESCRIPTION_LENGTH 128 ;
@ -28,7 +28,7 @@ CONSTANT: IF_TOKEN_RING_ADAPTERTYPE 2 ;
CONSTANT: IF_FDDI_ADAPTERTYPE 3 ;
CONSTANT: IF_PPP_ADAPTERTYPE 4 ;
CONSTANT: IF_LOOPBACK_ADAPTERTYPE 5 ;
>>
COMPILE>
CONSTANT: MAX_DOMAIN_NAME_LEN+4 132 ;
CONSTANT: MAX_HOSTNAME_LEN+4 132 ;

View File

@ -8,10 +8,10 @@ windows.errors windows.kernel32 windows.types ;
FROM: alien.c-types => short ;
in: windows.winsock
<<
COMPILE<
! Some differences between Win32 and Win64
cpu x86.64? "windows.winsock.64" "windows.winsock.32" ? use-vocab
>>
COMPILE>
TYPEDEF: int* SOCKET ;

View File

@ -34,9 +34,9 @@ symbol: xim
XNResourceClass over 0 XCreateIC
[ "XCreateIC() failed" throw ] unless* ;
<<
COMPILE<
CONSTANT: buf-size 100 ;
>>
COMPILE>
CONSTANT: buf $[ buf-size <byte-array> ] ;

View File

@ -5,7 +5,7 @@ classes.struct locals sequences x11.syntax x11.xlib ;
EXCLUDE: math => float ;
in: x11.xinput2.ffi
<< "xinput2" "libXi.so" cdecl add-library >>
COMPILE< "xinput2" "libXi.so" cdecl add-library COMPILE>
library: xinput2

View File

@ -5,11 +5,11 @@ USING: alien alien.c-types alien.libraries alien.syntax
combinators system ;
in: db.postgresql.ffi
<< "postgresql" {
COMPILE< "postgresql" {
{ [ os windows? ] [ "libpq.dll" ] }
{ [ os macosx? ] [ "libpq.dylib" ] }
{ [ os unix? ] [ "libpq.so" ] }
} cond cdecl add-library >>
} cond cdecl add-library COMPILE>
! ConnSatusType
CONSTANT: CONNECTION_OK 0x0 ;

View File

@ -6,11 +6,11 @@ USING: alien alien.c-types alien.libraries alien.syntax
combinators system ;
in: db.sqlite.ffi
<< "sqlite" {
COMPILE< "sqlite" {
{ [ os windows? ] [ "sqlite3.dll" ] }
{ [ os macosx? ] [ "libsqlite3.dylib" ] }
{ [ os unix? ] [ "libsqlite3.so" ] }
} cond cdecl add-library >>
} cond cdecl add-library COMPILE>
! Return values from sqlite functions
CONSTANT: SQLITE_OK 0 ; ! Successful result

View File

@ -2,7 +2,7 @@ USING: furnace.utilities io.encodings.utf8 io.files io.files.temp kernel
multiline parser tools.test webapps.counter ;
in: furnace.utilities.tests
<<
COMPILE<
STRING: dummy-vocab
in: dummy-vocab
@ -10,7 +10,7 @@ in: dummy-vocab
;
dummy-vocab "dummy.factor" temp-file [ utf8 set-file-contents ] keep run-file
>>
COMPILE>
{ t } [
use: dummy-vocab

View File

@ -3,11 +3,11 @@ vocabs vocabs.parser words namespaces ;
in: ui.pixel-formats
! break circular dependency
<<
COMPILE<
"ui.gadgets.worlds" create-vocab drop
"world" "ui.gadgets.worlds" create-word drop
"ui.gadgets.worlds" vocab-words-assoc use-words
>>
COMPILE>
ARTICLE: "ui.pixel-formats-attributes" "Pixel format attributes"
"The following pixel format attributes can be requested and queried of " { $link pixel-format } "s. Binary attributes are represented by the presence of a symbol in an attribute sequence:"

View File

@ -4,12 +4,12 @@ USING: accessors alien.c-types alien.complex.functor kernel
sequences ;
in: alien.complex
<<
COMPILE<
{ "float" "double" } [ dup "complex-" prepend define-complex-type ] each
>>
COMPILE>
<<
COMPILE<
! This overrides the fact that small structures are never returned
! in registers on Linux running on 32-bit x86.
\ complex-float lookup-c-type t >>return-in-registers? drop
>>
COMPILE>

View File

@ -40,12 +40,12 @@ ENUM: colores { rojo red } { verde green } { azul blue } { colorado rojo } ;
SYMBOLS: couleurs rouge vert bleu jaune azure ;
<< \ couleurs int {
COMPILE< \ couleurs int {
{ rouge red }
{ vert green }
{ bleu blue }
{ jaune 14 }
{ azure bleu }
} define-enum >>
} define-enum COMPILE>
{ { 0 3 4 14 4 } } [ { rouge vert bleu jaune azure } [ enum>number ] map ] unit-test

View File

@ -8,7 +8,7 @@ QUALIFIED-WITH: alien.c-types c ;
QUALIFIED-WITH: alien.syntax s ;
in: alien.fortran.tests
<< intel-unix-abi "(alien.fortran-tests)" (add-fortran-library) >>
COMPILE< intel-unix-abi "(alien.fortran-tests)" (add-fortran-library) COMPILE>
library: (alien.fortran-tests)
STRUCT: fortran_test_record
{ FOO int }

View File

@ -5,7 +5,7 @@ lexer namespaces parser sequences sets tools.test vocabs.parser words
;
in: alien.parser.tests
<<
COMPILE<
: with-parsing ( lines quot -- )
[ <lexer> ] [ '[ _ with-compilation-unit ] ] bi* with-lexer ; inline
@ -46,7 +46,7 @@ in: alien.parser.tests
{ "ayae" } [ parse-enum-name new-definitions get first in? ] with-parsing
] unit-test
>>
COMPILE>
TYPEDEF: char char2 ;

Some files were not shown because too many files have changed in this diff Show More