1--- a/demos/programs/workspace/xrmLib.c
2+++ b/demos/programs/workspace/xrmLib.c
3@@ -30,7 +30,14 @@ static char rcsid[] = "$XConsortium: xrmLib.c /main/6 1995/07/14 10:01:41 drk $"
4 #endif
5
6 #include <stdio.h>
7-#include <malloc.h>
8+#if defined(__cplusplus) || defined(__STDC__) || defined(__EXTENSIONS__)
9+# include <stdlib.h>
10+# if defined(HAVE_MALLOC_H)
11+# include <malloc.h>
12+# elif defined(HAVE_SYS_MALLOC_H)
13+# include <sys/malloc.h>
14+# endif
15+#endif
16 #include <Xm/Xm.h>
17 #include "wsm.h"
18 #include "wsmDebug.h"
19