From owner-freebsd-current Thu Apr 6 23:10:49 1995 Return-Path: current-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id XAA24067 for current-outgoing; Thu, 6 Apr 1995 23:10:49 -0700 Received: from pelican.com (pelican.com [134.24.4.62]) by freefall.cdrom.com (8.6.10/8.6.6) with SMTP id XAA24061 for ; Thu, 6 Apr 1995 23:10:47 -0700 Received: by pelican.com (Smail3.1.28.1 #5) id m0rx7FZ-000K0iC; Thu, 6 Apr 95 23:10 WET DST Message-Id: From: pete@pelican.com (Pete Carah) Subject: preprocessor conflict in proj.4 (geodesic.h) To: gie@charon.er.usgs.gov Date: Thu, 6 Apr 1995 23:10:33 -0700 (PDT) Cc: current@FreeBSD.org X-Mailer: ELM [version 2.4 PL23] Content-Type: text Content-Length: 1445 Sender: current-owner@FreeBSD.org Precedence: bulk In freebsd (2.1 alpha) I had a serious problem with geodesic.h: it defines a and f; these are very common preprocessor arguments for other macros in system libraries. This causes ctype.h to fail. since f is a free argument to a bunch of macros, and GEODESIC.FLAT isn't a valid C identifier... I can see two ways around this - the easiest is to move the include of this to after all system include files. The best is to use underscores everywhere in either the system includes or your own; I don't know what the ansi committee has to say about this; my copy of "? & Steele" is put away and K&R don't get into this kind of detail. I'm cc'ing this to the freebsd group in case those dummy args should have underscores. The offending define is geodesic.h:# define f GEODESIC.FLAT ---------------------------------------------------------------- and lines in ctype.h: #if defined(_USE_CTYPE_INLINE_) static __inline int __istype(_BSD_RUNE_T_ c, unsigned long f) { if (c < 0) c = (unsigned char) c; return((((c & _CRMASK) ? ___runetype(c) : _CurrentRuneLocale->runetype[c]) & f) ? 1 : 0); } ------------------------------------------------------------------- For now I can probably get away with defining _USE_CTYPE_CLIBRARY_ to avoid these definitions. Jordan, Terry, Garrett? Is anyone familiar enough with the ANSI system-include rules to know if we (freebsd) have a problem here? -- Pete