summaryrefslogtreecommitdiff
path: root/nios2sim-ng.h
diff options
context:
space:
mode:
Diffstat (limited to 'nios2sim-ng.h')
-rw-r--r--nios2sim-ng.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/nios2sim-ng.h b/nios2sim-ng.h
index e4f4bcf..9be1d0d 100644
--- a/nios2sim-ng.h
+++ b/nios2sim-ng.h
@@ -5,18 +5,20 @@
#ifndef _NIOS2SIM_NG_H_
#define _NIOS2SIM_NG_H_
-#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
#include "bits.h"
#include "compiler.h"
+#include "util.h"
extern bool verbose;
#define __round_mask(x, y) ((__typeof__(x))((y) - 1))
#define round_up(x, y) ((((x) - 1) | __round_mask(x, y)) + 1)
+#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
+
#define err(fmt, args...) fprintf(stderr, "Error: " fmt, ##args)
#define warn(fmt, args...) fprintf(stderr, "Warning: " fmt, ##args)
#define info(fmt, args...) fprintf(stdout, fmt, ##args)