Description: <short summary of the patch>
 TODO: Put a short summary on the line above and replace this paragraph
 with a longer explanation of this change. Complete the meta-information
 with other relevant fields (see below for details). To make it easier, the
 information below has been extracted from the changelog. Adjust it or drop
 it.
 .
 rock-master-20.01-typelib (0.20191212-1~jessie) unstable; urgency=low
 .
   * Package automatically built using 'apaka'
   * repository: github:/orocos-toolchain/typelib.git
   * branch: refs/heads/master
   * commit: 4aa9b2883206c7f97ecd18f8aa5697ea50a21975
   * tag:
Author: Rock Packaging Daemon (based on apaka) <rock-dev@dfki.de>

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: https://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: 2020-02-10

--- rock-master-20.01-typelib-0.20191212.orig/bindings/ruby/lib/typelib/gccxml.rb
+++ rock-master-20.01-typelib-0.20191212/bindings/ruby/lib/typelib/gccxml.rb
@@ -165,8 +165,7 @@ module Typelib
         end
 
         def initialize
-            @empty_compounds = Set.new
-            @opaques = Set.new
+            @opaques      = Set.new
             @id_to_name_parts   = Hash.new
             @id_to_name   = Hash.new
             @ignore_message = Hash.new
@@ -426,7 +425,7 @@ module Typelib
 
         def ignore(xmlnode, msg = nil)
             if msg
-                if (file = file_context(xmlnode))
+                if file = file_context(xmlnode)
                     warn("#{file}: #{msg}")
                 else
                     warn(msg)
@@ -595,25 +594,21 @@ module Typelib
                 else
                     # Make sure that we can digest it. Forbidden are: non-public members
                     base_classes = info.bases[xmlnode['id']].map do |child_node|
-                        base_type_name = resolve_type_id(child_node['type'])
-                        next if @empty_compounds.include?(child_node['type'].to_str)
-
-                        unless base_type_name
-                            msg = unless name.start_with?("/std/allocator")
-                                "ignoring #{name}, it has ignored base classes"
-                            end
-                            return ignore(xmlnode, msg)
-                        end
-
-                        base_type = registry.get(base_type_name)
                         if child_node['virtual'] != '0'
                             return ignore(xmlnode, "ignoring #{name}, it has virtual base classes")
                         elsif child_node['access'] != 'public'
                             return ignore(xmlnode, "ignoring #{name}, it has private base classes")
                         end
-                        [base_type, Integer(child_node['offset'] || '0')]
+                        if base_type_name = resolve_type_id(child_node['type'])
+                            base_type = registry.get(base_type_name)
+                            [base_type, Integer(child_node['offset'] || '0')]
+                        else
+                            msg = unless name.start_with?("/std/allocator")
+                                "ignoring #{name}, it has ignored base classes"
+                            end
+                            return ignore(xmlnode, msg)
+                        end
                     end
-                    base_classes = base_classes.compact
 
                     if xmlnode['incomplete'] == '1'
                         msg = unless name.start_with?("/std/allocator")
@@ -636,12 +631,10 @@ module Typelib
                             end
                         end
                     end.compact
-
                     if fields.empty? && base_classes.all? { |type, _| type.empty? }
                         msg = unless name =~ %r[^/[^/]+/new_allocator]
                             "ignoring the empty struct/class #{name}"
                         end
-                        @empty_compounds << xmlnode['id']
                         return ignore(xmlnode, msg)
                     end
 
@@ -914,7 +907,7 @@ module Typelib
             meta = doc.split("\n").grep(/^\s*@meta/)
             meta.each do |line|
                 if line =~ /^\s*@meta (\w+)\s+(.*)$/
-                    metadata.add($1, $2.strip)
+                    metadata.add($1, $2)
                 end
             end
         end
@@ -1061,6 +1054,8 @@ module Typelib
                 if options[:castxml]
                     call = [castxml_binary_name, "--castxml-gccxml", "-E", *includes, *defines, *rawflags, *castxml_default_options, io.path]
                 else
+                    rawflags.delete_if { |x| x =~ /-std=/ || x =~ /-pthread/  }
+                    puts "#{__FILE__} gccxml --preprocess tries to handle rawflags: #{rawflags}"
                     call = [gcc_binary_name, "--preprocess", *includes, *defines, *rawflags, *gccxml_default_options, io.path]
                 end
 
