summaryrefslogtreecommitdiff
path: root/gtk/makegtkalias.pl
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2005-03-20 07:01:23 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2005-03-20 07:01:23 +0000
commitcca8dd63475ab582d8592039f1f69d7f22a3b928 (patch)
treef800dcc62e1ab8a0010e774a05e669b14c3ff5e1 /gtk/makegtkalias.pl
parentb39b0bfc0471258285169113bc176320b0b5ae71 (diff)
downloadgtk+-cca8dd63475ab582d8592039f1f69d7f22a3b928.tar.gz
Make PLT-reduction work with gcc4, and don't include everything in
2005-03-20 Matthias Clasen <mclasen@redhat.com> Make PLT-reduction work with gcc4, and don't include everything in gdkalias.h: * gtk/grk.symbols: Group symbols by header and source file. * gtk/makegtkalias.pl: Protect definitions by the same preprocessor symbols used to guard the headers. Move the alias declarations to a separate file which is produced when calling makegtkalias.pl -def * gdk/Makefile.am (gtkaliasdef.c): Add a rule to generate this file. * gtk/*.c: Include gtkalias.h after the other headers, include gtkaliasdef.c at the bottom. * gtk/*.h: Small cleanups.
Diffstat (limited to 'gtk/makegtkalias.pl')
-rwxr-xr-xgtk/makegtkalias.pl103
1 files changed, 45 insertions, 58 deletions
diff --git a/gtk/makegtkalias.pl b/gtk/makegtkalias.pl
index b1b76d9560..3011a577cc 100755
--- a/gtk/makegtkalias.pl
+++ b/gtk/makegtkalias.pl
@@ -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