diff options
Diffstat (limited to 'source4/pidl')
-rw-r--r-- | source4/pidl/lib/Parse/Pidl/Samba4/Header.pm | 15 | ||||
-rw-r--r-- | source4/pidl/lib/Parse/Pidl/Util.pm | 11 | ||||
-rwxr-xr-x | source4/pidl/pidl | 10 |
3 files changed, 9 insertions, 27 deletions
diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm b/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm index da7d39a238..96f695d1cd 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm @@ -118,8 +118,8 @@ sub HeaderEnum($$) my($enum,$name) = @_; my $first = 1; - if (not Parse::Pidl::Util::useUintEnums()) { - pidl "enum $name {\n"; + pidl "#ifndef USE_UINT_ENUMS\n"; + pidl "enum $name {\n"; $tab_depth++; foreach my $e (@{$enum->{ELEMENTS}}) { unless ($first) { pidl ",\n"; } @@ -129,9 +129,9 @@ sub HeaderEnum($$) } pidl "\n"; $tab_depth--; - pidl "}"; - } else { - my $count = 0; + pidl "};\n"; + pidl "#else\n"; + my $count = 0; pidl "enum $name { __donnot_use_enum_$name=0x7FFFFFFF};\n"; my $with_val = 0; my $without_val = 0; @@ -154,8 +154,8 @@ sub HeaderEnum($$) } pidl "#define $name ( $value )\n"; } + pidl "#endif\n"; pidl "\n"; - } } ##################################################################### @@ -220,7 +220,8 @@ sub HeaderTypedef($) { my($typedef) = shift; HeaderType($typedef, $typedef->{DATA}, $typedef->{NAME}); - pidl ";\n\n" unless ($typedef->{DATA}->{TYPE} eq "BITMAP"); + pidl ";\n\n" unless ($typedef->{DATA}->{TYPE} eq "BITMAP" or + $typedef->{DATA}->{TYPE} eq "ENUM"); } ##################################################################### diff --git a/source4/pidl/lib/Parse/Pidl/Util.pm b/source4/pidl/lib/Parse/Pidl/Util.pm index 35e25286f5..3ca79b6c1c 100644 --- a/source4/pidl/lib/Parse/Pidl/Util.pm +++ b/source4/pidl/lib/Parse/Pidl/Util.pm @@ -87,17 +87,6 @@ sub print_uuid($) "{".join(',', map {"0x$_"} @node)."}}"; } -# a hack to build on platforms that don't like negative enum values -my $useUintEnums = 0; -sub setUseUintEnums($) -{ - $useUintEnums = shift; -} -sub useUintEnums() -{ - return $useUintEnums; -} - sub ParseExpr($$$) { my($expr, $varlist, $e) = @_; diff --git a/source4/pidl/pidl b/source4/pidl/pidl index 391ec10b23..2cc7143386 100755 --- a/source4/pidl/pidl +++ b/source4/pidl/pidl @@ -17,7 +17,7 @@ pidl - An IDL compiler written in Perl pidl --help -pidl [--outputdir[=OUTNAME]] [--includedir DIR...] [--parse-idl-tree] [--dump-idl-tree] [--dump-ndr-tree] [--header[=OUTPUT]] [--ejs[=OUTPUT]] [--swig[=OUTPUT]] [--uint-enums] [--ndr-parser[=OUTPUT]] [--client] [--server] [--dcom-proxy] [--com-header] [--warn-compat] [--quiet] [--verbose] [--template] [--ws-parser[=OUTPUT]] [--diff] [--dump-idl] [--tdr-parser[=OUTPUT]] [--samba3-ndr-client[=OUTPUT]] [--samba3-ndr-server[=OUTPUT]] [<idlfile>.idl]... +pidl [--outputdir[=OUTNAME]] [--includedir DIR...] [--parse-idl-tree] [--dump-idl-tree] [--dump-ndr-tree] [--header[=OUTPUT]] [--ejs[=OUTPUT]] [--swig[=OUTPUT]] [--ndr-parser[=OUTPUT]] [--client] [--server] [--dcom-proxy] [--com-header] [--warn-compat] [--quiet] [--verbose] [--template] [--ws-parser[=OUTPUT]] [--diff] [--dump-idl] [--tdr-parser[=OUTPUT]] [--samba3-ndr-client[=OUTPUT]] [--samba3-ndr-server[=OUTPUT]] [<idlfile>.idl]... =head1 DESCRIPTION @@ -451,7 +451,6 @@ my($opt_parse_idl_tree) = 0; my($opt_dump_idl_tree); my($opt_dump_ndr_tree); my($opt_dump_idl) = 0; -my($opt_uint_enums) = 0; my($opt_diff) = 0; my($opt_header); my($opt_samba3_header); @@ -501,7 +500,6 @@ Debugging: Samba 4 output: --header[=OUTFILE] create generic header file [BASENAME.h] - --uint-enums don't use C enums, instead use uint* types --ndr-parser[=OUTFILE] create a C NDR parser [ndr_BASENAME.c] --client[=OUTFILE] create a C NDR client [ndr_BASENAME_c.c] --tdr-parser[=OUTFILE] create a C TDR parser [tdr_BASENAME.c] @@ -532,7 +530,6 @@ my $result = GetOptions ( 'dump-idl-tree:s' => \$opt_dump_idl_tree, 'parse-idl-tree' => \$opt_parse_idl_tree, 'dump-ndr-tree:s' => \$opt_dump_ndr_tree, - 'uint-enums' => \$opt_uint_enums, 'samba3-ndr-client:s' => \$opt_samba3_ndr_client, 'samba3-ndr-server:s' => \$opt_samba3_ndr_server, 'header:s' => \$opt_header, @@ -590,10 +587,6 @@ sub process_file($) SaveStructure($pidl_file, $pidl) or die "Failed to save $pidl_file\n"; } - if ($opt_uint_enums) { - Parse::Pidl::Util::setUseUintEnums(1); - } - if ($opt_dump_idl) { require Parse::Pidl::Dump; print Parse::Pidl::Dump($pidl); @@ -606,7 +599,6 @@ sub process_file($) unlink($tempfile); } - my $comh_filename = ($opt_com_header or "$outputdir/com_$basename.h"); if (defined($opt_com_header)) { require Parse::Pidl::Samba4::COM::Header; |