diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-10-27 04:43:01 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:04:49 -0500 |
commit | 1a7a5c66f5dd3d28d57cb53e8d5089452b49b0aa (patch) | |
tree | 722499a79c043184ce4f03a78ccf042c592e1c4a /source4 | |
parent | ba450de07c08c7a5a803e59b7133c06e2f0b9682 (diff) | |
download | samba-1a7a5c66f5dd3d28d57cb53e8d5089452b49b0aa.tar.gz samba-1a7a5c66f5dd3d28d57cb53e8d5089452b49b0aa.tar.bz2 samba-1a7a5c66f5dd3d28d57cb53e8d5089452b49b0aa.zip |
r3282: some C pre-processors don't like expressions like
uuid(1ff70682-0a51-30e8-076d-740be8cee98b) so we now accept
uuid("1ff70682-0a51-30e8-076d-740be8cee98b") in pidl, and
automagically add quotes only if needed
(This used to be commit 4aab2cb210eb9678bb72aebb33dcf6fd499206c1)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/build/pidl/header.pm | 3 | ||||
-rw-r--r-- | source4/build/pidl/swig.pm | 3 | ||||
-rw-r--r-- | source4/build/pidl/util.pm | 10 |
3 files changed, 14 insertions, 2 deletions
diff --git a/source4/build/pidl/header.pm b/source4/build/pidl/header.pm index 56f3503e5d..f9acc5e222 100644 --- a/source4/build/pidl/header.pm +++ b/source4/build/pidl/header.pm @@ -280,7 +280,8 @@ sub HeaderInterface($) if (defined $interface->{PROPERTIES}->{uuid}) { my $name = uc $interface->{NAME}; - $res .= "#define DCERPC_$name\_UUID \"$interface->{PROPERTIES}->{uuid}\"\n"; + $res .= "#define DCERPC_$name\_UUID " . + util::make_str($interface->{PROPERTIES}->{uuid}) . "\n"; if(!defined $interface->{PROPERTIES}->{version}) { $interface->{PROPERTIES}->{version} = "0.0"; } $res .= "#define DCERPC_$name\_VERSION $interface->{PROPERTIES}->{version}\n"; diff --git a/source4/build/pidl/swig.pm b/source4/build/pidl/swig.pm index 0ba654538d..f0bb413a3b 100644 --- a/source4/build/pidl/swig.pm +++ b/source4/build/pidl/swig.pm @@ -662,7 +662,8 @@ sub ParseHeader($) if ($hdr->{PROPERTIES}{uuid}) { my($name) = $hdr->{NAME}; - $result .= "#define DCERPC_" . uc($name) . "_UUID \"$hdr->{PROPERTIES}->{uuid}\"\n"; + $result .= "#define DCERPC_" . uc($name) . "_UUID " . + util::make_str($hdr->{PROPERTIES}->{uuid}) . "\n"; $result .= "const int DCERPC_" . uc($name) . "_VERSION = " . $hdr->{PROPERTIES}->{version} . ";\n"; $result .= "#define DCERPC_" . uc($name) . "_NAME \"" . $name . "\"\n"; $result .= "\n"; diff --git a/source4/build/pidl/util.pm b/source4/build/pidl/util.pm index 5934f8a7e1..5fbca25220 100644 --- a/source4/build/pidl/util.pm +++ b/source4/build/pidl/util.pm @@ -390,5 +390,15 @@ sub is_inline_array($) return 0; } +# return a "" quoted string, unless already quoted +sub make_str($) +{ + my $str = shift; + if (substr($str, 0, 1) eq "\"") { + return $str; + } + return "\"" . $str . "\""; +} + 1; |