[Xfce4-commits] [xfce/libxfce4util] 01/01: Fix this use of "defined" may not be portable
noreply at xfce.org
noreply at xfce.org
Sun Apr 14 23:38:09 CEST 2019
This is an automated email from the git hooks/post-receive script.
a n d r e p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository xfce/libxfce4util.
commit 2e25eaf07c96f390747327154194810188015d8b
Author: Andre Miranda <andreldm at xfce.org>
Date: Sun Apr 14 18:37:30 2019 -0300
Fix this use of "defined" may not be portable
---
libxfce4util/make-libxfce4util-alias.pl | 44 ++++++++++++++++-----------------
1 file changed, 22 insertions(+), 22 deletions(-)
diff --git a/libxfce4util/make-libxfce4util-alias.pl b/libxfce4util/make-libxfce4util-alias.pl
index 9949a6f..fb111a4 100644
--- a/libxfce4util/make-libxfce4util-alias.pl
+++ b/libxfce4util/make-libxfce4util-alias.pl
@@ -36,26 +36,6 @@ print <<EOF;
EOF
-if ($option_def)
- {
- print <<EOF
-#undef IN_HEADER
-#define IN_HEADER(x) 1
-
-#undef IN_SOURCE
-#define IN_SOURCE defined
-
-EOF
- }
-else
- {
- print <<EOF
-#define IN_HEADER defined
-#define IN_SOURCE(x) 1
-
-EOF
- }
-
my $in_comment = 0;
my $in_skipped_section = 0;
@@ -107,9 +87,29 @@ while (<>)
next;
}
- if ($_ =~ /^\#if.*(IN_SOURCE|IN_HEADER)/)
+ if ($_ =~ /^\#if.*IN_SOURCE\((.*)\)/)
{
- print $_;
+ if ($option_def)
+ {
+ print "#ifdef $1\n";
+ }
+ else
+ {
+ print "#if 1\n";
+ }
+ next;
+ }
+
+ if ($_ =~ /^\#if.*IN_HEADER\((.*)\)/)
+ {
+ if ($option_def)
+ {
+ print "#if 1\n";
+ }
+ else
+ {
+ print "#ifdef $1\n";
+ }
next;
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list