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

[PATCH]: default byteorder

Thread Next
From:
Wilfredo Sánchez
Date:
July 31, 2000 19:53
Subject:
[PATCH]: default byteorder
Message ID:
200008010245.TAA04459@ns1.abstrata.com
  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?

	-Fred

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

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About