Make printf.r run on Windows as well
Make printf.r run on Windows as well

giuliolunati/ren-c,codebybrett/ren-c,kealist/ren-c,rgchris/ren-c,giuliolunati/ren-c,hostilefork/rebol,hostilefork/rebol,draegtun/ren-c,giuliolunati/ren-c,giuliolunati/ren-c,codebybrett/ren-c,draegtun/ren-c,draegtun/ren-c,rgchris/ren-c,kealist/ren-c,giuliolunati/ren-c,kealist/ren-c,hostilefork/rebol,rgchris/ren-c,kealist/ren-c,hostilefork/rebol,hostilefork/rebol,codebybrett/ren-c,codebybrett/ren-c,rgchris/ren-c,codebybrett/ren-c,draegtun/ren-c,rgchris/ren-c,kealist/ren-c,draegtun/ren-c
REBOL []

recycle/torture


libc: make library! switch system/platform/1 [
    Linux [%libc.so.6]
    Windows [%msvcrt.dll]
] else [
    fail "don't know where the C library is"
]

x64?: 40 = fifth system/version
size_t: either x64? ['int64]['int32]
printf: make-routine libc "printf" compose/deep [
    return: [int32]
    f [pointer]
    ...
]

;(printf "hello^/" 0 [pointer])
(printf "hello %s^/" "world" [pointer])
(printf "hello^/")
(print "hi")

REBOL []

recycle/torture


libc: make library! %libc.so.6

x64?: 40 = fifth system/version
size_t: either x64? ['int64]['int32]
printf: make-routine libc "printf" compose/deep [
    return: [int32]
    f [pointer]
    ...
]

;(printf "hello^/" 0 [pointer])
(printf "hello %s^/" "world" [pointer])
(printf "hello^/")
(print "hi")
