From 1a7a5c66f5dd3d28d57cb53e8d5089452b49b0aa Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 27 Oct 2004 04:43:01 +0000 Subject: 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) --- source4/build/pidl/header.pm | 3 ++- source4/build/pidl/swig.pm | 3 ++- source4/build/pidl/util.pm | 10 ++++++++++ 3 files changed, 14 insertions(+), 2 deletions(-) (limited to 'source4') 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; -- cgit