picolisp

Unnamed repository; edit this file to name it for gitweb.
git clone https://logand.com/git/picolisp.git/
Log | Files | Refs | README | LICENSE

native.l (1158B)


      1 # 05nov12abu
      2 # (c) Software Lab. Alexander Burger
      3 
      4 (de gcc (Nm L . Lst)
      5    (out (tmp Nm ".c") (here "/**/"))
      6    ~(case *OS
      7       (("Linux" "FreeBSD")
      8          (quote
      9             (apply call L 'gcc "-o" (tmp Nm)
     10                "-fPIC" "-shared" "-export-dynamic"
     11                "-O" "-falign-functions" "-fomit-frame-pointer"
     12                "-W" "-Wimplicit" "-Wreturn-type" "-Wunused" "-Wformat"
     13                "-Wuninitialized" "-Wstrict-prototypes"
     14                "-pipe" "-D_GNU_SOURCE" (tmp Nm ".c") ) ) )
     15       ("SunOS"
     16          (quote
     17             (apply call L 'gcc "-o" (tmp Nm)
     18                "-fPIC" "-shared"
     19                "-O" "-falign-functions" "-fomit-frame-pointer"
     20                "-W" "-Wimplicit" "-Wreturn-type" "-Wunused" "-Wformat"
     21                "-Wuninitialized" "-Wstrict-prototypes"
     22                "-pipe" "-D_GNU_SOURCE" (tmp Nm ".c") ) ) ) )
     23    (for L Lst
     24       (def (car L)
     25          (list
     26             (cadr L)
     27             (cons 'native (tmp Nm) (name (caddr L)) (cdddr L)) ) )
     28       (when (== '@ (fin (cadr L)))
     29          (push (cdaar L) 'pass) ) ) )
     30 
     31 (de unsigned (N)
     32    (& `(dec (** 2 32)) (+ N `(** 2 32))) )
     33 
     34 # vi:et:ts=3:sw=3