-#define SRD_OK 0 /**< No error */
-#define SRD_ERR -1 /**< Generic/unspecified error */
-#define SRD_ERR_MALLOC -2 /**< Malloc/calloc/realloc error */
-#define SRD_ERR_ARG -3 /**< Function argument error */
-#define SRD_ERR_BUG -4 /**< Errors hinting at internal bugs */
-#define SRD_ERR_PYTHON -5 /**< Python C API error */
-#define SRD_ERR_DECODERS_DIR -6 /**< Protocol decoder path invalid */
+
+/** Status/error codes returned by libsigrokdecode functions. */
+enum {
+ SRD_OK = 0, /**< No error */
+ SRD_ERR = -1, /**< Generic/unspecified error */
+ SRD_ERR_MALLOC = -2, /**< Malloc/calloc/realloc error */
+ SRD_ERR_ARG = -3, /**< Function argument error */
+ SRD_ERR_BUG = -4, /**< Errors hinting at internal bugs */
+ SRD_ERR_PYTHON = -5, /**< Python C API error */
+ SRD_ERR_DECODERS_DIR = -6, /**< Protocol decoder path invalid */
+
+ /*
+ * Note: When adding entries here, don't forget to also update the
+ * srd_strerror() and srd_strerror_name() functions in error.c.
+ */
+};