diff --git a/src/clock.c b/src/clock.c index 52af58b..c4b5501 100644 --- a/src/clock.c +++ b/src/clock.c @@ -183,7 +183,7 @@ clk_calculate_bram_checksum(void) { } checksum &= 0xFFFF; checksum += ((checksum ^ 0xAAAA) << 16); -#ifdef GSPORT_LITTLE_ENDIAN +#if defined(GSPORT_LITTLE_ENDIAN) || defined (__LITTLE_ENDIAN__) // OSX needs to calculate endianness mid-compilation, can't be passed on compile command g_bram_ptr[252] = (checksum & 0xFF); g_bram_ptr[253] = (checksum >> 8); g_bram_ptr[254] = (checksum >> 16); diff --git a/src/iwm.c b/src/iwm.c index d311057..b4c9201 100644 --- a/src/iwm.c +++ b/src/iwm.c @@ -1898,7 +1898,7 @@ iwm_nibblize_track_525(Disk *dsk, Trk *trk, byte *track_buf, int qtr_track) word_ptr = (word32 *)&(trk->nib_area[0]); -#ifdef GSPORT_LITTLE_ENDIAN +#if defined(GSPORT_LITTLE_ENDIAN) || defined (__LITTLE_ENDIAN__) // OSX needs to calculate endianness mid-compilation, can't be passed on compile command val = 0xff08ff08; #else val = 0x08ff08ff; @@ -2003,7 +2003,7 @@ iwm_nibblize_track_35(Disk *dsk, Trk *trk, byte *track_buf, int qtr_track) int i; word_ptr = (word32 *)&(trk->nib_area[0]); -#ifdef GSPORT_LITTLE_ENDIAN +#if defined(GSPORT_LITTLE_ENDIAN) || defined (__LITTLE_ENDIAN__) val = 0xff08ff08; #else val = 0x08ff08ff; diff --git a/src/smartport.c b/src/smartport.c index 4bf3bb2..35591f3 100644 --- a/src/smartport.c +++ b/src/smartport.c @@ -642,7 +642,7 @@ do_write_c7(int unit_num, word32 buf, int blk) val1 = get_memory16_c(buf + i, 0); val2 = get_memory16_c(buf + i + 2, 0); /* reorder the little-endian bytes to be big-endian */ -#ifdef GSPORT_LITTLE_ENDIAN +#if defined(GSPORT_LITTLE_ENDIAN) || defined (__LITTLE_ENDIAN__) // OSX needs to calculate endianness mid-compilation, can't be passed on compile command val = (val2 << 16) + val1; #else val = (val1 << 24) + ((val1 << 8) & 0xff0000) + diff --git a/src/sound.c b/src/sound.c index 78bf09c..59c4944 100644 --- a/src/sound.c +++ b/src/sound.c @@ -1,6 +1,6 @@ /* GSport - an Apple //gs Emulator - Copyright (C) 2010 by GSport contributors + Copyright (C) 2010 - 2012 by GSport contributors Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey @@ -1058,7 +1058,7 @@ sound_play(double dsamps) #if defined(__linux__) || defined(OSS) /* Linux seems to expect little-endian */ /* samples always, even on PowerPC */ -# ifdef GSPORT_LITTLE_ENDIAN +#if defined(GSPORT_LITTLE_ENDIAN) || defined (__LITTLE_ENDIAN__) // OSX needs to calculate endianness mid-compilation, can't be passed on compile command sndptr[pos] = (val << 16) + (val0 & 0xffff); # else sndptr[pos] = ((val & 0xff) << 24) + @@ -1067,7 +1067,7 @@ sound_play(double dsamps) ((val0 >> 8) & 0xff); # endif #else -# ifdef GSPORT_LITTLE_ENDIAN +#if defined(GSPORT_LITTLE_ENDIAN) || defined (__LITTLE_ENDIAN__) // OSX needs to calculate endianness mid-compilation, can't be passed on compile command sndptr[pos] = (val << 16) + (val0 & 0xffff); # else sndptr[pos] = (val0 << 16) + (val & 0xffff); diff --git a/src/sound_driver.c b/src/sound_driver.c index 5c8e6e2..cd55dd0 100644 --- a/src/sound_driver.c +++ b/src/sound_driver.c @@ -1,6 +1,6 @@ /* GSport - an Apple //gs Emulator - Copyright (C) 2010 by GSport contributors + Copyright (C) 2010 - 2012 by GSport contributors Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey @@ -398,7 +398,7 @@ child_sound_init_linux() exit(1); } -#ifdef GSPORT_LITTLE_ENDIAN +#if defined(GSPORT_LITTLE_ENDIAN) || defined (__LITTLE_ENDIAN__) // OSX needs to calculate endianness mid-compilation, can't be passed on compile command fmt = AFMT_S16_LE; #else fmt = AFMT_S16_BE; diff --git a/src/video.c b/src/video.c index dc818d2..965c248 100644 --- a/src/video.c +++ b/src/video.c @@ -1,6 +1,6 @@ /* GSport - an Apple //gs Emulator - Copyright (C) 2010 by GSport contributors + Copyright (C) 2010 - 2012 by GSport contributors Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey @@ -516,7 +516,7 @@ video_init() val1 = g_dhires_colors_16[col[1] & 0xf]; val2 = g_dhires_colors_16[col[2] & 0xf]; val3 = g_dhires_colors_16[col[3] & 0xf]; -#ifdef GSPORT_LITTLE_ENDIAN +#if defined(GSPORT_LITTLE_ENDIAN) || defined (__LITTLE_ENDIAN__) // OSX needs to calculate endianness mid-compilation, can't be passed on compile command val = (val3 << 24) + (val2 << 16) + (val1 << 8) + val0; #else val = (val0 << 24) + (val1 << 16) + (val2 << 8) + val3; @@ -1622,7 +1622,7 @@ redraw_changed_gr(int start_offset, int start_line, int num_lines, int reparse, (val0 << 8) + val0; val1_wd = (val1 << 24) + (val1 << 16) + (val1 << 8) + val1; -#ifdef GSPORT_LITTLE_ENDIAN +#if defined(GSPORT_LITTLE_ENDIAN) || defined (__LITTLE_ENDIAN__) // OSX needs to calculate endianness mid-compilation, can't be passed on compile command val01_wd = (val1_wd << 16) + (val0_wd & 0xffff); #else val01_wd = (val0_wd << 16) + (val1_wd & 0xffff); @@ -1762,7 +1762,7 @@ redraw_changed_dbl_gr(int start_offset, int start_line, int num_lines, (val2 << 8) + val2; val3_wd = (val3 << 24) + (val3 << 16) + (val3 << 8) + val3; -#ifdef GSPORT_LITTLE_ENDIAN +#if defined(GSPORT_LITTLE_ENDIAN) || defined (__LITTLE_ENDIAN__) // OSX needs to calculate endianness mid-compilation, can't be passed on compile command val01_wd = (val1_wd << 24) + (val0_wd&0xffffff); val12_wd = (val2_wd << 16) + (val1_wd & 0xffff); val23_wd = (val3_wd << 8) + (val2_wd & 0xff); diff --git a/src/xdriver.c b/src/xdriver.c index 7de5e92..6a71182 100644 --- a/src/xdriver.c +++ b/src/xdriver.c @@ -895,7 +895,7 @@ get_ximage(Kimage *kimage_ptr) xim = XCreateImage(g_display, g_vis, depth, ZPixmap, 0, (char *)ptr, width, height, 8, 0); -#ifdef GSPORT_LITTLE_ENDIAN +#if defined(GSPORT_LITTLE_ENDIAN) || defined (__LITTLE_ENDIAN__) // OSX needs to calculate endianness mid-compilation, can't be passed on compile command xim->byte_order = LSBFirst; #else xim->byte_order = MSBFirst;