summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-01-22 00:04:59 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:43:57 -0500
commit30bfba96d3b7007aa47e037328ea0f2b8e7d1d6e (patch)
tree67f9568febf9749b8938dac87c6a587938f83d04 /source4
parentfa5e920a7b4a2eba450189af35e0b5eeab80cdbc (diff)
downloadsamba-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')
-rw-r--r--source4/build/m4/check_cc.m43
-rw-r--r--source4/build/m4/check_perl.m43
-rw-r--r--source4/build/smb_build/makefile.pm1
-rw-r--r--source4/main.mk4
-rw-r--r--source4/pidl/lib/Parse/Pidl/Samba4/Header.pm15
-rw-r--r--source4/pidl/lib/Parse/Pidl/Util.pm11
-rwxr-xr-xsource4/pidl/pidl10
7 files changed, 12 insertions, 35 deletions
diff --git a/source4/build/m4/check_cc.m4 b/source4/build/m4/check_cc.m4
index 324ddb3c03..e6b090d9dc 100644
--- a/source4/build/m4/check_cc.m4
+++ b/source4/build/m4/check_cc.m4
@@ -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])
diff --git a/source4/build/m4/check_perl.m4 b/source4/build/m4/check_perl.m4
index af1e42e2cd..82ca242499 100644
--- a/source4/build/m4/check_perl.m4
+++ b/source4/build/m4/check_perl.m4
@@ -26,6 +26,3 @@ fi
export PERL
AC_PATH_PROG(YAPP, yapp, false)
-
-PIDL_ARGS=""
-AC_SUBST(PIDL_ARGS)
diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm
index 48379b279d..9f571396eb 100644
--- a/source4/build/smb_build/makefile.pm
+++ b/source4/build/smb_build/makefile.pm
@@ -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}
diff --git a/source4/main.mk b/source4/main.mk
index 838b13012d..788b6b2efb 100644
--- a/source4/main.mk
+++ b/source4/main.mk
@@ -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 ||\
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;