about summary refs log tree commit diff stats
path: root/WWW/Library/Implementation/HTUtils.h
diff options
context:
space:
mode:
Diffstat (limited to 'WWW/Library/Implementation/HTUtils.h')
-rw-r--r--WWW/Library/Implementation/HTUtils.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/WWW/Library/Implementation/HTUtils.h b/WWW/Library/Implementation/HTUtils.h
index 06df62c6..cc75c29d 100644
--- a/WWW/Library/Implementation/HTUtils.h
+++ b/WWW/Library/Implementation/HTUtils.h
@@ -102,6 +102,11 @@
 #define	GCC_UNUSED /* nothing */
 #endif
 
+/* FIXME: need a configure-test */
+#if defined(__STDC__) || defined(__DECC) || defined(_WINDOWS) || _WIN_CC
+#define ANSI_PREPRO 1
+#endif
+
 #if defined(__CYGWIN__)			/* 1998/12/31 (Thu) 16:13:46 */
 #include <windows.h>		/* #include "windef.h" */
 #define BOOLEAN_DEFINED
@@ -279,6 +284,18 @@ Macros for declarations
 #define NULL ((void *)0)
 #endif
 
+/* array/table size */
+#define	TABLESIZE(v)	(sizeof(v)/sizeof(v[0]))
+
+/* Quiet compiler warnings on places where we're being blamed incorrectly,
+ * e.g., for casting away const, or for alignment problems.  It's always
+ * legal to cast a pointer to long w/o loss of precision.
+ */
+#define TYPECAST(type,ptr) (type*)((long)(ptr))
+
+#define	typecalloc(cast)		(cast *)calloc(sizeof(cast),1)
+#define	typecallocn(cast,ntypes)	(cast *)calloc(sizeof(cast),ntypes)
+
 /*
 
 OFTEN USED INTEGER MACROS