summaryrefslogtreecommitdiff
path: root/reference/C/CONTRIB/SNIP/toolkit.h
diff options
context:
space:
mode:
Diffstat (limited to 'reference/C/CONTRIB/SNIP/toolkit.h')
-rwxr-xr-xreference/C/CONTRIB/SNIP/toolkit.h66
1 files changed, 66 insertions, 0 deletions
diff --git a/reference/C/CONTRIB/SNIP/toolkit.h b/reference/C/CONTRIB/SNIP/toolkit.h
new file mode 100755
index 0000000..d7ba5a7
--- /dev/null
+++ b/reference/C/CONTRIB/SNIP/toolkit.h
@@ -0,0 +1,66 @@
+/*
+** This is a copyrighted work which is functionally identical to work
+** originally published in Micro Cornucopia magazine (issue #52, March-April,
+** 1990) and is freely licensed by the author, Walter Bright, for any use.
+*/
+
+/*_ toolkit.h Tue Apr 18 1989 Modified by: Walter Bright */
+
+#ifndef TOOLKIT_H
+#define TOOLKIT_H
+
+/* Define stuff that's different between machines.
+ * PROTOTYPING 1 if compiler supports prototyping
+ * HOSTBYTESWAPPED 1 if on the host machine the bytes are
+ * swapped (1 for 6809, 68000, 0 for 8088
+ * and VAX).
+ */
+
+#ifdef MSDOS
+#define PROTOTYPING 1
+#define HOSTBYTESWAPPED 0
+
+#define BITSPERBYTE 8
+#define SIZEOFINT sizeof(int)
+#define SIZEOFLONG sizeof(long)
+
+#else
+#ifdef M_UNIX /* SCO UNIX using Microsoft C. */
+#define PROTOTYPING 1
+#define HOSTBYTESWAPPED 0
+#define EXIT_SUCCESS 0
+#define EXIT_FAILURE 1
+
+#define BITSPERBYTE 8
+#define SIZEOFINT sizeof(int)
+#define SIZEOFLONG sizeof(long)
+#else /* NOTE: host.h is *NOT* included in SNIPPETS */
+#include "host.h" /* Compiler/environment-specific stuff goes here */
+#endif
+
+#endif
+
+/* Static definitions do not appear in the linker .MAP file. Override */
+/* the definition here to make them global if necessary. */
+#ifndef STATIC
+#define STATIC static
+#endif
+
+#define arraysize(array) (sizeof(array) / sizeof(array[0]))
+
+/* Macros so that we can do prototyping, but still work with non- */
+/* prototyping compilers: */
+
+#if PROTOTYPING
+#define P(s) s
+#else
+#define P(s) ()
+#endif
+
+#ifdef DEBUG
+#define debug(a) (a)
+#else
+#define debug(a)
+#endif
+
+#endif /* TOOLKIT_H */