From ccfb2c2e6c71bbadf3f7f74b19b4c4128a1a09b6 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 8 Apr 2020 20:30:05 +0200 Subject: [PATCH] introduce enum for generic return values --- src/include/gnunet_common.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/include/gnunet_common.h b/src/include/gnunet_common.h index d84f9d77e..212c78f54 100644 --- a/src/include/gnunet_common.h +++ b/src/include/gnunet_common.h @@ -80,10 +80,15 @@ extern "C" { * GNUNET_SYSERR`, `GNUNET_OK != GNUNET_NO`, `GNUNET_NO != * GNUNET_SYSERR` and finally `GNUNET_YES != GNUNET_NO`. */ -#define GNUNET_OK 1 -#define GNUNET_SYSERR -1 -#define GNUNET_YES 1 -#define GNUNET_NO 0 +enum GNUNET_GenericReturnValue +{ + GNUNET_SYSERR = -1, + GNUNET_NO = 0, + GNUNET_OK = 1, + /* intentionally identical to #GNUNET_OK! */ + GNUNET_YES = 1, +}; + #define GNUNET_MIN(a, b) (((a) < (b)) ? (a) : (b)) -- 2.25.1