Xref: utzoo comp.windows.x:6933 gnu.gcc:133 Path: utzoo!attcan!uunet!bu-cs!spdcc!husc6!purdue!spaf From: spaf@cs.purdue.EDU (Gene Spafford) Newsgroups: comp.windows.x,gnu.gcc Subject: Little known fix to use dbm & gcc together Message-ID: <5692@medusa.cs.purdue.edu> Date: 23 Dec 88 04:17:00 GMT Sender: news@cs.purdue.EDU Reply-To: spaf@uther.cs.purdue.edu (Gene Spafford) Organization: Department of Computer Science, Purdue University Lines: 53 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