1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

r20942: Simplify handling of systems that don't support negative enum values by using an ifdef rather than a pidl argument.

This commit is contained in:
Jelmer Vernooij 2007-01-22 00:04:59 +00:00 committed by Gerald (Jerry) Carter
parent 83353ec0cd
commit 6bada0dcf0
7 changed files with 12 additions and 35 deletions

View File

@ -47,8 +47,7 @@ AC_CACHE_CHECK([that the C compiler understands negative enum values],SMB_BUILD_
],
SMB_BUILD_CC_NEGATIVE_ENUM_VALUES=yes,SMB_BUILD_CC_NEGATIVE_ENUM_VALUES=no)])
if test x"$SMB_BUILD_CC_NEGATIVE_ENUM_VALUES" != x"yes"; then
AC_MSG_WARN([using --unit-enums for pidl])
PIDL_ARGS="$PIDL_ARGS --uint-enums"
AC_DEFINE(USE_UINT_ENUMS, 1, [Whether the compiler has uint enum support])
fi
AC_MSG_CHECKING([for test routines])

View File

@ -26,6 +26,3 @@ fi
export PERL
AC_PATH_PROG(YAPP, yapp, false)
PIDL_ARGS=""
AC_SUBST(PIDL_ARGS)

View File

@ -154,7 +154,6 @@ XSLTPROC=$self->{config}->{XSLTPROC}
LEX=$self->{config}->{LEX}
YACC=$self->{config}->{YACC}
YAPP=$self->{config}->{YAPP}
PIDL_ARGS=$self->{config}->{PIDL_ARGS}
GCOV=$self->{config}->{GCOV}

View File

@ -208,10 +208,10 @@ $(IDL_HEADER_FILES) \
$(IDL_NDR_EJS_C_FILES) $(IDL_NDR_EJS_H_FILES): idl
idl_full: pidl/lib/Parse/Pidl/IDL.pm pidl/lib/Parse/Pidl/Expr.pm
@CPP="$(CPP)" PERL="$(PERL)" srcdir=$(srcdir) $(srcdir)/script/build_idl.sh FULL $(PIDL_ARGS)
@CPP="$(CPP)" PERL="$(PERL)" srcdir=$(srcdir) $(srcdir)/script/build_idl.sh FULL
idl: pidl/lib/Parse/Pidl/IDL.pm pidl/lib/Parse/Pidl/Expr.pm
@CPP="$(CPP)" PERL="$(PERL)" srcdir=$(srcdir) $(srcdir)/script/build_idl.sh PARTIAL $(PIDL_ARGS)
@CPP="$(CPP)" PERL="$(PERL)" srcdir=$(srcdir) $(srcdir)/script/build_idl.sh PARTIAL
pidl/lib/Parse/Pidl/IDL.pm: pidl/idl.yp
-$(YAPP) -m 'Parse::Pidl::IDL' -o pidl/lib/Parse/Pidl/IDL.pm pidl/idl.yp ||\

View File

@ -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");
}
#####################################################################

View File

@ -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) = @_;

View File

@ -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;