Skip to content
This repository has been archived by the owner on Jun 16, 2018. It is now read-only.

Commit

Permalink
Remove convoluted and obsolete detection of correct malloc.h.
Browse files Browse the repository at this point in the history
This is from xv-20130213-hints-for-macosx-snow-leopard.msgs.

Very few modern systems have a malloc.h anymore.  malloc() and friends
now live in stdlib.h. Anyone who _does_ need it can explicitly define
NEED_MALLOC_H in the makefile.
  • Loading branch information
DavidGriffith committed May 1, 2017
1 parent b91710b commit 7b65fd6
Showing 1 changed file with 15 additions and 34 deletions.
49 changes: 15 additions & 34 deletions vdcomp.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,40 +96,21 @@
#include <stdio.h>
#include <stdlib.h>

/* include a malloc.h of some sort (if needed...most systems use stdlib.h) */
#ifndef VMS /* VMS hates multi-line "#if"s */
/*
* I want to use BSD macro for checking if this OS is *BSD or not,
* but the macro is defined in <sys/parm.h>, which I don't know all
* machine has or not.
*/
# if !defined(ibm032) && \
!defined(__convex__) && \
!(defined(vax) && !defined(ultrix)) && \
!defined(mips) && \
!defined(apollo) && \
!defined(pyr) && \
!defined(sequent) && \
!defined(__UMAXV__) && \
!defined(aux) && \
!defined(bsd43) && \
!defined(__bsd43) && \
!defined(__bsdi__) && \
!defined(__386BSD__) && \
!defined(__FreeBSD__) && \
!defined(__OpenBSD__) && \
!defined(__NetBSD__) && \
!defined(__DARWIN__)

# if defined(hp300) || defined(hp800) || defined(NeXT)
# include <sys/malloc.h> /* it's in "sys" on HPs and NeXT */
# else
# include <malloc.h> /* FIXME: should explicitly list systems that NEED this, not everyone that doesn't */
# endif

# endif /* !most modern systems */
#endif /* !VMS */

/* DEG 20170501: Copied malloc detection code over from xv.h
* GRR 20070512: Very few modern systems even have a malloc.h anymore;
* stdlib.h is, well, the standard. (Former explicitly listed
* "don't include" systems: ibm032, __convex__, non-ultrix vax,
* mips, apollo, pyr, sequent, __UMAXV__, aux, bsd43, __bsd43,
* __bsdi__, __386BSD__, __FreeBSD__, __OpenBSD__, __NetBSD__,
* __DARWIN__, VMS.) Anyone who _does_ need it can explicitly
* define NEED_MALLOC_H in the makefile. */
#ifdef NEED_MALLOC_H
# if defined(hp300) || defined(hp800) || defined(NeXT)
# include <sys/malloc.h> /* it's in "sys" on HPs and NeXT */
# else
# include <malloc.h>
# endif
#endif

#include <X11/Xos.h>

Expand Down

0 comments on commit 7b65fd6

Please sign in to comment.