summaryrefslogtreecommitdiff
path: root/source4/pidl/lib/Parse
diff options
context:
space:
mode:
Diffstat (limited to 'source4/pidl/lib/Parse')
-rw-r--r--source4/pidl/lib/Parse/Pidl/Samba4/Header.pm15
-rw-r--r--source4/pidl/lib/Parse/Pidl/Util.pm11
2 files changed, 8 insertions, 18 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) = @_;