[glibmm] gmmproc: Put guards around generated includes in wrap_init.cc
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glibmm] gmmproc: Put guards around generated includes in wrap_init.cc
- Date: Thu, 5 May 2011 09:49:21 +0000 (UTC)
commit 63015f5da07c0d93982445224d7ef30f1c10241c
Author: Kalev Lember <kalev smartlink ee>
Date: Mon May 2 16:22:28 2011 +0300
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
ChangeLog | 8 ++++++++
tools/generate_wrap_init.pl.in | 9 +++++----
2 files changed, 13 insertions(+), 4 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 987fd9b..ee7fbcf 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 cf5339d..ac11966 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";
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]