Browse Source

fix builds on macOS Catalina (10.15.7)

The `_DARWIN_BETTER_REALPATH` flag fixes the file device reading directories.

The colors change fixes an integer size error in the code below it.

I have a few other quality of life commits on the `macbuild` branch of my
git.sr.ht/~apiarian/uxn fork for more Mac convenience, but the probably don't
belong in the main branch of uxn. Maybe we can explore adding them as build
flags?

- al
main
Aleksandr Pasechnik 9 months ago committed by Devine Lu Linvega
parent
commit
eea4a5a3db
  1. 2
      build.sh
  2. 3
      src/devices/screen.c

2
build.sh

@ -64,7 +64,7 @@ MSYS_NT*|MINGW*) # MSYS2 on Windows
fi
;;
Darwin) # macOS
CFLAGS="${CFLAGS} -Wno-typedef-redefinition -D_C99_SOURCE"
CFLAGS="${CFLAGS} -Wno-typedef-redefinition -D_C99_SOURCE -D_DARWIN_BETTER_REALPATH"
UXNEMU_LDFLAGS="$(sdl2-config --cflags --static-libs)"
;;
Linux|*)

3
src/devices/screen.c

@ -50,7 +50,8 @@ screen_change(int x1, int y1, int x2, int y2)
void
screen_palette(void)
{
int i, shift, colors[4];
int i, shift;
unsigned long colors[4];
for(i = 0, shift = 4; i < 4; ++i, shift ^= 4) {
Uint8
r = (uxn.dev[0x8 + i / 2] >> shift) & 0xf,

Loading…
Cancel
Save