1. 02 Mar, 2019 1 commit
    • Christoph Reiter's avatar
      ccompiler: restore customize_compiler() setup for macOS. See #268 · d7524c9d
      Christoph Reiter authored
      The original customize_compiler() calls into  _osx_support.customize_compiler()
      the first time it is used and I didn't copy it in !118 because it is private API.
      
      Issue #268 points out that the macOS build is broken now so I guess that was important
      in some way. Make sure the setup code is run by calling the original customize_compiler()
      with a dummy compiler instance.
      d7524c9d
  2. 16 Jan, 2019 1 commit
  3. 13 Jan, 2019 1 commit
  4. 10 Jan, 2019 4 commits
    • Tomasz Mi膮sko's avatar
      Restore original meaning of disguised attribute. · f606183a
      Tomasz Mi膮sko authored
      > Certain types like GIConv and GdkAtom are pointers internally but don't
      > look like pointers when referenced. They have the form.
      >
      >  typedef struct _X *X;
      >
      > Parse these as structures/records but mark them in the gir with a 'disguised'
      > attribute so that we know that they need special handling.
      
      Additionally, stop relaying on disguised attribute when deciding whether
      to render a page. Check number of fields instead, so as to avoid
      introducing large regression in the docs.
      
      Fixes #101.
      f606183a
    • Christoph Reiter's avatar
    • Christoph Reiter's avatar
      maintransformer: when the namespace is empty use error() instead of fatal() · 3b630bfb
      Christoph Reiter authored
      network-manager is calling things like this during configure:
      g-ir-scanner --namespace=test --library=c /dev/null --output /dev/null
      to test if the scanner is working. This results in a fatal error, but
      beause of #229 was ignored.
      
      Do keep this working after we fix #229 downgrade this to a simple recoverable
      error message. An empty namespace doesn't prevent the scanner from creating
      a .gir file so this should be fine.
      3b630bfb
    • Christoph Reiter's avatar
      message: simplify handling of error levels · 06a460b3
      Christoph Reiter authored
      Instead of allowing each error level to be enabled just enable all of them
      through the enable_warnings() method. This matches what the code is currently
      doing (minus that one helper script) and simplifies things.
      
      Also remove the error count, it's not used.
      06a460b3
  5. 09 Jan, 2019 2 commits
  6. 08 Jan, 2019 2 commits
  7. 07 Jan, 2019 1 commit
    • Tomasz Mi膮sko's avatar
      scanner: Flatten multi-dimensional arrays fields · d020c524
      Tomasz Mi膮sko authored
      Provide partial support for multi-dimensional arrays by representing
      them as flattened one dimensional array with size that is equal to
      product of sizes in each dimension. Previously only the first dimension
      would be actually used.
      
      This should be sufficient to ensure that those fields have layout
      compatible with C, without using nested array types that are currently
      unsupported by vapigen
      
      Issue #255.
      d020c524
  8. 06 Jan, 2019 3 commits
    • Tomasz Mi膮sko's avatar
      scanner: Remove incorrect c:type generated for array of synthesized unions · 58e97dc1
      Tomasz Mi膮sko authored
      This also reverts workaround introduced to support this use case in
      f77cfc42, since it is no longer
      necessary.
      
      Fixes issue #141.
      58e97dc1
    • Tomasz Mi膮sko's avatar
      scanner: Remove incorrect c:type from fields with array type · 1f0965e3
      Tomasz Mi膮sko authored
      Neither `_create_source_type` nor `_create_complete_source_type`
      actually support fixed size arrays, so previously generated C types were
      incorrect.
      
      Remove C types from array fields instead of producing incorrect ones.
      
      Fixes issue #145.
      1f0965e3
    • Christoph Reiter's avatar
      scanner: rework source root guessing code · ea11f9cb
      Christoph Reiter authored
      commonprefix doesn't work on relative paths and doesn't return directories so
      so for the g-i build case it returned an empty string resulting in paths
      relative to the working directory, making the build not reproducible.
      
      To somehwat improve this make sure the paths are absolute, use commonpath
      and if no common dir can be found just fall back to passing all directories
      so we only write the basenames.
      
      I guess we should look into passing --sources-top-dirs in the g-i build.
      ea11f9cb
  9. 05 Jan, 2019 2 commits
  10. 03 Jan, 2019 1 commit
  11. 01 Jan, 2019 1 commit
  12. 30 Dec, 2018 1 commit
  13. 29 Dec, 2018 4 commits
    • Emmanuele Bassi's avatar
      Do not bail out when parsing GIR files without doc positions · b20b7194
      Emmanuele Bassi authored
      The position attributes on a <doc> element are not mandatory, so we
      should have some fallback value if they are missing.
      
      Fixes: #252
      b20b7194
    • Christoph Reiter's avatar
      ccompiler: don't use Python compiler flags. Fixes #150 · c14d0372
      Christoph Reiter authored
      Only use flags provided by env vars from the user and never from the
      Python sysconfig. The sysconfig values depend on the way Python was built,
      might conflict when using g-i with a different compiler and can't be controlled
      by the g-i user.
      c14d0372
    • Christoph Reiter's avatar
      ccompiler: include a version of customize_compiler() from CPython · 508ec4aa
      Christoph Reiter authored
      So we have more control over it.
      
      This also removes all macOS specific bits from it because I'm not sure if they are
      needed and they depend in internal API. This means this change can cause functional
      changes. Please report if you hit any!
      508ec4aa
    • Tomasz Mi膮sko's avatar
      Test commands executed by unix C compiler. · 3126ad5b
      Tomasz Mi膮sko authored
      No functional changes intended.
      
      Tests check that:
      * Compiler is obtained from CC.
      * cc is used as the default compiler.
        Currently not true as a Python build time compiler is used as the default.
      * Preprocessor is obtained from CC when CPP is unspecified by adding -E.
      * Preprocessor is obtained from CPP.
      * cpp is used as the default preprocessor.
        Currently not true as Python build time preprocessor is used as the default.
      * Shell word splitting rules are used to split CC.
      * Shell word splitting rules are used to split CPP.
      * Deprecation warnings are disabled during compilation.
      * Preprocessing step includes CPPFLAGS.
      * Compilation step includes both CFLAGS and CPPFLAGS, in that order.
      * Macros from CFLAGS are defined only once.
        Currently not true as they are defined twice.
      * Flags that would retain macros after preprocessing step are filtered out.
        Currently only partially true as they aren't filtered out from CPPFLAGS.
      * Preprocessing step includes flag that preserves comments.
      * Preprocessing step includes current working directory.
      * Complete preprocessing command doesn't contain anything unexpected.
        Currently not true as Python build time CPPFLAGS are included as well.
      * Complete build command doesn't contain anything unexpected.
        Currently not true as Python build time CFLAGS and CPPFLAGS are included as well.
      3126ad5b
  14. 21 Dec, 2018 1 commit
    • Christoph Reiter's avatar
      scanner: make using bool without stdbool include work again. Fixes #247 · 6d17dd7c
      Christoph Reiter authored
      With !45 special casing of bool in the lexer was removed which previously allowed the usage of
      bool without including stdbool.h. This breaks scanning of graphene headers
      which guarded the stdbool include with __GI_SCANNER__ (I haven't figured out why).
      
      Add back the special handling for bool in the lexer and also map it to gboolean like
      _Bool as if stdbool.h was included.
      6d17dd7c
  15. 20 Dec, 2018 1 commit
  16. 18 Dec, 2018 1 commit
  17. 17 Dec, 2018 4 commits
  18. 09 Dec, 2018 2 commits
  19. 08 Dec, 2018 4 commits
  20. 06 Dec, 2018 2 commits
  21. 04 Dec, 2018 1 commit
    • Tomasz Mi膮sko's avatar
      scanner: Replace use of typeof with void token · dca00682
      Tomasz Mi膮sko authored
      This makes it possible to parse inputs where typeof is used as part of
      cast expression, e.g., in g_object_ref macro expansion. Selection of
      VOID is arbitrary since there is no actual implementation of typeof.
      dca00682