summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/leb128.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/common/leb128.h b/src/common/leb128.h
index 0364cf7..398785f 100644
--- a/src/common/leb128.h
+++ b/src/common/leb128.h
@@ -26,6 +26,7 @@
#include <stdbool.h>
+#include <stdlib.h>
#include "../arch/archbase.h"
@@ -37,6 +38,16 @@ typedef uint64_t uleb128_t;
typedef int64_t leb128_t;
+/* Récupération de la valeur absolue */
+#define leb128_abs(v) llabs(v)
+
+
+/* Valeurs minimales et maximales */
+#define ULEB128_MIN UINT64_MIN
+#define ULEB128_MAX UINT64_MAX
+#define LEB128_MIN INT64_MIN
+#define LEB128_MAX INT64_MAX
+
/* Lit un nombre non signé encodé au format LEB128. */
bool read_uleb128(uleb128_t *, const bin_t *, off_t *, off_t);