diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2007-01-22 00:04:59 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:43:57 -0500 |
commit | 30bfba96d3b7007aa47e037328ea0f2b8e7d1d6e (patch) | |
tree | 67f9568febf9749b8938dac87c6a587938f83d04 /source4/pidl/lib/Parse/Pidl | |
parent | fa5e920a7b4a2eba450189af35e0b5eeab80cdbc (diff) | |
download | samba-30bfba96d3b7007aa47e037328ea0f2b8e7d1d6e.tar.gz samba-30bfba96d3b7007aa47e037328ea0f2b8e7d1d6e.tar.bz2 samba-30bfba96d3b7007aa47e037328ea0f2b8e7d1d6e.zip |
r20942: Simplify handling of systems that don't support negative enum values by using an ifdef rather than a pidl argument.
(This used to be commit 6bada0dcf0c7915d366c7917189375dbabecdd4f)
Diffstat (limited to 'source4/pidl/lib/Parse/Pidl')
-rw-r--r-- | source4/pidl/lib/Parse/Pidl/Samba4/Header.pm | 15 | ||||
-rw-r--r-- | source4/pidl/lib/Parse/Pidl/Util.pm | 11 |
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) = @_; |