[Xfce4-commits] [xfce/xfce4-panel] 01/01: Fix this use of "defined" may not be portable

noreply at xfce.org noreply at xfce.org
Sun Apr 14 23:47:28 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/xfce4-panel.

commit 321bf70972a1313054463eac9b1648fdbf0ba393
Author: Andre Miranda <andreldm at xfce.org>
Date:   Sun Apr 14 18:46:54 2019 -0300

    Fix this use of "defined" may not be portable
---
 libxfce4panel/Makefile.am                 |  1 -
 libxfce4panel/make-libxfce4panel-alias.pl | 44 +++++++++++++++----------------
 2 files changed, 22 insertions(+), 23 deletions(-)

diff --git a/libxfce4panel/Makefile.am b/libxfce4panel/Makefile.am
index 51ce297..f947da0 100644
--- a/libxfce4panel/Makefile.am
+++ b/libxfce4panel/Makefile.am
@@ -5,7 +5,6 @@ AM_CPPFLAGS = \
 	-DG_LOG_DOMAIN=\"libxfce4panel\" \
 	-DLIBXFCE4PANEL_COMPILATION \
 	-DPACKAGE_LOCALE_DIR=\"$(localedir)\" \
-	-Wno-expansion-to-defined \
 	$(PLATFORM_CPPFLAGS)
 
 lib_LTLIBRARIES = \
diff --git a/libxfce4panel/make-libxfce4panel-alias.pl b/libxfce4panel/make-libxfce4panel-alias.pl
index 9d6af39..a21a6f1 100644
--- a/libxfce4panel/make-libxfce4panel-alias.pl
+++ b/libxfce4panel/make-libxfce4panel-alias.pl
@@ -35,26 +35,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;
 
@@ -106,9 +86,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