Przeglądaj źródła

allow to pass struct* directly to C without wrapping

Nicolas Cannasse 4 lat temu
rodzic
commit
c2ce41f13d
2 zmienionych plików z 2 dodań i 3 usunięć
  1. 2 1
      src/hl.h
  2. 0 2
      src/module.c

+ 2 - 1
src/hl.h

@@ -750,7 +750,7 @@ HL_API void hl_throw_buffer( hl_buffer *b );
 // ----------------------- FFI ------------------------------------------------------
 
 // match GNU C++ mangling
-#define TYPE_STR	"vcsilfdbBDPOATR??X?N"
+#define TYPE_STR	"vcsilfdbBDPOATR??X?N?S"
 
 #undef  _VOID
 #define _NO_ARG
@@ -772,6 +772,7 @@ HL_API void hl_throw_buffer( hl_buffer *b );
 #define _ABSTRACT(name)				"X" #name "_"
 #undef _NULL
 #define _NULL(t)					"N" t
+#define _STRUCT						"S"
 
 #undef _STRING
 #define _STRING						_OBJ(_BYTES _I32)

+ 0 - 2
src/module.c

@@ -285,8 +285,6 @@ static void append_type( char **p, hl_type *t ) {
 	case HNULL:
 		append_type(p,t->tparam);
 		break;
-	case HSTRUCT:
-		*(*p)++ = 'S';
 	case HOBJ:
 		{
 			append_fields(p, t);