summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKalev Lember <kalev@smartlink.ee>2011-05-02 16:22:28 +0300
committerMurray Cumming <murrayc@murrayc.com>2011-05-05 11:49:13 +0200
commit63015f5da07c0d93982445224d7ef30f1c10241c (patch)
treef9daa7e6ad07a93bf89d40230c05149455640485
parente7b09675f6c6a3530dc415e6db506be8b5696a9f (diff)
downloadglibmm-63015f5da07c0d93982445224d7ef30f1c10241c.tar.gz
gmmproc: Put guards around generated includes in wrap_init.cc
* tools/generate_wrap_init.pl.in: Store include filenames in a hashmap (key: filename, value: cppname) so it is possible to print _DISABLE_DEPRECATED and G_OS_WIN32 guards around them. Bug #649182
-rw-r--r--ChangeLog8
-rw-r--r--tools/generate_wrap_init.pl.in9
2 files changed, 13 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 987fd9b0..ee7fbcf8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -23,6 +23,14 @@
2011-05-03 Kalev Lember <kalev@smartlink.ee>
+ gmmproc: Put guards around generated includes in wrap_init.cc
+
+ * tools/generate_wrap_init.pl.in: Store include filenames in a hashmap
+ (key: filename, value: cppname) so it is possible to print
+ _DISABLE_DEPRECATED and G_OS_WIN32 guards around them. Bug #649182
+
+2011-05-02 Kalev Lember <kalev@smartlink.ee>
+
gmmproc: Factored some copy-pasted code out to a common function
* tools/generate_wrap_init.pl.in: Added print_with_guards() subroutine
diff --git a/tools/generate_wrap_init.pl.in b/tools/generate_wrap_init.pl.in
index cf5339d6..ac11966e 100644
--- a/tools/generate_wrap_init.pl.in
+++ b/tools/generate_wrap_init.pl.in
@@ -10,7 +10,7 @@ my $function_prefix = "";
my $parent_dir = ""; # e.g. gtkmm
my $path = "gtk--";
my $debug = 0;
-my @filenames_headers = ();
+my %filenames_headers = ();
my %objects = ();
my %exceptions = ();
my %namespaces = (); # hashmap of lists of strings.
@@ -185,7 +185,7 @@ while ($ARGV[0])
# Store header filename so that we can #include it later:
my $filename_header = $filename;
$filename_header =~ s/.*\/([^\/]+)\.hg/$1.h/;
- push(@filenames_headers, $filename_header);
+ $filenames_headers{$filename_header} = $cppname;
shift @ARGV;
close(FILE);
@@ -210,9 +210,10 @@ print << "EOF";
EOF
-foreach( @filenames_headers )
+my $i = 0;
+foreach $i (sort keys %filenames_headers)
{
- print "#include \"" . $_ . "\"\n";
+ print_with_guards( $filenames_headers{$i}, "#include \"" . $i . "\"\n" );
}
print "\n";