summaryrefslogtreecommitdiff
path: root/dis88/ansi.h
diff options
context:
space:
mode:
authorRobert de Bath <rdebath@poboxes.com>1996-03-24 17:45:55 +0100
committerLubomir Rintel <lkundrak@v3.sk>2013-10-23 23:29:43 +0200
commitfe22c37817ce338fbbc90b239320248c270957fa (patch)
treed9550410c4a20bdd382fcc58d2d3d7c5e04e5245 /dis88/ansi.h
parenta7aba15e8efffb1c5d3097656f1a93955a64f01f (diff)
parent42192453ea219b80d0bf9f41e51e36d3d4d0740b (diff)
downloaddev86-fe22c37817ce338fbbc90b239320248c270957fa.tar.gz
Import Dev86-0.0.4.tar.gzv0.0.4
Diffstat (limited to 'dis88/ansi.h')
-rw-r--r--dis88/ansi.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/dis88/ansi.h b/dis88/ansi.h
new file mode 100644
index 0000000..825b4a6
--- /dev/null
+++ b/dis88/ansi.h
@@ -0,0 +1,58 @@
+/* The <ansi.h> header attempts to decide whether the compiler has enough
+ * conformance to Standard C for Minix to take advantage of. If so, the
+ * symbol _ANSI is defined (as 31415). Otherwise _ANSI is not defined
+ * here, but it may be defined by applications that want to bend the rules.
+ * The magic number in the definition is to inhibit unnecessary bending
+ * of the rules. (For consistency with the new '#ifdef _ANSI" tests in
+ * the headers, _ANSI should really be defined as nothing, but that would
+ * break many library routines that use "#if _ANSI".)
+
+ * If _ANSI ends up being defined, a macro
+ *
+ * _PROTOTYPE(function, params)
+ *
+ * is defined. This macro expands in different ways, generating either
+ * ANSI Standard C prototypes or old-style K&R (Kernighan & Ritchie)
+ * prototypes, as needed. Finally, some programs use _CONST, _VOIDSTAR etc
+ * in such a way that they are portable over both ANSI and K&R compilers.
+ * The appropriate macros are defined here.
+ */
+
+#ifndef _ANSI_H
+#define _ANSI_H
+
+#if __STDC__ == 1
+#define _ANSI 31459 /* compiler claims full ANSI conformance */
+#endif
+
+#ifdef __GNUC__
+#define _ANSI 31459 /* gcc conforms enough even in non-ANSI mode */
+#endif
+
+#ifdef _ANSI
+
+/* Keep everything for ANSI prototypes. */
+#define _PROTOTYPE(function, params) function params
+#define _ARGS(params) params
+
+#define _VOIDSTAR void *
+#define _VOID void
+#define _CONST const
+#define _VOLATILE volatile
+#define _SIZET size_t
+
+#else
+
+/* Throw away the parameters for K&R prototypes. */
+#define _PROTOTYPE(function, params) function()
+#define _ARGS(params) ()
+
+#define _VOIDSTAR void *
+#define _VOID void
+#define _CONST
+#define _VOLATILE
+#define _SIZET int
+
+#endif /* _ANSI */
+
+#endif /* ANSI_H */