Skip to content

giscanner: Don't assume time_t and off_t are the same size as long and size_t

Simon McVittie requested to merge wip/smcv/issue494 into main
  • girparser: Don't assume sizeof(size_t) == sizeof(void *)

    We don't actually need to use the results of configure-time checks here: sizeof is a perfectly reasonable integer constant expression, so we can use that directly.

    Equivalent to glib!3966 (merged) in GLib.

  • girparser: Make sizes in integer_aliases more obviously correct

    We don't actually need to use the Meson-detected size macros here, because the result of sizeof() is an integer constant expression.

    No functional change. Equivalent to glib!3970 (merged) in GLib.

  • girparser: Allow time_t, off_t, etc. to appear in GIR XML

    g-ir-scanner currently maps these to lower-level types at scan time by assuming that time_t is an alias for long, off_t is an alias for size_t and so on. This is not always accurate: some ILP32 architectures have 64-bit time_t (for Y2038 compatibility) and 64-bit off_t (for large file support).

    One option for resolving this g-ir-scanner bug is to have it pass these types through to the GIR XML, and teach g-ir-compiler and its replacement gi-compile-repository to convert them to the corresponding concrete type tag, as they already do for abstract types such as long long and size_t.

    This is a gobject-introspection equivalent of glib!3967 (merged) and glib!3972 (merged), which in turn are based on part of !451 (closed) by Shuyu Liu.

    Helps: #494 (closed)
    Co-authored-by: @liushuyu

  • giscanner: treat time_t and off_t as standalone types

    From: @liushuyu

    g-ir-scanner previously mapped these to lower-level types at scan time by assuming that time_t is an alias for long and off_t is an alias for size_t. This is not always accurate: some ILP32 architectures have 64-bit time_t (for Y2038 compatibility) and 64-bit off_t (for large file support).

    [smcv: Added longer commit message]
    Resolves: #494 (closed)
    Co-authored-by: @smcv

  • tests: fix the tests after time_t and off_t are standalone types

    From: @liushuyu

  • tests: Add coverage for off_t

Merge request reports