Fix 64bit widl stubs.
authorSamuel Serapion <samuel.serapion@gmail.com>
Mon, 15 Dec 2008 00:23:37 +0000 (00:23 +0000)
committerSamuel Serapion <samuel.serapion@gmail.com>
Mon, 15 Dec 2008 00:23:37 +0000 (00:23 +0000)
svn path=/branches/ros-amd64-bringup/; revision=38090

reactos/tools/widl/client.c
reactos/tools/widl/parser.y
reactos/tools/widl/proxy.c
reactos/tools/widl/server.c

index 191ae18..0f6f745 100644 (file)
@@ -461,7 +461,11 @@ static void write_client_ifaces(const statement_list_t *stmts, int expr_eval_rou
                 write_stubdescdecl(iface);
                 write_function_stubs(iface, proc_offset);
 
+#ifdef TARGET_amd64
+                print_client("#if !defined(__RPC_WIN64__)\n");
+#else
                 print_client("#if !defined(__RPC_WIN32__)\n");
+#endif
                 print_client("#error  Invalid build platform for this stub.\n");
                 print_client("#endif\n");
 
index 0694090..11e589a 100644 (file)
@@ -2062,14 +2062,27 @@ static int get_struct_type(var_list_t *fields)
       break;
 
     case RPC_FC_RP:
+      return RPC_FC_BOGUS_STRUCT;
+
     case RPC_FC_UP:
     case RPC_FC_FP:
     case RPC_FC_OP:
+      if(sizeof(void*) != 4)
+        return RPC_FC_BOGUST_STRUCT;
+      has_pointer = 1;
+      break;
     case RPC_FC_CARRAY:
     case RPC_FC_CVARRAY:
     case RPC_FC_BOGUS_ARRAY:
+    {
+      unsigned int ptr_type = get_attrv(field->attrs, ATTR_POINTERTYPE);
+      if(!ptr_type || ptr_type == RPC_FC_RP)
+        return RPC_FC_BOGUS_STRUCT;
+      else if (sizeof(void*) != 4)
+        return RPC_FC_BOGUS_STRUCT;
       has_pointer = 1;
       break;
+     }
 
     /*
      * Propagate member attributes
index 3a35cde..e958b0c 100644 (file)
@@ -704,7 +704,11 @@ void write_proxies(const statement_list_t *stmts)
   write_user_quad_list(proxy);
   write_stubdesc(expr_eval_routines);
 
+#ifdef TARGET_amd64
+  print_proxy( "#if !defined(__RPC_WIN64__)\n");
+#else
   print_proxy( "#if !defined(__RPC_WIN32__)\n");
+#endif
   print_proxy( "#error Currently only Wine and WIN32 are supported.\n");
   print_proxy( "#endif\n");
   print_proxy( "\n");
index d79447b..1f12c58 100644 (file)
@@ -401,7 +401,11 @@ static void write_server_stmts(const statement_list_t *stmts, int expr_eval_rout
 
                 write_function_stubs(iface, proc_offset);
 
-                print_server("#if !defined(__RPC_WIN32__)\n");
+#ifdef TARGET_amd64
+                print_server("#if !defined(__RPC_WIN64__)\n");
+#else
+                print_server( "#if !defined(__RPC_WIN32__)\n");
+#endif
                 print_server("#error  Invalid build platform for this stub.\n");
                 print_server("#endif\n");