Date: Thu, 18 Oct 2007 07:50:33 -0700 (PDT) From: Abdullah Ibn Hamad Al-Marri <wearabnet@yahoo.ca> To: Ed Schouten <ed@fxq.nl> Cc: FreeBSD Current <freebsd-current@freebsd.org> Subject: Re: PCC and FreeBSD in the future? Message-ID: <766820.55482.qm@web33707.mail.mud.yahoo.com>
next in thread | raw e-mail | index | archive | help
----- Original Message ----=0A> From: Ed Schouten <ed@fxq.nl>=0A> To: Abdul= lah Ibn Hamad Al-Marri <wearabnet@yahoo.ca>=0A> Cc: FreeBSD Current <freebs= d-current@freebsd.org>=0A> Sent: Wednesday, October 17, 2007 9:27:58 PM=0A>= Subject: Re: PCC and FreeBSD in the future?=0A> =0A> * Ed Schouten wrote:= =0A> > One of the major obstacles for PCC is that it didn't support a way t= o=0A> > pack structures in a comfortable way. Most of the FreeBSD=0A> userl= and=0A> =0A just=0A> > built with it. Most of the stuff that didn't compile= properly, was=0A> > related to kernel headers, using __attribute__ stuff, = instead of the=0A> > cdef'd stuff, like __packed. It seems things have chan= ged in the mean=0A> > time.=0A> =0A> Indeed; PCC now supports _Pragma("pack= ed"). I've attached a patch for=0A> sys/cdefs.h that should make at least s= rc/bin compile like it should.=0A> The patch is in no way meant to be compl= ete.=0A> =0A> -- =0A> Ed Schouten =0A> WWW: http://g-rave.nl/=0A> =0A> = =0A> -----Inline Attachment Follows-----=0A> =0A> --- src/sys/sys/cdefs.h = 2006-09-21 03:38:58.000000000 +0200=0A> +++ src/sys/sys/cdefs.h 2007-1= 0-17 19:56:42.000000000 +0200=0A> @@ -111,7 +111,7 @@=0A> /*=0A> * Macro= to test if we're using a specific version of gcc or later.=0A> */=0A> -#= if defined(__GNUC__) && !defined(__INTEL_COMPILER)=0A> +#if defined(__GNUC_= _) && !defined(__INTEL_COMPILER)=0A> &&=0A> =0A !defined(__PCC__)=0A> #def= ine __GNUC_PREREQ__(ma, mi) \=0A> (__GNUC__ > (ma) || __GNUC__ = =3D=3D (ma) && __GNUC_MINOR__ >=3D (mi))=0A> #else=0A> @@ -140,7 +140,7 @@= =0A> #define __const const /* define reserved names=0A> t= o=0A> =0A standard */=0A> #define __signed signed=0A> #define __= volatile volatile=0A> -#if defined(__cplusplus)=0A> +#if defined(__cplus= plus) || defined(__PCC__)=0A> #define __inline inline /* conv= ert to C++ keyword */=0A> #else=0A> #if !(defined(__CC_SUPPORTS___INLINE)= )=0A> @@ -221,6 +221,15 @@=0A> #define __aligned(x) __attribute__((__al= igned__(x)))=0A> #define __section(x) __attribute__((__section__(x)))= =0A> #endif=0A> +#if defined(__PCC__)=0A> +#define __dead2=0A> +#define __= pure2=0A> +#define __unused=0A> +#define __used=0A> +#define __packed _P= ragma("packed")=0A> +#define __aligned(x)=0A> +#define __section(x)=0A> +#e= ndif=0A> #endif=0A> =0A> #if __GNUC_PREREQ__(2, 96)=0A=0AVery interestin= g, I just noticed David O'Brien is the maintainer of the pcc port in the Fr= eeBSD ports, and it was added in Sep, 17, 07, so I think FreeBSD is very in= terested on it ;)=0A=0A ---=0ARegards, =0A-Abdullah Ibn Hamad Al-Marri=0AAr= ab Portal=0Ahttp://www.WeArab.Net/=0A=0A=0A=0A=0A=0A_______________________= ___________________________=0ADo You Yahoo!?=0ATired of spam? Yahoo! Mail = has the best spam protection around =0Ahttp://mail.yahoo.com
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?766820.55482.qm>