[gnu.gcc] Little known fix to use dbm & gcc together

spaf@cs.purdue.EDU (Gene Spafford) (12/23/88)

If you apply the following patch to the dbm.h file, you can
directly use dbm calls in code compiled by gcc without having
to recompile the dbm library.

Basically, code compiled by gcc and code compiled by pcc return
structures in different formats.  Thus, functions that return structures
(like "fetch" and "firstkey") are no longer compatible.  This is most
often noticed when compiling the X code with gcc when all windows come
up in a uniform black color.

To apply, do the following:

cd to your gcc-include directory
cp /usr/include/dbm.h .
patch -l dbm.h < the enclosed diff
chmod 444 dbm.h

Diff:
*** /usr/include/dbm.h	Mon Sep 15 14:19:18 1986
--- ./dbm.h	Wed Nov 23 09:09:31 1988
***************
*** 25,28 ****
--- 25,41 ----
  } datum;
  
+ #ifdef __GNUC__
+ 
+ datum	*fetch();
+ #define fetch *fetch
+ datum	*firstkey();
+ #define firstkey *firstkey
+ datum	*nextkey();
+ #define nextkey *nextkey
+ datum   *makdatum();
+ #define makdatum *makdatum
+ datum   *firsthash();
+ #define firsthash *firsthash
+ #else
  datum	fetch();
  datum	makdatum();
***************
*** 30,33 ****
--- 43,47 ----
  datum	nextkey();
  datum	firsthash();
+ #endif
  long	calchash();
  long	hashinc();
-- 
Gene Spafford
NSF/Purdue/U of Florida  Software Engineering Research Center,
Dept. of Computer Sciences, Purdue University, W. Lafayette IN 47907-2004
Internet:  spaf@cs.purdue.edu	uucp:	...!{decwrl,gatech,ucbvax}!purdue!spaf