summaryrefslogtreecommitdiffstats
path: root/src/misc/st
diff options
context:
space:
mode:
Diffstat (limited to 'src/misc/st')
-rw-r--r--src/misc/st/st.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/misc/st/st.c b/src/misc/st/st.c
index e1e5022a..892a33af 100644
--- a/src/misc/st/st.c
+++ b/src/misc/st/st.c
@@ -8,13 +8,27 @@
*
*/
#include <stdio.h>
-#include "extra.h"
+//#include "extra.h"
#include "st.h"
#ifndef ABS
# define ABS(a) ((a) < 0 ? -(a) : (a))
#endif
+#ifndef ALLOC
+#define ALLOC(type, num) ((type *) malloc(sizeof(type) * (num)))
+#endif
+
+#ifndef FREE
+#define FREE(obj) ((obj) ? (free((char *) (obj)), (obj) = 0) : 0)
+#endif
+
+#ifndef REALLOC
+#define REALLOC(type, obj, num) \
+ ((obj) ? ((type *) realloc((char *)(obj), sizeof(type) * (num))) : \
+ ((type *) malloc(sizeof(type) * (num))))
+#endif
+
#define ST_NUMCMP(x,y) ((x) != (y))
#define ST_NUMHASH(x,size) (ABS((long)x)%(size))
#define ST_PTRHASH(x,size) ((int)((unsigned long)(x)>>2)%size)