Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-4648

c_glib namespaces incorrect includes

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.11.0
    • Fix Version/s: 0.12.0
    • Component/s: C glib - Compiler
    • Labels:
      None
    • Environment:

      Description

      When using namespaces for c_glib compiler generates incorrect code for #includes.

      Example:
      first.thrift

      namespace c_glib F
        
      struct first {
              1: i32 test
      }
      

      and second.thrift

      namespace c_glib S
        
      include "first.thrift"
      
      struct second {
              1: first.first second
      }
      

      As you can see, we use namespace F in first.thrift and namespace S in second.thrift.
      The compiler generates correct file names for those thrifts:

      $ ls gen-c_glib/
      f_first_types.c  f_first_types.h  s_second_types.c  s_second_types.h
      

      However, when generating s_second_types.h it uses namespace from second.thrift instead of the one defined for first.thrift when generating #include statement.

      /* base includes */
      #include <glib-object.h>
      #include <thrift/c_glib/thrift_struct.h>
      #include <thrift/c_glib/protocol/thrift_protocol.h>
      /* other thrift includes */
      #include "s_first_types.h"
      

      It should use #include "f_first_types.h"

        Attachments

        1. first.thrift
          0.0 kB
          Matej Kupljen
        2. second.thrift
          0.1 kB
          Matej Kupljen

          Issue Links

            Activity

              People

              • Assignee:
                simonsouth Simon South
                Reporter:
                matejkupljen Matej Kupljen
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: