[net.lang.c] ifdef"s for BSD, USG?

mark@cbosgd.UUCP (05/21/83)

The "intent" of the VMUNIX ifdef was to indicate that virtual (e.g. lots
of) memory is available.  vi uses it for this as well as sdb.  So it
is reasonable to define VMUNIX on some future version of USG that has
paging, or on a 370.  VFORK normally has its own ifdef.

While I strongly recommend that <stdio.h> or cpp define a constant
to detect the UNIX version (e.g.
	#define USG 6.0
or
	#define BSD 4.2
), so far neither has done so.  (Anyone out there in either group
listening?)  This would allow
	#if BSD >= 4.2
assuming floating point works in cpp - if not you'd have to omit
the decimal point.

A working kludge is do do
	#include <stdio.h>
	#ifdef L_ctermid
	# define USG
	#else
	# define V7
	#endif
although at any future time this might not be a reliable indicator.
It does work for System V and 4.1BSD.