[WIDL] Sync with Wine Staging 4.0. CORE-15682
[reactos.git] / sdk / tools / widl / typelib.c
index 7c590bc..9411ccc 100644 (file)
@@ -48,7 +48,9 @@
 #include "typelib_struct.h"
 #include "typetree.h"
 
+#ifdef __REACTOS__
 static typelib_t *typelib;
+#endif
 
 /* List of oleauto types that should be recognized by name.
  * (most of) these seem to be intrinsic types in mktyplib.
@@ -161,6 +163,7 @@ unsigned short get_type_vt(type_t *t)
       else
         return VT_INT;
     case TYPE_BASIC_INT32:
+    case TYPE_BASIC_LONG:
     case TYPE_BASIC_ERROR_STATUS_T:
       if (type_basic_get_sign(t) > 0)
         return VT_UI4;
@@ -173,7 +176,7 @@ unsigned short get_type_vt(type_t *t)
       else
         return VT_I8;
     case TYPE_BASIC_INT3264:
-      if (typelib_kind == SYS_WIN64)
+      if (pointer_size == 8)
       {
         if (type_basic_get_sign(t) > 0)
           return VT_UI8;
@@ -204,10 +207,10 @@ unsigned short get_type_vt(type_t *t)
     {
       if (match(type_array_get_element(t)->name, "SAFEARRAY"))
         return VT_SAFEARRAY;
+      return VT_PTR;
     }
     else
-      error("get_type_vt: array types not supported\n");
-    return VT_PTR;
+      return VT_CARRAY;
 
   case TYPE_INTERFACE:
     if(match(t->name, "IUnknown"))
@@ -243,6 +246,7 @@ unsigned short get_type_vt(type_t *t)
   return 0;
 }
 
+#ifdef __REACTOS__
 void start_typelib(typelib_t *typelib_type)
 {
     if (!do_typelib) return;
@@ -253,11 +257,9 @@ void end_typelib(void)
 {
     if (!typelib) return;
 
-    if (do_old_typelib)
-        create_sltg_typelib(typelib);
-    else
-        create_msft_typelib(typelib);
+    create_msft_typelib(typelib);
 }
+#endif
 
 static void tlb_read(int fd, void *buf, int count)
 {
@@ -383,7 +385,11 @@ static void read_importlib(importlib_t *importlib)
     close(fd);
 }
 
+#ifdef __REACTOS__
 void add_importlib(const char *name)
+#else
+void add_importlib(const char *name, typelib_t *typelib)
+#endif
 {
     importlib_t *importlib;