9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] endianess and 3rd party libraries
@ 2015-01-29 15:51 Steve Simon
  2015-01-29 16:17 ` erik quanstrom
  0 siblings, 1 reply; 3+ messages in thread
From: Steve Simon @ 2015-01-29 15:51 UTC (permalink / raw)
  To: 9fans

I have some very un-plan9 3rd party libraries which rely on a
#define to do byte swapping for endianess.

Anyone have a neet recipie for mk to d3etect the
current machines endianess?

I know, I feel dirty just asking but what can I do,
there is too much code to rewrite them properly.

off to get my hair shirt...

-Steve



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [9fans] endianess and 3rd party libraries
  2015-01-29 15:51 [9fans] endianess and 3rd party libraries Steve Simon
@ 2015-01-29 16:17 ` erik quanstrom
  2015-01-29 17:09   ` Quintile
  0 siblings, 1 reply; 3+ messages in thread
From: erik quanstrom @ 2015-01-29 16:17 UTC (permalink / raw)
  To: 9fans

On Thu Jan 29 07:47:49 PST 2015, steve@quintile.net wrote:
> I have some very un-plan9 3rd party libraries which rely on a
> #define to do byte swapping for endianess.
>
> Anyone have a neet recipie for mk to d3etect the
> current machines endianess?

; for(i in /*/include/u.h)echo -n $i '	' && <$i awk '/union FPdbleword/{s=1} s && /.*lo;/{print "-Dlittleendian"; exit}s && /.*hi;/{print "-Dbigendian"; exit}'
/386/include/u.h 	-Dlittleendian
/68000/include/u.h 	-Dbigendian
/68020/include/u.h 	-Dbigendian
/alpha/include/u.h 	-Dlittleendian
/amd64/include/u.h 	-Dlittleendian
/arm/include/u.h 	-Dlittleendian
/mips/include/u.h 	-Dbigendian
/power/include/u.h 	-Dbigendian
/power64/include/u.h 	-Dbigendian
/sparc/include/u.h 	-Dbigendian
/sparc64/include/u.h 	-Dbigendian

- erik



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [9fans] endianess and 3rd party libraries
  2015-01-29 16:17 ` erik quanstrom
@ 2015-01-29 17:09   ` Quintile
  0 siblings, 0 replies; 3+ messages in thread
From: Quintile @ 2015-01-29 17:09 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

perfect,

Thanks Erik, you'r a star.

-Steve





> On 29 Jan 2015, at 16:17, erik quanstrom <quanstro@quanstro.net> wrote:
> 
>> On Thu Jan 29 07:47:49 PST 2015, steve@quintile.net wrote:
>> I have some very un-plan9 3rd party libraries which rely on a
>> #define to do byte swapping for endianess.
>> 
>> Anyone have a neet recipie for mk to d3etect the
>> current machines endianess?
> 
> ; for(i in /*/include/u.h)echo -n $i '    ' && <$i awk '/union FPdbleword/{s=1} s && /.*lo;/{print "-Dlittleendian"; exit}s && /.*hi;/{print "-Dbigendian"; exit}' 
> /386/include/u.h    -Dlittleendian
> /68000/include/u.h    -Dbigendian
> /68020/include/u.h    -Dbigendian
> /alpha/include/u.h    -Dlittleendian
> /amd64/include/u.h    -Dlittleendian
> /arm/include/u.h    -Dlittleendian
> /mips/include/u.h    -Dbigendian
> /power/include/u.h    -Dbigendian
> /power64/include/u.h    -Dbigendian
> /sparc/include/u.h    -Dbigendian
> /sparc64/include/u.h    -Dbigendian
> 
> - erik



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-01-29 17:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-29 15:51 [9fans] endianess and 3rd party libraries Steve Simon
2015-01-29 16:17 ` erik quanstrom
2015-01-29 17:09   ` Quintile

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).