shinyquagsire23 / makefst

CDN FST packer and packager for Wii U homebrew
MIT License
13 stars 0 forks source link

Fixes for macOS #4

Closed CreeperMario closed 7 years ago

CreeperMario commented 7 years ago

macOS does things a little differently in terms of copying string buffers. On Linux/Windows, you can copy a source buffer to a destination buffer, even if they overlap, as long as the source buffer is after the destination buffer.

But ISO had not defined a standard reaction to this kind of event, and as such, Apple's implementation of libc aborts if the two buffers overlap each other. I resolve this by allocating a temporary buffer and using that to perform string operations.

I have also suppressed some compiler warnings, and added checks to filter out normally hidden files (files that shouldn't be included in the FST, such as thumbnails, lock files, etc.) which are often another source of segmentation faults on macOS.

This PR potentially resolves #2.

NOTE: I have not tested these changes on a Linux/Windows setup, and am unsure if I have broken anything on those platforms.

shinyquagsire23 commented 7 years ago

LGTM