Skip to content
  • Eugene Kim's avatar
    (Re)define ssize_t as make_signed<size_t> · 4cd343c4
    Eugene Kim authored
    On macOS, the previous code chose int64_t as ssize_t, and int64_t is
    defined as long long, but ssize_t had been defined as long (despite also
    being 8 bytes).  This caused the typedef to be non-idempotent.
    
    make_signed<size_t> chooses the right counterpart, depending on the base
    type of size_t, e.g. unsigned long -> long, unsigned long long -> long
    long, which is more robust when there are distinct base integer types
    with the same size.
    4cd343c4