packages feed

bindings-DSL 1.0.17 → 1.0.18

raw patch · 2 files changed

+13/−2 lines, 2 files

Files

bindings-DSL.cabal view
@@ -17,7 +17,7 @@   .   The extra module Bindings.Utilities will contain tools that may   be convenient when working with FFI.-version: 1.0.17+version: 1.0.18 license: BSD3 license-file: LICENSE maintainer: Maurício C. Antunes <mauricio.antunes@gmail.com>@@ -37,4 +37,4 @@ source-repository this   type: git   location: ssh://git@bitbucket.org/mauricio/bindings-dsl-  tag: 1.0.17+  tag: 1.0.18
bindings.dsl.h view
@@ -112,6 +112,15 @@     bc_ptrid(# name);printf("\n"); \     printf("  :: FunPtr (");bc_typemarkup(# type);printf(")\n"); \ +/* experimental support for unsafe calls */+#define hsc_ccall_unsafe(name,type) \+    printf("foreign import ccall unsafe \"%s\" unsafe'",# name); \+    bc_varid(# name);printf("\n"); \+    printf("  :: ");bc_typemarkup(# type);printf("\n"); \+    printf("foreign import ccall unsafe \"&%s\" unsafe'",# name); \+    bc_ptrid(# name);printf("\n"); \+    printf("  :: FunPtr (");bc_typemarkup(# type);printf(")\n"); \+ #define hsc_cinline(name,type) \     printf("foreign import ccall \"inline_%s\" ",# name); \     bc_varid(# name);printf("\n"); \@@ -175,6 +184,8 @@ 	uintmax_t offset[500]; 	char fname[500][1000], ftype[500][1000]; } bc_fielddata;++bc_fielddata.n = 0; /* Avoid warning of unused variable */  #define bc_fieldname(type,field) {printf("c'");bc_glue(type,field);}; \