You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 463 Reporter: administrator Status: closed Resolution: fixed Priority: normal Severity: minor Category: -for CamlIDL use https://github.com/xavierleroy/camlidl/issues
Bug description
Here is the patch adding support for optional "union-name" parameter in IDL
union definition according to Microsoft specs:
Original bug ID: 463
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: -for CamlIDL use https://github.com/xavierleroy/camlidl/issues
Bug description
Here is the patch adding support for optional "union-name" parameter in IDL
union definition according to Microsoft specs:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/midl/hh/midl/mi-laref_76i6.asp
[---cut---]
Index: compiler/parse_aux.ml
RCS file: /caml/bazar-ocaml/camlidl/compiler/parse_aux.ml,v
retrieving revision 1.13
diff -u -r1.13 parse_aux.ml
--- compiler/parse_aux.ml 2001/07/30 14:45:40 1.13
+++ compiler/parse_aux.ml 2001/07/31 09:36:03
@@ -263,14 +263,14 @@
let make_fields attrs tybase decls =
List.map (make_field attrs tybase) decls
-let make_discriminated_union name switch_name switch_type body =
+let make_discriminated_union name union_name switch_name switch_type body =
let ty_union =
Type_union({ud_name = ""; ud_mod = ""; ud_stamp = 0; ud_cases = body},
{discriminant = Expr_ident switch_name}) in
{ sd_name = name; sd_mod = ""; sd_stamp = 0;
sd_fields = [ {field_name = switch_name; field_mlname = switch_name;
field_typ = switch_type};
let type_names =
Index: compiler/parse_aux.mli
RCS file: /caml/bazar-ocaml/camlidl/compiler/parse_aux.mli,v
retrieving revision 1.8
diff -u -r1.8 parse_aux.mli
--- compiler/parse_aux.mli 2001/06/29 13:30:00 1.8
+++ compiler/parse_aux.mli 2001/07/31 09:36:53
@@ -58,6 +58,7 @@
val make_discriminated_union :
string ->
string ->
idltype -> union_case list -> struct_decl
(* Convert a union switch(...) into a struct encapsulating an union *)
val type_names : StringSet.t ref
Index: compiler/parser_midl.mly
===================================================================
RCS file: /caml/bazar-ocaml/camlidl/compiler/parser_midl.mly,v
retrieving revision 1.16
diff -u -r1.16 parser_midl.mly
--- compiler/parser_midl.mly 2001/06/29 13:30:00 1.16
+++ compiler/parser_midl.mly 2001/07/31 09:37:00
@@ -333,12 +333,18 @@
/* Struct declaration and discriminated unions */
+union_name:
+;
struct_declarator:
STRUCT opt_ident LBRACE field_declarators RBRACE
{ {sd_name = $2; sd_mod = ""; sd_stamp = 0; sd_fields = $4} }
LBRACE union_body RBRACE
;
field_declarators:
field_declarator
[---cut---]
Microsoft uses that intensively (see also my last followup to PR #410)
Hope to hear from you soon,
Dmitry
The text was updated successfully, but these errors were encountered: