develooper Front page | perl.perl5.porters | Postings from July 2000

[PATCH]: default byteorder

Thread Next
Wilfredo Sánchez
July 31, 2000 19:53
[PATCH]: default byteorder
Message ID:
  Presently, Configure sets $Config::Config{byteorder} to 0xffff, which means
"I dunno" when cross-compiling, or compiling for multiple architectures.  The
latter affects us, since we build perl for both i386 and ppc in Darwin, and the
result is we get this 0xffff value there, and some CPAN module puke on that,
which they probably shouldn't, but there you go.

  The fix that has been suggested is to set the byteorder to this expression if
the target architecture isn't known:

join('', unpack('aaaa', pack('I', (((((52 << 8) + 51) << 8) + 50) << 8) + 49)));

  This works on Darwin for both PowerPC and Intel.

  Does this seem like a reasonable alternative to giving up and saying we  
don't know?


Wilfredo Sánchez,
Open Source Engineering Lead
Apple Computer, Inc., Core Operating System Group
1 Infinite Loop, Cupertino, CA 94086, 408.974-5174

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About