Skip to content

Make static assertions about standard types

Simon McVittie requested to merge wip/smcv/assert-standard-types into master
  • glib-init: Statically assert more facts about standard types

    This is a step towards #1484 (closed). We officially require a C99 toolchain, so we can statically assert that our artisanal hand-crafted integer types are compatible with the ones we would like to recommend people use instead.

    If there are still platforms where <stdint.h> is problematic, these static assertions can act as an early-warning that future GLib releases will make a C99-compliant <stdint.h> a hard requirement, in ways that are less straightforward to avoid (see #1484 (closed) and !1300 (closed)).

  • glib-unix: Assert that our portable types correspond to ssize_t and pid_t

    If this fails to compile on some particularly bizarre Unix platform, we can relax these assertions; but our expectation is that gssize is POSIX ssize_t, and that on Unix, GPid is POSIX pid_t.

/cc @ebassi

Edited by Simon McVittie

Merge request reports

Loading