pidgin/pidgin

Change this to a preprocessor check.
release-2.x.y
2014-09-29, Mark Doliner
6d2325070ec8
file isExecutable
Change this to a preprocessor check.

Obviously this needs to happen at the preprocessor level because
SSLVersionRange won't exist in old versions. I'm not sure when
these constants started appearing... I'm kinda just hoping they've
been around as long as the NSS_VersionCheck function (NSS 3.2, I think,
which was many years ago). I might look into it. But checking this
in now to get in before the nightly Jenkins build for ppc.
#!/bin/sh
if [ $# -eq 0 ]; then
echo "Usage: `basename "$0"` PurpleFoo..."
echo
echo "This script searches the *current working directory* and replaces casts"
echo "with GObject-style type checking and casting macros."
echo 'For example, "(PurpleBuddy *)b" becomes "PURPLE_BUDDY(b)".'
exit 0
fi
for struct in $* ; do
cast=`echo $struct | sed "s|[A-Z]|_\0|g" | tr "a-z" "A-Z" | sed "s|^_||"`
for file in `grep -rl "([[:space:]]*$struct[[:space:]]*\*[[:space:]]*)" . --include=*.c --exclude=purple-client-bindings.c` ; do
sed -i "s|([[:space:]]*$struct[[:space:]]*\*[[:space:]]*)[[:space:]]*(|$cast(|g" $file
sed -i "s|([[:space:]]*$struct[[:space:]]*\*[[:space:]]*)[[:space:]]*\([^(][^,);]*\)|$cast(\1)|g" $file
done
done