diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2005-06-01 00:34:28 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:17:21 -0500 |
commit | 8474f37dc1d106ef9331253f41267d34a5c4028e (patch) | |
tree | e9504d64daf5723668bb5779f01f37ed7d72890d /source4/build | |
parent | cc89874f521532721e8ccb402c638c558e409811 (diff) | |
download | samba-8474f37dc1d106ef9331253f41267d34a5c4028e.tar.gz samba-8474f37dc1d106ef9331253f41267d34a5c4028e.tar.xz samba-8474f37dc1d106ef9331253f41267d34a5c4028e.zip |
r7161: - Add support for "aliases" for pidls scalar types and add a few aliases.
- Define __PIDL__ when preprocessing IDL files.
- Remove a couple of useless defines from rpcecho.idl
rpcecho.idl now works in both pidl and midl
(althought pidl is a bit pedantic and gives two warnings)
(This used to be commit 6731e0a6548ac24d561ba48c8e9611d0034e662f)
Diffstat (limited to 'source4/build')
-rw-r--r-- | source4/build/pidl/idl.pm | 2 | ||||
-rw-r--r-- | source4/build/pidl/idl.yp | 2 | ||||
-rw-r--r-- | source4/build/pidl/typelist.pm | 27 |
3 files changed, 24 insertions, 7 deletions
diff --git a/source4/build/pidl/idl.pm b/source4/build/pidl/idl.pm index 156a3435e6..8b6cf3956e 100644 --- a/source4/build/pidl/idl.pm +++ b/source4/build/pidl/idl.pm @@ -2470,7 +2470,7 @@ sub parse_idl($$) if (! defined $cpp) { $cpp = "cpp" } - my $data = `$cpp -xc $filename`; + my $data = `$cpp -D__PIDL__ -xc $filename`; $/ = $saved_delim; $self->YYData->{INPUT} = $data; diff --git a/source4/build/pidl/idl.yp b/source4/build/pidl/idl.yp index e283237627..b556b064b4 100644 --- a/source4/build/pidl/idl.yp +++ b/source4/build/pidl/idl.yp @@ -384,7 +384,7 @@ sub parse_idl($$) if (! defined $cpp) { $cpp = "cpp" } - my $data = `$cpp -xc $filename`; + my $data = `$cpp -D__PIDL__ -xc $filename`; $/ = $saved_delim; $self->YYData->{INPUT} = $data; diff --git a/source4/build/pidl/typelist.pm b/source4/build/pidl/typelist.pm index a8600cedbe..cc8504e80f 100644 --- a/source4/build/pidl/typelist.pm +++ b/source4/build/pidl/typelist.pm @@ -153,7 +153,7 @@ sub mapScalarType($) # it's a bug when a type is not in the list # of known scalars or has no mapping - return $scalars->{$name}{C_TYPE} if defined($scalars->{$name}) and defined($scalars->{$name}{C_TYPE}); + return $typedefs{$name}->{DATA}->{C_TYPE} if defined($typedefs{$name}) and defined($typedefs{$name}->{DATA}->{C_TYPE}); die("Unknown scalar type $name"); } @@ -225,11 +225,27 @@ sub RegisterScalars() $typedefs{$k} = { NAME => $k, TYPE => "TYPEDEF", - DATA => { - TYPE => "SCALAR", - NAME => $k - } + DATA => $scalars->{$k} }; + $typedefs{$k}->{DATA}->{TYPE} = "SCALAR"; + $typedefs{$k}->{DATA}->{NAME} = $k; + } +} + +my $aliases = { + "DWORD" => "uint32", + "int" => "int32", + "WORD" => "uint16", + "char" => "uint8", + "long" => "int32", + "short" => "int16", + "hyper" => "HYPER_T" +}; + +sub RegisterAliases() +{ + foreach my $k (keys %{$aliases}) { + $typedefs{$k} = $typedefs{$aliases->{$k}}; } } @@ -304,5 +320,6 @@ sub LoadIdl($) } RegisterScalars(); +RegisterAliases(); 1; |