diff options
author | Kalev Lember <kalev@smartlink.ee> | 2011-05-02 16:22:28 +0300 |
---|---|---|
committer | Murray Cumming <murrayc@murrayc.com> | 2011-05-05 11:49:13 +0200 |
commit | 63015f5da07c0d93982445224d7ef30f1c10241c (patch) | |
tree | f9daa7e6ad07a93bf89d40230c05149455640485 | |
parent | e7b09675f6c6a3530dc415e6db506be8b5696a9f (diff) | |
download | glibmm-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-- | ChangeLog | 8 | ||||
-rw-r--r-- | tools/generate_wrap_init.pl.in | 9 |
2 files changed, 13 insertions, 4 deletions
@@ -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"; |