Greg Ercolano wrote:
> MacArthur, Ian (SELEX GALILEO, UK) wrote:
>>>> I don't have
>>>> access to a big-endian 64-bit system to actually verify it on...!
>>> Thanks, I saw it in fltk.commit. I can't test it either (I'm prepared
>>> to install a 64-bit Ubuntu VM soon, though), but the code looks good
>>> to me, AFAICS.
>> OK - anyone got a 64-bit big-endian system? Must be someone with a PPC64
>> box somewhere I guess?
> 
>       I think my old SGI Indigo2 Extreme might qualify..

    Latest fltk 1.3.x seems to build OK (with some fixes to unrelated code).
    So e.g. in Fl_Preferences.cxx, the 'WORDS_BIGENDIAN' section compiled
    without error.

    Wasn't sure how to test it exactly, so I made a small foo.cxx
    app with the BIGENDIAN code inserted in:

-----------------------------------------------------------
#include <stdio.h>
#include <time.h>
int main() {
     time_t t = 1234;
     unsigned char b[20];

  union { void *pv; unsigned char a[sizeof(void*)]; } v;
  v.pv = (void *)(&t);

  // BIG ENDIAN
  b[8]  = v.a[sizeof(void*) - 1];
  b[9]  = v.a[sizeof(void*) - 2];
  b[10] = v.a[sizeof(void*) - 3];
  b[11] = v.a[sizeof(void*) - 4];

     printf("%p %02x %02x %02x %02x\n", (void*)&t, (unsigned int)b[8], 
(unsigned int)b[9], (unsigned int)b[10], (unsigned int)b[11]);
     return(0);
}
-----------------------------------------------------------

        When compiled and run, the result on the SGI (with -64 enabled):

-----------------------------------------------------------
# CC -64 -fullwarn -o foo foo.cxx
# ./foo
ffffffae80 80 ae ff ff
-----------------------------------------------------------

        I guess that's "right"?

        I tried changing the address to 0x9876543210 just to
        make it obvious, then ran the code again to make sure
        those bottom 4 bytes were being used, and result was
        as expected:

-----------------------------------------------------------
# CC -64 -fullwarn -o foo foo.cxx
huron 61# ./foo
9876543210 10 32 54 76
  \/\/\/\/ |  |  |  |
   | | | |_|  |  |  |
   | | |______|  |  |
   | |___________|  |
   |________________|
-----------------------------------------------------------
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to