]> Pileus Git - ~andy/gtk/blobdiff - gtk/makegtkalias.pl
Improve wording. String change! (#355128, David Lodge)
[~andy/gtk] / gtk / makegtkalias.pl
index b1b76d9560b2d8d7fc3b1845293a270bac36e22b..3011a577cc0bffb8bafc305d422440cfa07911b4 100755 (executable)
@@ -1,5 +1,12 @@
 #!/usr/bin/perl -w
 
+my $do_def = 0;
+
+if (($#ARGV >= 0) && ($ARGV[0] eq "-def")) {
+    shift;
+    $do_def = 1;
+}
+
 print <<EOF;
 /* Generated by makegtkalias.pl */
 
@@ -9,45 +16,30 @@ print <<EOF;
 
 #ifdef G_HAVE_GNUC_VISIBILITY
 
-#ifdef  GTK_ENABLE_BROKEN
-#define WAS_BROKEN
-#endif
-#define GTK_ENABLE_BROKEN
-
-#ifdef GTK_TEXT_USE_INTERNAL_UNSUPPORTED_API
-#define WAS_UNSUPPORTED_TEXT_API
+#ifndef GTK_DISABLE_DEPRECATED
+#define GTK_DISABLE_DEPRECATED
+#define REENABLE_DEPRECATED
 #endif
-#define GTK_TEXT_USE_INTERNAL_UNSUPPORTED_API
 
-#ifdef  GTK_DISABLE_DEPRECATED
-#define WAS_NO_DEPR
-#endif
-#undef  GTK_DISABLE_DEPRECATED
+EOF
 
-#ifdef  G_DISABLE_DEPRECATED
-#define WAS_NO_G_DEPR
-#endif
-#undef  G_DISABLE_DEPRECATED
+if ($do_def) {
+    print <<EOF
+#undef IN_FILE
+#define IN_FILE defined
 
-#include "gtk.h"
+#undef IN_HEADER
+#define IN_HEADER(x) 1
 
-#include "gtkfilesystem.h"
-#ifdef G_OS_UNIX
-#include "gtkfilesystemunix.h"
-#endif
-#ifdef G_OS_WIN32
-#include "gtkfilesystemwin32.h"
-#endif
-#include "gtkhsv.h"
-#include "gtkpathbar.h"
-#include "gtktextdisplay.h"
-#include "gtktextlayout.h"
-#include "gtktextsegment.h"
-#include "gtktexttypes.h"
-#include "gtkthemes.h"
-#include "gtkwindow-decorate.h"
+EOF
+} 
+else { 
+    print <<EOF
+#define IN_FILE(x) 1
+#define IN_HEADER defined
 
 EOF
+}
 
 my $in_comment = 0;
 my $in_skipped_section = 0;
@@ -86,7 +78,7 @@ while (<>) {
       next;
   }
 
-  if ($_ =~ /^\#ifdef\s+INCLUDE_VARIABLES/)
+  if ($_ =~ /^\#ifdef\s+(INCLUDE_VARIABLES|ALL_FILES)/)
   {
       $in_skipped_section = 1;
   }
@@ -96,13 +88,20 @@ while (<>) {
       next;
   }
 
-  if ($_ =~ /^\#ifdef\s+G/)
+  if ($_ =~ /^\#ifn?def\s+G/)
   {
       print $_;
       
       next;
   }
  
+  if ($_ =~ /^\#if.*(IN_FILE|IN_HEADER)/)
+  {
+      print $_;
+      
+      next;
+  }
+
   chop;
   my $str = $_;
   my @words;
@@ -118,40 +117,28 @@ while (<>) {
       $attributes = "$attributes $word" unless $word eq "PRIVATE";
   }
       
-  print <<EOF
+  if (!$do_def) {
+    print <<EOF
 extern __typeof ($str) $alias __attribute((visibility("hidden")))$attributes;
-extern __typeof ($str) $str __attribute((alias("$alias"), visibility("default")));
 \#define $str $alias
 
 EOF
+  }
+  else {
+    print <<EOF
+\#undef $str 
+extern __typeof ($str) $str __attribute((alias("$alias"), visibility("default")));
+
+EOF
+  }
 }
 
 print <<EOF;
-
-#ifndef WAS_BROKEN
-#undef  GTK_ENABLE_BROKEN
-#else
-#undef  WAS_BROKEN
-#endif
-
-#ifndef WAS_UNSUPPORTED_TEXT_API
-#undef GTK_TEXT_USE_INTERNAL_UNSUPPORTED_API
-#else
-#undef WAS_UNSUPPORTED_TEXT_API
-#endif
-
-#ifdef  WAS_NO_DEPR
-#define GTK_DISABLE_DEPRECATED
-#undef  WAS_NO_DEPR
-#endif
-
-#ifdef  WAS_NO_G_DEPR
-#define G_DISABLE_DEPRECATED
-#undef  WAS_NO_G_DEPR
+#ifdef REENABLE_DEPRECATED
+#undef GTK_DISABLE_DEPRECATED
 #endif
 
 #endif /* G_HAVE_GNUC_VISIBILITY */
-
 #endif /* DISABLE_VISIBILITY */
 EOF