Browse Source

include: map VLC_EGENERIC to INT_MIN

VLC_EGENERIC has no equivalent in <errno.h>, so it should not alias any
<errno.h> value. This maps it to INT_MIN. It works because -INT_MIN equals
INT_MAX + 1, which is out of range of `int`. As a reminder codes in
<errno.h> are positive integers.

The convoluted definition is to avoid pulling <limits.h> into
<vlc_common.h> and from there all over the code base.
pull/128/head
Rémi Denis-Courmont 5 years ago
parent
commit
83541df6fa
  1. 2
      include/vlc_common.h

2
include/vlc_common.h

@ -469,7 +469,7 @@ typedef union
/** No error */
#define VLC_SUCCESS (-0)
/** Unspecified error */
#define VLC_EGENERIC (-1)
#define VLC_EGENERIC (-2 * (1 << (sizeof (int) * 8 - 2))) /* INT_MIN */
/** Not enough memory */
#define VLC_ENOMEM (-2)
/** Timeout */

Loading…
Cancel
Save